I would like to get the array of the triangles, but I can’t find it in the geometry object.
.faces aren’t triangles. If I create a cube, then a face looks like this:
"faces": [{
"a": 0,
"b": 2,
"c": 3,
"d": 1,
...
These are polygons, not faces.
![]()
If you push a
Face4intofaces, then you’re going to end up with a quad when calling faces. If you’re pushingFace3intofacesthen you’ll get a triangle back. If you’re getting adon afacescall, you pushed aFace4.If you’re asking how to get tris from a quad, that’s a different question.
Basically, knowing that the ‘order’ of the quad is
A B C Dyou can generally say thatA B CandA C Dare triangles that will share the approximate normal of the quad. (I saw approximate because the quad may be slightly skewed. The less co-planar the points are, the more the skew will be apparent, and the more difference the normals will have.)Now, there are other combinations that will work. The easiest way to do it is to draw out
A B C Don some paper, and note the direction (Clockwise or Counterclockwise). As long as your tris are also that same direction (which ever it was) then you’ll be just fine. Clearly, ifA B Cis a valid tri, then so wouldB C AandC A B. The same goes forA C DbeingC D AandD A C. But you could split it across the other diagonal if you wanted as well, and formA B DandB C D. Following the previous logic you create the other identical triangles for those.