The Definitive Guide to STL Model Restoration [3D Printing]

Designers and engineers often need software to adjust, fix and finalize 3D models for 3D printing. Fortunately, the days of manual grid programming are long gone.

insert image description here

Recommendation: Use NSDT Designer to quickly build programmable 3D scenes.

Today, there is a range of specialized tools that provide automatic and manual STL repair capabilities. The Auto Wizard is sufficient for most models and fixes minor errors such as holes and loose shells, but models with more serious errors will require a standalone solution.

In this guide, we describe our workflow for repairing STL files, and walk through the process using five of the best STL repair software tools to fully repair your model for 3D printing readiness.

1. Why repair STL files?

3D designers often build models using complex surfacing methods. This produces mathematically "perfect" geometric shapes defined by curves and splines. For 3D printing, the surface is converted to a mesh format describing the geometry as a cloud of connected triangular faces and vertices.

Mesh conversion is like breaking a perfectly smooth mirror and then gluing all the pieces together so that it looks like the original. When done poorly, the result is a model with all kinds of edges, holes, and floating parts, as well as areas with many intersecting triangles that do not belong to the model. When done right, the 3D print is a manifold mesh without holes, indistinguishable from the original design.
insert image description here

A 3D model mesh with multiple defects

2. How to repair STL files

A typical STL file repair workflow consists of the following steps:

  • Automatic repair. STL Repair Software's wizard will attempt to repair all major errors, including holes, split shells and intersections.
  • Separate the shell. A mesh consists of a collection of connected triangles. It can consist of multiple contiguous surfaces, ideally connected together, while obsolete surfaces need to be removed.
  • Plug the holes and bridge the gaps. Some comprehensive STL fixes allow different hole filling methods such as planar, tangent, ruled or freeform.
  • Solve overlapping and intersection problems. This usually requires recomputing the entire section of the mesh.
  • Filters out double-sided, double-vertex, inverted normals, and sharp, narrow triangles.
  • Sew open edges and remaining holes.
  • Manual repair by deleting and creating triangles.
  • Remesh to optimize triangle count.
  • Export to selected grid format.

The most popular and storage-friendly format is STL (StereoLiThography), which we will use in this article. We recommend saving .STL files in binary format, as it further reduces file size. As mentioned in our Meshmixer tutorial, there are several other useful formats, such as AMF, Collada, OBJ, and PLY, which have special qualities for storing material, color, rendering, 3D scanning, and 3D printing information.

There are several software packages that provide mesh repair capabilities, such as FreeCAD, SketchUp, 3D Studio Max, and Rhinoceros, as well as online services such as Willit 3D Print, MakePrintable, 3DPrinterOS, SculptGL, and Shapeways.

3. Comparison of STL model repair tools

effectiveness efficiency UI Versatility mesh reconstruction automatic repair top features Who is it for? cost
Meshmixer ★★★★ ★★★ ★★★★ ★★★★ ★★★★★ ★★★★ UI, mesh refactoring and auto-healing 3D artist free
Netfab ★★★ ★★★ ★★★ ★★★★ ★★★ ★★★ padding and support engineer Free (edu)
Magics ★★★ ★★★ ★★★ ★★★★★ ★★★★ ★★★ manual repair engineer to pay
Blender ★★★★ ★★ ★★ ★★★ ★★★★ cg artist free
Meshlab ★★ ★★★★ ★★★★★ 3D scanning free

According to our exploration, the best STL repair tool is Meshmixer. It combines a user-friendly interface with all the options you need to fix complex mesh errors. Its extra possibilities and free availability make it the undisputed number one. Meshmixer is also a useful tool for editing STL files, resculpting entire sections, and optimizing and finalizing 3D models.

Autodesk's Netfabb stands out for its advanced 3D print preparation features aimed at engineers.

Magics is a professional STL editor solution that offers a wide variety of STL file repair functions, but usually requires more manual repair work. Therefore, Magics is in third place.

