Ask Your Question

Revision history [back]

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