1 | initial version |
This is probably a hack since it touches a hidden attribute, but you can try the following:
Setting:
sage: A = polytopes.associahedron(['A',3])
sage: f = list(A.face_generator())[2]
sage: f
A 2-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 5 vertices
sage: G = f.as_polyhedron().faces(1) ; G
(A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices)
sage: g = G[0]
sage: g
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices
Your problem is that :
sage: g.polyhedron()
A 2-dimensional polyhedron in QQ^3 defined as the convex hull of 5 vertices
sage: g.polyhedron() == f.as_polyhedron()
True
sage: g.polyhedron() == A
False
What you can try:
sage: g._polyhedron = A
Then you have:
sage: g.polyhedron()
Generalized associahedron of type ['A', 3] with 14 vertices
sage: g.polyhedron() == A
True
Then, you should play with it to see whether there are side effects. I did not check the source code for that.
2 | No.2 Revision |
This is probably a hack since it touches a hidden attribute, but you can try the following:
Setting:
sage: A = polytopes.associahedron(['A',3])
sage: f = list(A.face_generator())[2]
sage: f
A 2-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 5 vertices
sage: G = f.as_polyhedron().faces(1) ; G
(A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices)
sage: g = G[0]
sage: g
A 1-dimensional face of a Polyhedron in QQ^3 defined as the convex hull of 2 vertices
Your problem is that :
sage: g.polyhedron()
A 2-dimensional polyhedron in QQ^3 defined as the convex hull of 5 vertices
sage: g.polyhedron() == f.as_polyhedron()
True
sage: g.polyhedron() == A
False
What you can try:
sage: g._polyhedron = A
Then you have:
sage: g.polyhedron()
Generalized associahedron of type ['A', 3] with 14 vertices
sage: g.polyhedron() == A
True
Then, you should play with it to see whether there are side effects. I did not check the source code for that.that, use at you own risk.