Reputation: 19
I am trying to solidify/add thickness to a 3D STL file for a research project.
So far, I can do that in Blender, but I don't want to solidify the object in Blender.
Are there other ways to solidify/add thickness to the STL file using commands/Python script without GUI application (like Blender, MeshLab, etc.)?
Upvotes: 0
Views: 915
Reputation: 889
Parse the STL file using whatever method you like (I've previously posted some Python STL parsing code here, but you could also use any existing libraries).
Then, identify all boundary edges. Each facet has 3 edges, which you can hash by their indices and count how many times each edge is found in the mesh. Boundary edges will only be found once.
For each triangle, make a copy, flip it, and move its vertices by some amount in the direction of the copied triangle's normal.
If the triangle had any boundary edges, you must generate 2 triangles per boundary edge to connect both the original and copied triangle.
Upvotes: 1