Ask Your Question

generating an array of convex polyhedrons

asked 2012-08-04 15:33:55 -0500

mfa gravatar image

updated 2015-01-13 13:36:28 -0500

FrédéricC gravatar image

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.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2016-01-04 19:58:20 -0500

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


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

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-08-04 15:33:55 -0500

Seen: 176 times

Last updated: Jan 04 '16