ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 12 Sep 2016 18:56:25 +0200Face of a polytopehttps://ask.sagemath.org/question/34799/face-of-a-polytope/ Consider a finite set l of points in R^4. I define a polyotpe with P= Polyhedron(l). I consider the set of faces of dimension 2 with P.faces(2).
My question is to find the set of faces of dimension 2 which contains one vertex. What is the command ?
Best regards,
Mon, 12 Sep 2016 14:41:20 +0200https://ask.sagemath.org/question/34799/face-of-a-polytope/Answer by nb for <p>Consider a finite set l of points in R^4. I define a polyotpe with P= Polyhedron(l). I consider the set of faces of dimension 2 with P.faces(2). </p>
<p>My question is to find the set of faces of dimension 2 which contains one vertex. What is the command ?
Best regards,</p>
https://ask.sagemath.org/question/34799/face-of-a-polytope/?answer=34801#post-id-34801Thanks
PS: plus rapide que par email :)Mon, 12 Sep 2016 18:56:25 +0200https://ask.sagemath.org/question/34799/face-of-a-polytope/?answer=34801#post-id-34801Answer by tmonteil for <p>Consider a finite set l of points in R^4. I define a polyotpe with P= Polyhedron(l). I consider the set of faces of dimension 2 with P.faces(2). </p>
<p>My question is to find the set of faces of dimension 2 which contains one vertex. What is the command ?
Best regards,</p>
https://ask.sagemath.org/question/34799/face-of-a-polytope/?answer=34800#post-id-34800You can do a Python list extension as follows:
sage: C = polytopes.hypercube(4) ; C
A 4-dimensional polyhedron in ZZ^4 defined as the convex hull of 16 vertices
sage: v = C.vertices()[0] ; v
A vertex at (-1, -1, -1, -1)
sage: [f for f in C.faces(2) if v in f.vertices()]
[<0,1,2,3>, <0,1,4,5>, <0,2,4,6>, <0,1,8,9>, <0,2,8,10>, <0,4,8,12>]
Mon, 12 Sep 2016 17:38:42 +0200https://ask.sagemath.org/question/34799/face-of-a-polytope/?answer=34800#post-id-34800