Does anyone have an idea, how to extract the faces array from a stl file? Is there any information within the file format possibly? I manage to upload the mesh object, but the face interpretation is not quite as expected. So far, I am using the same earcut method as tom, but it seems that it is not working for stl…
Best practice for triangulating meshes
Not sure. I’ve never done it before. I only grokked this from wikipedia:
UINT8 – Header UINT32 – Number of triangles foreach triangle REAL32 – Normal vector REAL32 – Vertex 1 REAL32 – Vertex 2 REAL32 – Vertex 3 UINT16 – Attribute byte count end
Which looks straight forward enough… If you share the code, and maybe a screenshot of what’s happening, that could help.