Tuesday, April 3. 2012
Use netfabb to Manually Repair STL Holes, Edges and More
In a previous post we showed how to use a free tool, netfabb Studio Basic ('netfabb') to automatically repair STL files in preparation for 3d printing. In this post we use netfabb to manually repair some common defects found in STL files including holes, boundary edges and invalid orientation. This is by no means an exhaustive example of netfabb's manual repair capabilities. Rather it is meant to introduce common problems encountered in STL files and how netfabb's manual tools can be used to repair them. For more in-depth information check out netfabb's wiki.
- Load the file and check netfabb's preliminary analysis
- Perform a Standard Analysis and note results
- Examine the file in repair mode
- Perform manual repairs.
- Apply repairs and export the repaired file as a new STL
1)Load the file and check netfabb's preliminary alerts
After loading the file into netfabb we're greeted with the now familiar red exclamation point informing us that there are potential problems with the file. Lack of a calculated volume is another indicator of potential problems. Further, netfabb makes extensive use of color coding and trouble spots are colored maroon according to the color scheme in Settings>General>Colors (note that our part is 'selected').
2) Perform a Standard Analysis and note results
Like our previous example, we'll start by selecting the part and pressing the Standard Analysis button on the upper right.
netfabb's colors will change again and we see a gray rendering of the part with possible problem areas again highlighted.
A new pane will appear on the lower right of the screen with quite a bit of new information. For the time being we'll only be concerned with the green/red Yes/No near the bottom. Two of the most common STL mesh problems are surfaces which are not closed and/or orientable. netfabb indicates with a 'Yes' if it detects these problems. See green and you've probably got an STL file which is technically printable; red and you might have problems. In our case we see that our surface is NOT closed but it is orientable:
Let's briefly explore the meaning of these two defects. If an STL mesh is not closed (or 'manifold', or 'watertight') the 3D printer software will have difficulty defining where material should be placed. This could occur if, for example, in the design process a single edge is actually made up of two non-coincident edges or there are holes in the surface. The difference may not be visible on the screen but it can confuse the printer software. With a red 'No', netfabb is telling us that we have some sort(s) of openings in our mesh.
If an STL mesh is not orientable it means that there does not appear to be a consistent inside and out (as defined by the normals of each triangle). Again, if parts of the model are 'inside-out', 3D printer software won't be able to discern where to put material. In this case, "Yes" indicates that netfabb is able to make some sense of inside and out (although there may still be 'fixable' problems).
If we study some of the other information provided we'll discover that netfabb has found 3 holes, 9 boundary edges and 51 flipped triangles. Flipped triangles indicate areas in which inside and out seem to be reversed. Our surface is orientable so we won't worry too much about these for the moment. Holes occur where there is an opening exposing the interior of the mesh. Boundary edges occur when we have a 'naked' edge exposed to the world. Since mesh surfaces have no thickness these edges have no meaning for physical printing. Printer software is often robust enough to ignore such edges but results can be unpredictable.
Perhaps our 3 holes and nine boundary edges are related; if our three holes are triangular each would create three boundary edges. If we examine the on-screen rendering and rotate it around a bit, we definitely see some triangular holes. netfabb colors the interior and exterior of each triangle differently and what we might have initially mistook for flipped triangles we actually discover is the inside of the opposite surface; i.e. we're looking through a 'hole'. Since we clearly have holes - and they might be triangular - we'll concentrate on hole fixing first
3) Examine the file in Repair mode
Now that we have an idea what some of the problems with the STL might be we're ready to begin repairs. We'll press the red cross repair button and note that we're now presented with a new rendering; a mesh with a yet another color scheme (as defined in Settings>Part Repair>Colors).
At this point, like in our previous example, we could try to use netfabb's automatic repair scripts. If we did, we would in fact find that netfabb would repair this file automatically with no difficulty. However, to explore netfabb's repair capabilities (and a little bit about typical STL repairs) we'll continue manually.
4) Perform manual repairs
First we'll address the unclosed nature of the surface. Some purple flipped triangles and yellow boundary edges (or whatever colors you've set) are clear.Again, if we hold the right button and rotate the part we'll notice that some of what were apparently flipped triangles are actually the inside of the opposite surface as seen through holes in the mesh.
To fix these holes we'll need to add triangles. We find the green triangle with a "+" on it on the top toolbar and select it.
Now we can select any two border edges (in yellow) and netfabb will create a new, surface triangle using those two edges and the most logical third edge. If the hole is triangular it will be filled normally - if not we may need to add more than one triangle. We do this for all of the holes we can find. Note that we've adjusted some of the color settings from defaults to make defects easier to see. (The Pro version of the software offers automated selection of defects - a real timesaver on larger files with thousands of defects). Now we update the status:
Not only have our 3 holes gone away but our 9 boundary edges have disappeared as well. As we suspected, the boundary edges were a result of the holes in the mesh - 3 per hole.
However, the status box (and the colors on the rendering) suggest that we still have 51 flipped triangles. We'll address those now by selecting problem triangles and re-flipping them. In the free version of netfabb it's necessary to hunt down flipped triangles manually. Triangles can be selected on-by-one but with large regions it worth trying the surface or maybe even solid tools for selection. In practice the surface selection tool (green pentagon) seems to be most useful.
After selecting triangle(s) we change their orientation by pressing the flip triangle button - just to the right of the selection buttons:
After de-selecting these triangles they will be the same color as their neighbors (in our case, blue).
Updating our status we see that there are still triangles with invalid orientations. In this case we need to hunt for particularly small and/or hidden triangles (again, a good reason to go with the pro version if you're going to be doing this often). We find a couple more very small triangles which can be selected and flipped in turn.
Again updating our repair status we find zero border edges, invalid orientations and holes.
5) Apply Repairs and export the repaired file as a new STL
As in our previous post we still need to apply repairs to the original file and export a new STL. We press Apply Repair (see above) and discard the previous part. Under Part we now select Export as STL (repairing the file further as needed) to create a new 'repaired' version of our original STL. This new version is clean and printable and we're done.
3D Additive Fabrication, Inc. (3dAddFab) is a start up company located in Colorado, USA. 3dAddFab provides high quality 3D printing that is easy to price and order, at a lower cost than existing fabricators.
Strict Standards: Non-static method serendipity_plugin_api::hook_event() should not be called statically in /srv/www/3daddfab.com/public_html/blog/include/functions_comments.inc.php on line 293 Strict Standards: Non-static method serendipity_plugin_api::get_event_plugins() should not be called statically in /srv/www/3daddfab.com/public_html/blog/include/plugin_api.inc.php on line 1041 Strict Standards: Only variables should be assigned by reference in /srv/www/3daddfab.com/public_html/blog/include/functions_smarty.inc.php on line 73
Frontpage - Top level Strict Standards: Non-static method serendipity_plugin_api::hook_event() should not be called statically in /srv/www/3daddfab.com/public_html/blog/include/functions_smarty.inc.php on line 553 Strict Standards: Non-static method serendipity_plugin_api::get_event_plugins() should not be called statically in /srv/www/3daddfab.com/public_html/blog/include/plugin_api.inc.php on line 1041
Strict Standards: Only variables should be assigned by reference in /srv/www/3daddfab.com/public_html/blog/include/functions_smarty.inc.php on line 73