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.Sat, 22 Jan 2022 18:23:57 +0100To find the ordered vertices of the faces of a 3D polyhedron with Vrepresentationhttps://ask.sagemath.org/question/60760/to-find-the-ordered-vertices-of-the-faces-of-a-3d-polyhedron-with-vrepresentation/ I have this list of vertices of a polyhedron in 3D.
V=[[0.00, 0.00, 2.0],
[1.0, 0.31, 1.0],
[1.2, 0.00, 0.62],
[1.0, 0.00, 0.00],
[0.078, 0.31, 2.0],
[0.00, 0.31, 2.0],
[0.00, 0.62, 0.00],
[0.00, 0.00, 0.00],
[0.00, 0.88, 0.50]]
Thoses vertices define some faces listed in the following list
F= [[0.00, 0.00, 2.0],
[1.0, 0.31, 1.0],
[1.2, 0.00, 0.62],
[1.0, 0.00, 0.00],
[0.078, 0.31, 2.0],
[0.00, 0.31, 2.0],
[0.00, 0.62, 0.00],
[0.00, 0.00, 0.00],
[0.00, 0.88, 0.50]]
Sage is able to gives a list for indexes of vertices wghich belongs to a face :
fC=[[0, 2, 4, 6],
[0, 1, 4, 5],
[0, 1, 2, 3],
[1, 3, 5, 7],
[2, 3, 6, 7],
[4, 5, 6, 7]]
but unfortunately the indices are not necessarily given in the good order that gives the convex hull of each sublist of vertices in `fc`. I know the adjacency matrix of polyhedron which is
A=[[0 1 1 0 1 0 0 0],
[1 0 0 1 0 1 0 0],
[1 0 0 1 0 0 1 0],
[0 1 1 0 0 0 0 1],
[1 0 0 0 0 1 1 0],
[0 1 0 0 1 0 0 1],
[0 0 1 0 1 0 0 1],
[0 0 0 1 0 1 1 0]]
I am a bad programmer and I do not know how to find the good permutation of the sublist in `fc` (Perhaps ther is a simple way that the one I suggest). I need help. Thanks in advance.Sat, 22 Jan 2022 10:47:09 +0100https://ask.sagemath.org/question/60760/to-find-the-ordered-vertices-of-the-faces-of-a-3d-polyhedron-with-vrepresentation/Comment by slelievre for <p>I have this list of vertices of a polyhedron in 3D.</p>
<pre><code>V=[[0.00, 0.00, 2.0],
[1.0, 0.31, 1.0],
[1.2, 0.00, 0.62],
[1.0, 0.00, 0.00],
[0.078, 0.31, 2.0],
[0.00, 0.31, 2.0],
[0.00, 0.62, 0.00],
[0.00, 0.00, 0.00],
[0.00, 0.88, 0.50]]
</code></pre>
<p>Thoses vertices define some faces listed in the following list</p>
<pre><code>F= [[0.00, 0.00, 2.0],
[1.0, 0.31, 1.0],
[1.2, 0.00, 0.62],
[1.0, 0.00, 0.00],
[0.078, 0.31, 2.0],
[0.00, 0.31, 2.0],
[0.00, 0.62, 0.00],
[0.00, 0.00, 0.00],
[0.00, 0.88, 0.50]]
</code></pre>
<p>Sage is able to gives a list for indexes of vertices wghich belongs to a face :</p>
<pre><code>fC=[[0, 2, 4, 6],
[0, 1, 4, 5],
[0, 1, 2, 3],
[1, 3, 5, 7],
[2, 3, 6, 7],
[4, 5, 6, 7]]
</code></pre>
<p>but unfortunately the indices are not necessarily given in the good order that gives the convex hull of each sublist of vertices in <code>fc</code>. I know the adjacency matrix of polyhedron which is</p>
<pre><code>A=[[0 1 1 0 1 0 0 0],
[1 0 0 1 0 1 0 0],
[1 0 0 1 0 0 1 0],
[0 1 1 0 0 0 0 1],
[1 0 0 0 0 1 1 0],
[0 1 0 0 1 0 0 1],
[0 0 1 0 1 0 0 1],
[0 0 0 1 0 1 1 0]]
</code></pre>
<p>I am a bad programmer and I do not know how to find the good permutation of the sublist in <code>fc</code> (Perhaps ther is a simple way that the one I suggest). I need help. Thanks in advance.</p>
https://ask.sagemath.org/question/60760/to-find-the-ordered-vertices-of-the-faces-of-a-3d-polyhedron-with-vrepresentation/?comment=60763#post-id-60763A similar question was asked some time ago:
- [Ask Sage question 57483: How to obtain the vertices of the faces of a polyhedron in the cycling order?](https://ask.sagemath.org/question/57483)
Someone found a solution but unfortunately did not post it.Sat, 22 Jan 2022 18:23:57 +0100https://ask.sagemath.org/question/60760/to-find-the-ordered-vertices-of-the-faces-of-a-3d-polyhedron-with-vrepresentation/?comment=60763#post-id-60763