Contents
Target Outcome
An stl free of errors ready to mesh.
Protocols
Required Infrastructure
MeshLab is an open source, portable, and extensible system for the processing and editing of unstructured 3D triangular meshes (GPL license, see http://meshlab.sourceforge.net/).
Input
An stl that won't mesh.
Procedures-Automated
You can use meshlabserver in the command line, and utilizethis to quickly fix your meshes, although this filter can not fix self-intersecting faces. Make sure you are either in the proper folder or use the full path for the files. The command should look something like:
meshlabserver -i path/to/input.stl -s path/to/Cleaning_Filter.mlx -o path/to/output.stl
Procedures-Manual
If your stl won't mesh it probably means it isn't manifold, or it isn't watertight. MeshLab can handle both of these issues. It may also be worth checking the normal vectors.
Render > Show Non Manif Edges
If it's not clear, the section heading is a menu option, select it. This will highlight the non manifold edges.
- Change the focus of the screen to just one of the highlighted edges.
Using the Select Faces in a rectangular region option, select and Delete the current set of select faces and all the vertices surrounded by that faces faces on the bad edges. Don't worry about holes.
If you press Alt the tool will only select the top layer and not faces further back as well.
If you press Shift the tool will deselect from the current selection.
Render > Show Boundary Edges
Select this option to see Boundary edges. Boundary edges occur when you have an exposed edge, due to a hole or an edge connected to only 1 face. A watertight surface should not have any. Select and delete faces. Don't worry about holes.
Render > Show Non Manif Vertices
Select this option to see non manifold vertices, at this point they should be orphan nodes. Select Filters > Cleaning and Repairing > Remove Unreferenced Vertex
Filters > Selection > Select Self Intersecting Faces
Note that this section is mainly for .stl files that have been cut with CutStlWithStl.py. If there are self intersecting faces in a mesh, Salome will throw errors such as, "Some edges multiple times in surface mesh" and "Intersecting triangles". These errors are likely due to the CutStlWithStl.py script utilizing boolean filters, which can sometimes produce boundary edges, non manifold edges, and self intersecting faces. The Select Self Intersecting Faces filter can help you visualize areas that contain a self intersecting face and will need manual cleaning. Note the filter returns many false positives, only select and delete the faces that contain overlapping faces.
Filters > Remeshing, Simplification, and Reconstruction > Close Holes
Use this to fill the holes. The standard options seem to work well. Click Apply.
This should have fixed the problem. Save the changes.
Render > Show Face Normals
This will draw blue line from the center of all of the faces. SALOME meshes better if all of the vectors are point "outward". Once the mesh is manifold use Filter > Normals, Curvatures and Orientation > Re-Orient all faces coherently
If it still doesn't mesh
You can send the region that Salome can't mesh with to a group and visualize where the problem is occurring if you are using the GUI. If the above steps do not fix your mesh, please update this page when you resolve your meshing issues.
Output
A repaired stl that will work with volumetric meshing algorithms. Back to Mesh Generation.