Today I saw a post about Emendo, a program for mesh repair, and became a little miffed. It costs roughly $50, which I think is pretty steep for something you could do in a few lines of code in Python with the Blender API. Even if you’re not a programmer, there are $0 solutions like netfabb Basic and free software like MeshLab and Blender. I can’t attest to the quality of Emendo, but it has to be amazing to be worth that price.
So, let’s talk mesh repair: what is it, why it’s hard, and why I would or wouldn’t spend $50 on it.
Mesh repair is essentially fixing up a 3D model so it can satisfy 3D printing constraints. I became interested in mesh repair when I was modeling a small figurine. When designing, I cared more about aesthetics of the model than the printability of the model. I figured there would be tools to magically and automatically correct my model to be printable.
There is such a tool. It’s called netfabb.
Netfabb is a software that’s pretty good at fixing all sorts of problems. It’s also popular among 3D printing enthusiasts and is leveraged by businesses and 3D printer manufacturers (like Shapeways, Formlabs, and Figulo).
Unfortunately, my model turned out to be disastrously hard to repair. Netfabb failed, and I ended up concocting a solution out of both netfabb Basic and MeshLab after days of struggle.
Turning a model of any shape into a printable model is a hard problem. For example, suppose you have holes in your model that makes it unprintable. The mesh repair software will try to patch those holes. These holes are big gaps of missing information and the software has to guess what should go in them based on the topology of each hole’s surroundings. While some solutions can be easily guessed, other guesses can create more problems and can even conflict with one another. Here are wonderful visualizations of capping a hole in three different and valid ways, illustrating the underconstrained nature of the hole problem. Holes are just one of the many problems a 3D model could have.
There are many algorithms for mesh repair, but none of them are perfect. Here is an excellent introduction to various algorithms and the tradeoffs between them. Here is a more recent and more in-depth look at different algorithms and their features.
I use my figurine model to test the “robustness” of different mesh repair software. It may not be a fair test, since my model may be a very hard edge case, but I’m testing mostly to satisfy my curiosity. Here are some results:
netfabb Basic 4.9: failed
Netfabb flags something as unprintable with a big red caution sign. Even after repairs, the caution sign remained. Netfabb Cloud also failed. I believe the most recent version of netfabb Basic will successfully repair the model. Since netfabb is such a staple tool, I determine the success or failure of other mesh repair programs by importing the fixed models into netfabb and recording whether netfabb determines if they are printable or not.
Autodesk Meshmixer version 10.3.44: failed
Autodesk 3D Print Utility 1.1.1: succeeded
The 3D print utility actually succeeded in the mesh repair. However, it took about 3 hours for the repair to complete on my laptop, and the resulting mesh had a tremendous loss of resolution.
Photoshop CC: failed
I don’t know what version of Photoshop CC I used, but it was a 30-day trial from this past January. The repaired model still had issues, but could subsequently be repaired by netfabb. Photoshop actually emailed me asking for the figurine model, so I suspect they might’ve upgraded their algorithm.
Custom Blender Script: succeeded
Over the summer, when I was working on 3D printing glasses from 2D designs, I realized I need to repair the glasses models. I started to write a mesh repair script and decided to design it to repair the figurine. My script does indeed fix the model, but it takes about five minutes to run on the figurine model. The script produces better resolution in less time than Autodesk’s 3D Print Utility, but it’s not the fastest since I’m looping multiple times. I’ve decided to release it as a Blender Add-On, in the 3D Print Toolbox, available now in Blender 2.72b. Hope it’s helpful!
The script’s algorithm works better on simple models or models with dense polygons. If patching holes result in non-manifold geometry, the script will try to delete vertices around the holes and then patch them again. If the polygons are dense, removing a few shouldn’t affect the overall aesthetics.
It probably won’t work for all models, though.
$50 for a mesh repair software that repairs all models is absolutely worth it, for all the time invested spent in manual repairs. However, given the diversity of models and the diversity of problems (some of which could be caused by printer-dependent constraints), I doubt there’s such a silver bullet right now.
Between the Blender Add-On and netfabb, you have a pretty good chance that your model will get repaired. However, should you need to, I advocate using Blender’s Python API to build your own repair tool. It will allow you to create something catered to your specific modeling needs. It might not be as fast as pressing a button, but you’ll have unparalleled customization ability. I hear the paid upgraded versions of netfabb give you a lot of customization choices in mesh repair, but I doubt it would be as thorough as interacting with the models directly. The Blender API already provides some nice helper functions like bpy.ops.mesh.fill to fill in faces and bpy.ops.mesh.select_non_manifold to select non-manifold vertices. You could even update the Add-On and release it back to the Blender community.