While Blender is better suited for 3D modeling and has a sophisticated interface, it still provides most of the functionality needed for successful mesh restoration.

Finally, Meshlab is a must-have lightweight mesh viewer and editor that makes up for what it lacks in file repair capabilities and user-friendliness with advanced remeshing scripts.

The following section tests five STL repair tools using a complex 3D model of a coat hook that has several major errors, including holes, gaps, intersections, and floating triangles. The hooks need to be combined with the mounting cylinders to form a single waterproof mesh.

Read on for a step-by-step fix for five of the best STL fixes.

4、Meshmixer

Meshmixer is a versatile and user-friendly mesh editing program. Not only can you optimize triangular meshes, but you can also resculpt entire sections, stylize your model, or add useful features to it.

When loading the coat hook into Meshmixer and launching Analysis → Inspector, we found that it did show all mesh errors. Under Shaders, select X-ray mode for better visibility. Before fixing individual errors by clicking on the point indicators or running Auto-Fix All, make sure you select the correct hole fill mode, this will be enough to get the job done in most cases.

insert image description here

Use the X-ray shader in the inspector to see all errors

Another hole repair procedure is to select the area around the hole and use the Edit → Erase and Fill (F) operation from the pop-up menu. Setting the type to Smooth MVC produces nice continuous padding. Edit → Make Solid or Edit → Replace and Fill are other alternatives to produce a closed mesh. Additional manipulation with the RobustSmooth Sculpting Pen will fully incorporate the improved areas into the model.

If the model consists of separate shells, go to Edit → Separate Shells and open the Object Browser (Ctrl+Shift+O). Now gradually select two shells at a time and click Boolean Union from the popup. In the newly opened submenu, "Exact" or "Maximum Mass" modes will preserve the intersecting curve between two objects, while "Quick Approximation" is much faster and usually sufficient.

If the Boolean operation fails, two red objects are produced. In this case, turn up the "Search Depth" parameter and lower the "Target Edge Scale" to increase the chance of success. Checking using intersecting curves can also improve quality. If all else fails, moving one of the shells by a few hundredths of a millimeter in the Edit → Transform section should do the trick.

AutoFix All will remove floating parts and patch all boundary loops. In this case we want to manually connect the gap in one of the struts. This is where bridging tools come in. It works best on straight sections, and since this is a gap between circular loops, it's best patched in sections. Choose Edit→Select and highlight the triangles on both sides that you want to join. Then click Edit→Bridge (Ctrl+B) from the popup menu and set the Optimize parameter high enough for a smooth connection. Repeat the Bridge command for a few areas around the gap, then use the inspector to fill in the remaining holes. A good error prevention practice is to use Edit → Remesh before repairing to increase and homogenize the triangulation of the area of ​​interest.
insert image description here

Connecting cylindrical gaps required multiple bridging, remeshing, and hole filling operations in Meshmixer.

5、Meshlab

Meshlab is a software suite specialized in mesh manipulation in relation to 3D scan data and offers many re-triangulation and advanced inpainting algorithms. A useful method is Filter→Remesh, Simplify and Construct→Simplify (Quadratic Edge Collapse Decimation), as it recomputes the mesh based on the target number of faces. Checking Plane Simplification will best preserve planes. Another triangle reduction method is Filter→Clean and Repair→Merge Closed Vertices.

Floating elements can be detected by right-clicking on the part in the project window and selecting "Split in Connected Components". The individual shells can then be removed individually or merged back with CSG operations using the Union operator.

insert image description here

Basic repair utilities in Meshlab: closed cells, Boolean operations, and brush selection.

To bridge gaps, groups of triangles can be deleted using the Select Faces in Rectangular Area tool in the toolbar. Hold down the Alt key to exclude the back face from the selection, use Shift + Ctrl + D to deselect. To select individual triangles, click the Z paint tool on the toolbar and choose the red brush icon. Left-click the selection triangle, right-click to delete the selection, and click Delete to delete the triangle.

