STL parsing: face interpretation


#1

Hey everyone!
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. :wink: 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
#2

Hey Simon,

Not sure. I’ve never done it before. I only grokked this from wikipedia:

UINT8[80] – Header
UINT32 – Number of triangles


foreach triangle
REAL32[3] – Normal vector
REAL32[3] – Vertex 1
REAL32[3] – Vertex 2
REAL32[3] – 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.