ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 05 Jan 2016 02:58:20 +0100generating an array of convex polyhedronshttps://ask.sagemath.org/question/9206/generating-an-array-of-convex-polyhedrons/I have a convex polyhedron and an set of planes and I need to get an array based on the cut or division the original given polyhedron with the set of planes. Then I would like process it array.Sat, 04 Aug 2012 22:33:55 +0200https://ask.sagemath.org/question/9206/generating-an-array-of-convex-polyhedrons/Answer by vdelecroix for <p>I have a convex polyhedron and an set of planes and I need to get an array based on the cut or division the original given polyhedron with the set of planes. Then I would like process it array.</p>
https://ask.sagemath.org/question/9206/generating-an-array-of-convex-polyhedrons/?answer=32070#post-id-32070 You could just do intersection of polyhedra
sage: P = Polyhedron([(0,0), (0,2), (1,1), (2,0)]) # polyhedron given by its vertices
sage: L1 = Polyhedron(eqns = [(1,1,-1)]) # polyhedron given by an equation
sage: L2 = Polyhedron(eqns = [(1,-1,0)])
sage: P.plot() + L1.plot(color='red') + L2.plot(color='blue')
![image description](/upfiles/14519588679334124.png)
Then
sage: Q1 = P.intersection(L1)
sage: Q2 = P.intersection(L2)
sage: (Q1.plot(color='red') + Q2.plot(color='blue')).show(xmin=-1, xmax=2, ymin=-1, ymax=2)
![image description](/upfiles/14519590516671321.png)Tue, 05 Jan 2016 02:58:20 +0100https://ask.sagemath.org/question/9206/generating-an-array-of-convex-polyhedrons/?answer=32070#post-id-32070