Since Meshlab doesn't implement any triangle creation functionality, we reside in the surface generation method under Filters → Remeshing, Simplification and Construction → Surface Reconstruction: VCG. If the voxel side is set low enough and the values ​​of geodesic weights and volume Laplacian iterations are high enough, it will produce a smooth manifold mesh. This method is generally recommended instead of Filter → Remesh, Simplify and Construct → Screened Poisson Surface Reconstruction.

Another alternative is to generate an Alpha Complex and then an Alpha Shape, which sometimes works with the correct values. For the remeshing operation, Meshlab provides a voxelizer under Filters → Remeshing, Simplification, and Construction → Uniform Mesh Resampling, which generates a manifold mesh and provides Offset parameters that can be used to create hollow parts.

NOTE: Save the mesh after every important operation! Meshlab does not have an undo feature, the original mesh needs to be reimported.

insert image description here

Advanced surface reconstruction functions in Meshlab, some more successful than others

6、Magics

Materialize Magics is a professional 3D printing data preparation tool that allows extensive manual control over meshes, including wall thickness analysis, hollowing out, remeshing, smoothing, Boolean and cutting operations, as well as repairing holes, bad edges and The most complicated triangle error.

Fixing errors is usually done using the repair wizard under the red cross icon. Clicking "Go to suggested steps" will open a diagnostics table to check for different errors to fix. For large meshes it is recommended to uncheck "Overlapping Triangles" and "Intersecting Triangles" and fix major bugs first. After selecting Update, click Go to Recommended Step again, then click Automatic Repair - this will fix most errors.

If the Healing Wizard cannot fix bad edges and overlapping triangles, the Stitch function under Stitching in the Healing Wizard menu is usually very useful at high enough tolerance settings. For the remaining overlapping triangles, run the Healing Wizard again or choose Detect Overlapping from the Overlapping section of the Healing Wizard menu. This will select all overlaps, which can then be removed by clicking "Mark for Delete". Again, this can be done for intersecting triangles under Triangles → Detect Intersections. The "Create" button now allows manual filling of remaining gaps if stitching remaining gaps are not fully repaired. Mesh sections can also be marked manually under the "Mark" tab in the main menu. The floating part can be removed under the "Noise Shell" section. For large non-planar holes, manually filling these holes using the Freeform option under Holes in the Healing Wizard menu will give the smoothest filled patches. The "Right Grain" option allows specifying the direction the hole follows, in this case to bridge a cylindrical gap in one of the flower's stamens after manually creating some bridging triangles.

Sometimes the repair wizard does not merge different shells in the mesh. To fix this, right click on the part in the Parts Page → Parts List menu on the main screen and select Shell to Part. This creates separate meshes that can be combined using the Tools→Boolean (Ctrl + B) function when selected.

insert image description here

Advanced hole filling capabilities for organic and cylindrical shapes in Magics

7、Blender

Blender is a free and open source mesh creation environment including 3D modeling, rigging, rendering and animation. Various STL repair functions are available under Edit Mode on the Mesh menu in the lower toolbar. The CellBlender add-on provides mesh analysis tools to inspect manifolds and find manifold errors. Before starting any repair scripts, make sure to select the relevant mesh or section.

Mesh → Normals → Recompute Exterior (Ctrl + N) flips any triangle with reversed normals. Check the info pane at the top for the results, if quads are generated, you can convert them to triangles using Mesh → Faces → Triangulated Faces (Ctrl + T). Mesh→Degenerate→Dissolve removes edges and faces without regions. Use Mesh → Vertices → Remove Double Points to remove duplicate vertices to weld edges together.

insert image description here

Bridging, Hole Filling and Boolean functions are all present in Blender

The easiest way to fill holes in Blender is to first select the boundary loop with Select → Select Boundary Loop, or select all non-manifold edges with Select → Select All by Trait → Non Manifold (Shift + Ctrl + Alt + M), then click Mesh→Face→Make Edge/Face (F) or Mesh→Face→Fill (Alt + F) to improve the fill. You can create individual triangles by right-clicking an edge or vertex, Shift-right-clicking a second edge or vertex, and pressing F.

