First time here? Check out the FAQ!

Ask Your Question
1

generating an array of convex polyhedrons

asked 12 years ago

mfa gravatar image

updated 10 years ago

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 9 years ago

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

Preview: (hide)
link

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: 12 years ago

Seen: 467 times

Last updated: Jan 05 '16