Intro: Preparing 3D Scans for 3D Printing, With Rhino and Netfabb Pro
Raw 3D scans present a number of challenges for 3D printing. Unless the object was scanned in 360 degrees, the scan file will appear as a shell with no thickness. They also frequently contain holes, self-intersections, non-manifold geometry, and incorrectly oriented polygons. We need to address all these issues in order to prepare a model that a 3D printer will accept.
I'm beginning with a fairly rough scan, made with a handheld 3D laser scanner. While some scanners come bundled with software that will surface the scan and export the file as one continuous surface, others don't, so this tutorial will cover repairing raw, unsurfaced scan data.
In my practice as a sculptor, I intentionally misuse high-end 3D scanners to generate glitchy results. 3D printing from bad scan data is much more challenging than 3D printing from a 'clean' scan, so I'm going to walk you through the process of repairing a fairly messy scan and preparing it for 3D printing. While I have intentionally left voids in the sculpture, for artistic effect, I'll show you techniques to close holes and smooth the model if necessary.
Step 1: Export the Scan As an Obj File
If your software allows it, trim away all unwanted parts of the model (eg the background or any other details that you want to delete from the final print.) Then export the scan file in .obj format.
Step 2: Offset the Mesh in Rhino to Add Thickness
If your scan is incomplete (i.e. made from only one angle), you will need to add thickness to the surface in order to convert it to a solid model. I imported the obj file into Rhino, checked that the size of the object was correct, and used the OffsetMesh command to thicken the scan to 3mm. Make sure that 'Solidify' is checked - that way, Rhino will fill the edge between the two surfaces to create a solid mesh object.
Of all the 3D programs I have used, I have found Rhino to be the only one that performs this function quickly and reliably, without distorting the appearance of your model. If you have access to a very high-end program like Geomagic or Magics, you could use that instead. Rhino for Mac is currently in free beta release, and Rhino for Windows offers a fully functional 90-day trial and substantial educational discounts, so it's one of the more accessible 3D programs out there.
You may need to choose a different thickness depending on the 3d printing material you are using. In my case, I am printing on a Dimension printer, but I want to be able to cast the 3D print in wax, and, eventually, bronze. If you are printing in a material like Shapeways' White Strong and Flexible plastic, you may be able to get away with a thinner object. Check the Shapeways material guidelines for extensive documentation on the required minimum wall thickness for each material.
Note that once you have added thickness to your model, you are committed to printing your file that scale. There is no way to alter the thickness later on, after you have repaired the scan. For this reason, make sure that your file will fit the build size of the 3D printer you will be using. If it won't, scale the file before you offset it.
If your scan is a solid object with no large gaps, you can omit this step, and add the wall thickness later when you hollow your model.
Step 3: Export As Polygon Mesh
Once you have offset the model, choose File->Export Selected and export it as a polygon mesh. You can leave the other settings unchanged. Save in obj format.
Step 4: Import Into Netfabb Pro
In Netfabb, choose Add Part and select the obj file you just exported from Rhino.
Right away, Netfabb's diagnostics will tell you the file has multiple problems. We'll deal with these now.
Step 5: Begin a Basic Repair in Netfabb
Press the red cross button on the top toolbar to enter Netfabb's Repair Module. Any changes you make in this mode will not be 'baked' into the model until you hit 'Apply Repair', so be sure to do this regularly in case your computer crashes and you lose work.
Looking at the window at the bottom right, you'll see the file contains numerous holes and other errors. Netfabb also highlights holes in yellow and degenerate faces in orange, so you can see a visual representation of the issues with your model on screen.
Step 6: Stitch Triangles
In order for a 3D model to print correctly, it must be 'watertight'. This means it can't have any holes, even those that are less than 1mm across. Often, meshes that have been offset in Rhino contain multiple tiny holes. These need to be closed before the model can be printed.
Click on the 'Actions' tab, and then click 'Stitch Triangles'. This function looks for open edges that are very close together but unjoined, and 'stitches' them together. A tolerance that is too high will result in triangles being added in the wrong place, so choose the lowest possible value. The right number will eliminate the yellow dashed lines on your model, without changing the shape of your model in any way. You may need to run this function more than once, gradually increasing each time. The actual number you use will vary depending on the size of your model, but I usually use a tolerance of .5mm or lower.
Step 7: Close Remaining Holes
While the stitch function removed 90% of the holes in the model, the yellow dots on the screen reveal that a few larger holes remain. Click 'close trivial holes', then 'close all holes' if that doesn't work.
Netfabb will run all the repair functions if you click 'Automatic Repair'. But in my experience, attempting to close holes before the edges have been stitched results in the model being mangled, as Netfabb attempts to join open edges on one side of the model with open edges on the other side. In my experience, it's much safer to run the initial repair functions individually when you first import the file.
Step 8: Fix Flipped Triangles
You may see small or large red areas on your model. This is Netfabb's way to indicate that those triangles are incorrectly oriented -- they are 'flipped' and facing the wrong direction to the other triangles.
Click 'Fix Flipped Triangles' on the repair functions list to see if this fixes the problem. While that may work some of the time, in other cases, red triangles are indicative of geometry that does not obey the laws of physics and surfaces that turn in on themselves. If you are left with red triangles after clicking the 'Fix Flipped Triangles' button, there are some other options you can try.
The first option is to click Repair->Wrap Part Surface. This function, limited to Netfabb Pro, is more powerful and usually takes care of any remaining flipped triangles.
Step 9: Remove Degenerate Faces
The stats in Netfabb's' Status window are looking much more encouraging now. But still, some small degenerate faces remain. Netfabb highlights these in orange Use the 'Remove degenerate faces' action to correct these. Again, this is an action where a value that is too high can result in distortion to your model, so use a very small tolerance to start with - I used a tolerance of 0.005 to remove these.
Step 10: Remove Self-intersections
While wrapping the part surface addresses flipped triangles, it doesn't address internal geometry. Because this scan was made using a handheld scanner that generates multiple sweeps, offsetting them creates multiple overlapping solid objects that intersect with each other. This can be confusing to a 3D printer, which doesn't understand 2 objects existing in the same space.
Fortunately, Netfabb's 'Remove self-intersections' function removes any areas where the file overlaps with itself, and re-triangulates the model in the places where self-intersections were removed. Click the 'Remove self-intersections' button and wait for the calculation to run.
Step 11: Delete Bad Triangles
There may be some areas in your model that are clearly unprintable: floating triangles with almost no thickness, for example. Here I have removed a bad triangle by clicking the green triangle icon on the top toolbar to select individual triangles, then using the Delete key on the keyboard to remove it.
Step 12: Delete Tiny Shells and Run One Last Automatic Repair
The self-intersection removal resulted in a number of tiny shells being left in the model. Under the 'Shells' tab, select all the shells beneath the main one and delete them (you can either use the Delete button on your keyboard or right-click and select 'Remove selected triangles.')
If you're using Netfabb Basic, you won't have access to the Shells tab. You can achieve the same function by selecting the main shell, clicking Edit->Toggle Selection to invert your selection, and hitting Delete.
The function can also result in degenerate triangles, so you can run one last automatic repair to address any last issues.
Make sure to click 'Apply Repair' at the end, to ensure your changes have been applied to your model.
Step 13: Manually Close Holes And/or Add Triangles
Once you have removed the bad triangles, you will be left with a hole. It will need to be closed before you proceed. This can be done in two ways: either right-click along the yellow border and select 'Close hole' -- or, if that doesn't work, click the 'Add triangle' button in the top toolbar (the green triangle with a plus sign next to it), and click on the open edges one by one to add new triangles and close the hole manually.
When the hole has been closed, remember to hit 'Apply repair'.
Step 14: Reduce Polygons
At this point, you should have a model that consists of one single shell, with no holes or other errors. Without entering the repair model, click Extras->Triangle reduction. This will bring up the above screen. Slide the top slider marked 'Target' to the left, until triangle count displayed on the right is under the maximum triangle count for the 3D printer you will be using. Click 'Calculate' to run the triangle reduction, then OK if you are happy with the results.
You may need to re-enter the repair module to remove any degenerate faces arising from this function.
If you are printing with Shapeways, they require all models to be under 1 million polygons, to avoid printer crashes and other problems.
Step 15: Check Wall Thickness
Now that all shells have been joined, merged and repaired, you are ready to check that every part of your model is thick enough for the printer you will be using. Go to Part->New Analysis->Wall Thickness. Enter the minimum wall thickness required by your printer, and click OK. This function can take some time, but will give you an exact representation of any thin walls in your model, if they exist.
In this case, the analysis only found a few tiny areas that were too thin. If you are using a very exacting 3D printing service, you can always delete these areas, or use Netfabb's extrude function.
Step 16: Extrude Thin Walls
Here, I am using Netfabb's Extrude function to thicken thin areas. I first selected the individual triangles, then chose Mesh Edit->Extrude surfaces. You can manually enter a value in mm to extrude the selected area to add thickness.
If your extrusion intersects with the rest of the model you will need to re-run a self-intersection removal and then a repair.
Step 17: Smooth Mesh If Desired
I prefer the crisp edges of the glitchy data I work with, so I've chosen not to smooth this model. But for the sake of the demo, here is a smooth function applied. Again, you don't need to go into the repair model to smooth - you can choose Extras->Mesh smoothing. I've unchecked the 'Triangle Mesh' radio button to get a better view of how the smooth model will look once the changes have been applied.
Step 18: Export As .stl
Now your model should be ready for 3D printing. Export the file as an .stl and send it to your chosen printing service.
This tutorial has only addressed general problems that crop up with preparing 3D scan data for 3D print. It doesn't address material-specific structural concerns (supported and unsupported walls, smallest embossed details, etc), so always verify with a technician that your file meets all the requirements of the particular material you are using.
Step 19: Print!
Here, the file has been printed at life size in white ABS acrylic using a Dimension printer. This was then used for a master to produce a silicone mold and lost wax cast, eventually resulting in a bronze sculpture. (That's a topic for another day...)