During editing, it can be helpful to switch between Vertex Selection, Face Selection, or Edge Selection modes indicated by the three icons in the bottom toolbar. Selecting specific areas can be done with Selection → Circular Selection©, which works like a brush selection. Use the mouse wheel or the numeric plus/minus buttons to change the brush size, hold down the Shift key to deselect. Mesh → Face → Beautify Face (Shift+Alt+F) can sometimes improve mesh quality in selected areas. Individual boundary loops can be selected using Alt + right-click. After selecting the two open boundary loops, choose "Mesh" → "Edge" → "Bridge Edge Loop", and the two regions will be connected smoothly.

Selecting Mesh→Vertices→Separate→By Loose Parts will create an object for each shell in the Project Browser. This makes it possible to delete mesh objects that are not needed. Separate shells can be joined together using boolean modifiers. If all else fails, implement a remesh modifier and increase the octree depth to around 8 or until the result is satisfactory. To increase the wall thickness in certain areas, go to "Sculpting Mode" and use the "Swell" brush from the lower menu "Brushes" → "Sculpting Tools".

8、Net fab

Autodesk Netfabb is an advanced 3D printing file preparation tool with automatic repair functionality embedded in software such as Formlabs PreForm. It is available in Standard, Premium and Ultimate editions, the first two of which are free for educational use.

Netfabb offers additional mesh editing programs such as Hollow, Custom Bracket Build and Lattice Assistant and Lattice Commander which are of great help in developing lightweight parts. The Ultimate edition provides an optimization utility for structural optimization of parts based on applied loads using FEA analysis.

Through the "File" → "Import CAD file as mesh" function, you can not only import mesh models in various formats, but also import native files from Catia, Siemens NX, SolidWorks, SolidEdge, Rhinoceros, ProE, Sketchup, And supports STEP, IGES, SAT and Parasolid XT files. To import the mesh, click on File→Add Part and check Extended Repair in the dialog. This resolves most errors that result in 3D print files.

Before starting repair work, it is useful to analyze the part. Wall thickness can be checked quickly after right-clicking a part under the Analysis icon in the taskbar or under Part → Analysis → New Analysis → Add Part. Right-click on the part and select Analyze→New Measurement or select the ruler icon from the taskbar, which allows linear, radius, angular and wall thickness measurements at specific points.

insert image description here

Advanced Netfabb functions: wall thickness analysis and lattice structure

Click the red Repair icon on the taskbar to open the Part Repair section. If the auto-healing script behaved well on import, the items "Mesh Off" and "Mesh Oriented" in the Status tab should check green. In the Operations tab, the file can be further optimized if there are intersections. Under Self-Intersection, select Detect, then Simple (performs default hole repair), Stitch Triangles, Remove Double Triangles, Remove Degenerate Surfaces, or Split, then Remove Intersections . Wrapping the part surface works similar to the voxelization procedure and leaves only the outer skin of the manifold. Also, make sure there are no noise shells present under the "Shells" tab.

insert image description here

Netfabb provides advanced STL repair functions

When trying to close gaps, Netfabb would rather fill holes that required further manual repair. Click the Select Surface icon on the main toolbar and select the entire hole, then click Delete. Alternatively, use the Brush Selection tool and use Ctrl + Scroll Wheel and the Plus/Minus buttons to change the brush size and selection. With the triangles selected, select the "Remove Selected Triangles" icon, then use the "Add Triangles" button to manually add the missing triangles, as well as some bridge triangles. Repair → Close All Holes will complete the mesh repair task. Finally, we have the option to refine the mesh using the Mesh Edit → Remesh command, which recalculates the model based on the target edge length parameters. Check the Maintain Edges option to optimize model integrity around sharp edges.


Original Link: Definitive Guide to STL Model Restoration—BimAnt

Guess you like

Origin blog.csdn.net/shebao3333/article/details/132180019