Ask Your Question
1

generating an array of convex polyhedrons

asked 2012-08-04 22:33:55 +0200

mfa gravatar image

updated 2015-01-13 20:36:28 +0200

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
1

answered 2016-01-05 02:58:20 +0200

vdelecroix gravatar image

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

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

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

Stats

Asked: 2012-08-04 22:33:55 +0200

Seen: 376 times

Last updated: Jan 05 '16