This article presents our recommendations for using software modeling tools for preparing complex CAD models for 3D printing.
Table of Content:
Introduction
It is vital to have access to the object to successfully test its detection and tracking and to interact with the content during development. This article presents a case study and workflow for preparing complex models for 3D printing to better facilitate the distribution of the object for testing.
Augmented Reality (AR) applications often undergo multiple iterations that require re-testing that the object is robustly tracked, or there may be changes to the object, such as new parts or the digital content needs changing.
The development of the AR application might also have multiple stakeholders at different locations who are all taking part in testing, designing, and improving the AR experience. However, the object might not allow for easy distribution and testing.
Testing Model Targets without the object
There are various approaches for testing Model Target-based applications, including but not recommended, using an image of the object.
Other ways could be:
- Using the physical product. This provides the most realistic test result but could turn difficult if, for example, the product is still a prototype with only a few available, it is a large object that is one of a kind, the product is remotely located, the product price, etc.
- Using a miniature or toy model of the product as scaled-down Model Targets. However, such products may not be similar enough to the actual object.
- Using Ground Plane tracking with a digital version of the product. This is useful for testing the user interaction, but you cannot see how the app behaves with the real-life object in a setting.
- Use Session Recordings from the Vuforia Creator App to create a video of the object and of the anticipated user movement that can be played back in the Unity Editor or Vuforia Studio. This offers an easy way to rapidly iterate while you are developing, and it is easy to share a session recording. However, videos also risk becoming obsolete and require revisiting to re-capture the object. Session recordings also prevent testing from new initiations, meaning a sequence always starts the same way.
The final possibility is to 3D print a 1:1 or scaled-down product version. This approach allows you to re-print whenever changes are made, and you can test the experience on the device and object. The primary challenge lies in successfully printing a complex 3D or CAD model.
Preparation
Before beginning preparing your CAD model, consider the printability of your model and what software tools you wish to use and what file formats they support.
The right model
First, consider your CAD model. It may be that it is already ready to print if it has a relatively simple shape, thick walls, fits on the printer bed, has no moving parts, and no inner parts.
Printable models are characterized by thick walls, limited overhangs (parts that require supports to be printed), and watertight with manifold geometry.
Complex models that cannot be printed directly are characterized by large objects with thin walls that become too thin when scaled down, complex interiors, textured surfaces, and movable mechanisms.
For example,
- Sometimes, large products are made partly of sheet metal that is 1mm thick. When scaled down for printing, the metal would be only 0.1 mm thick in a 1:10 scale model, which is too thin and fragile for most 3D printers.
- Models can have a complex interior, which is difficult to remove manually in a 3D program.
- Models with infinitely thin components, for example, because they were modeled as Non-Uniform Rational B-Splines (NURBS) surfaces and never thickened/solidified, also require modifications to be printed.
- Models with a non-manifold or degenerate mesh produced by a mesh-reduction pipeline. There can be faces that intersect each other, open edges in the mesh that prevents from enclosing a volume, and edges that connect to more than two faces, etc. These situations almost always cause problems for the slicer software for producing the file for the 3D printer.
Tools
In this article, we present a workflow using various 3D software tools, though not all are required, and you may have other preferences for software to prepare your CAD model.
The required tool for this workflow is MeshLab.
- Download and install the 2023.12.d for your operating system from the MeshLab GitHub release page.
Other optional software tools used in this article:
File formats
Consider which file formats you will use and if your CAD model is already in a file type that your slicer software (tool for preparing and configuring 3D printing files) supports.
Consider also that some file types keep the scale, texture, color, and model materials – of which not all are necessary for a 3D print.
Case Study – CAD Model Tractor
In this part of the article, we introduce a workflow to simplify and prepare a complex CAD model for 3D printing as a scaled-down version. Our use case is to only track the object as whole.
Complexity
Let us download a tractor model from GrabCAD as our model and load it into OnShape and the Ultimaker Cura slicer software for inspection.
Inspecting the CAD model in OnShape, we can see the undercarriage has more details than needed for our application, which only concerns the exterior view. Unnecessary details add data-processing time, printing time, and material cost.
Importing the unedited model as an OBJ file into the Ultimaker Cura 5 software demonstrates how this is not a printable model. The Left image highlights its problematic geometry. The right image is after slicing, where red indicates the shell lines (outer walls), but whole parts are missing from the engine hood. The printing result would be faulty.
Changing the file format
The first task is to get a working file to make our edits. This CAD model is a STEP file that we need to export as an OBJ. Other popular formats for 3D printing include STL, PLY, 3MF, FBX, and others. You can skip the following steps if your model is already in one of the mentioned formats.
- Upload the ASSEMBLY_TRACTOR_01.STEP file into OnShape or other CAD modeling or inspection software.
- In OnShape, click Import Files in the Create dropdown menu and import your CAD model.
- Select Import into a single document with the Import Appearances The other settings are optional.
- Open the file and open the Tab Manager from the bottom left corner.
- Right-click the assembly and select Export. Enter the format, in our case, as an OBJ, and set the resolution as coarse. The resulting model has 1.6M vertices and 3.3M faces.
See OnShape’s technical documentation for more information on using the product development platform.
Edit out unnecessary parts
Let us import the downloaded OBJ model file into Blender to remove details irrelevant to the Model Target tracking and AR application.
- We add a box shape on the undercarriage to cover up unnecessary details. This also removes weak parts that may break off when removing support helpers on the 3D-printed object.
Fragile parts or complex details that require removal greatly depend on the individual model. If such parts are necessary, you can add volumes to strengthen those parts to prevent them from breaking off the 3D print.
Consider closing smaller openings and holes. These may influence the following work in MeshLab to produce a simplified mesh. Just add a volume over the existing mesh, holes, and parts; there is no need for advanced sculpting or keeping the mesh manifold at this time.
Model Simplification in MeshLab
In this section, we will simplify the CAD model by using the Alpha Wrap and Taubin smoothing in MeshLab to prepare the model for 3D printing. The Alpha Wrap filter reads the selected input mesh and creates a new one with a 2-manifold and watertight triangulated surface; imagine that a 3D ball was rolled over the exterior surface to generate a single mesh. A configurable offset in the Alpha Wrap settings ensures that even ‘open’ surfaces are processed (which have edges that are only connected to a single face).
- Open MeshLab and import the edited OBJ file.
- In the dropdown menu Filters, select Remeshing, Simplification and Reconstruction -> Alpha Wrap.
- Enter the Alpha and Offset parameters. The smaller the Alpha value, the smaller the “ball” with higher computation time. The default value of 0.02 (2%) gives a fast result. Usually, this result will be too coarse, but it serves as a first impression of the remeshing. In our case, the Alpha value was set to 0.003. The Offset value was left unaltered.
NOTE: Try different values of Alpha until you are satisfied that the mesh is printable and a good-enough approximation of the real object for Model Target tracking.
- Optional. Depending on your model, apply a smoothing filter to remove the faceting introduced by the Alpha Wrap filter. Select Filter -> Smoothing -> Taubin Smooth.
- Depending on the model, select the Filter -> Simplification: Quadric Edge Collapse Decimation filter to remove redundant triangles in areas with low curvature. The main parameters you would generally change are either the Target number of faces or the Percentage reduction (0..1).
NOTE: In case you want to use a sculpting tool on the exported MeshLab model to bulk up some areas that would otherwise be too fragile, it is better to omit the Simplification: Quadric Edge Collapse Decimation filter step. Because such sculpting tools work better with denser meshes, where the faces have edges of about equal length.
- Select File -> Export Mesh to save the new mesh. Select the same format as you imported it in.
Print Your Model
With a simplified and watertight 3D model, we can open the UltiMaker Cura software to inspect and 3D print the model. Any slicer software for 3D printing can be used, and settings should be applied according to the units, 3D printer model, nozzle, and material.
- Open UltiMaker Cura and import the mesh.
- Scale and orient the model as necessary. Note down the dimensions in which you are printing it. These will be used to maintain the scale.
- Enable Supporthelpers in the upper right dropdown menu.
TIP: The ideal number of supports is 0. Supports can be challenging to remove in tight areas if they are enclosed by a wall.
- Slice the model. Once finished, open the Preview view.
- In the layer Preview, we can see the support helpers in light blue, and on the right, a cross-section of the interior, printed as a solid.
- Continue to 3D print the model on your 3D printer.
Test Your 3D Print
Before creating a Model Target, consider which CAD model and what approach to scaling you choose.
We could use the original CAD model to generate the Model Target. This has the most detail, sharpest edges, and possibly texture maps, which are all important for the best detection and tracking. It is also in the correct scale, which means authoring content to the Model Target in Unity is also to scale. The problem arises when we want to track and render digital content on a much smaller 3D-printed model. We would have to scale down the Model Target and its digital content and then back again during development. See the Best Practices for Managing Scaling of Model Targets for a more in-depth guide.
In addition, with the original CAD model, you may experience that the Model Target Generator (MTG) asks you to simplify the model due to its complexity, which may not be an option for all use cases. A Model Target from a complex model also has a longer loading time. We could instead use the simplified CAD model exported from MeshLab that we printed. However, this model has softer edges and fewer details, which could complicate detecting and tracking the real object. And it does not solve the scaling back and forth either.
Be mindful of the scale
There are two main approaches for dealing with a scaled representative physical object: You can use the 1:1 CAD model for generating the Model Target and then scale down the augmentations proportionally along with the Model Target using a scale factor. Or, you can make a scaled-down CAD model with the matching dimensions of the 3D print to generate the Model Target and then scale up the Model Target using the Virtual Scene Scale Factor.
The first approach is necessary for HoloLens and Magic Leap devices since these devices do not support the Vuforia Scene Scale Factor setting. The second approach only scales the Model Target, and it is recommended to use this approach if you have skinned animations and particle systems as part of the AR content.
In most cases, we recommend using the Virtual Scene Scale Factor as you would develop and design your content against the actual scale of the object. The downside is that it may require generating a new Model Target based on the original and 1:1 CAD model for the final deployment
In either case, we must calculate the scale factor between the 3D print and the real-life object.
The physical object, the tractor, has the length = 4.2902m
The 3D printed model, measured from the slicer software, has the length_print = 0.150m
This means the scaling factor is length_print / length = 0.150 / 4.2902 = 0.0349 or 1:28.6013. The 3D-printed tractor is 28 times smaller than the real-life object.
If you use a to-scale Model Target, scale it down along with the content to *0.0349.
If you use a scaled-down Model Target, author your content to scale and then scale up the Model Target to 28.6013 using the Virtual Scene Scale Factor. If that is not an option, design your content to fit the scaled-down Model Target and scale it afterward to match the actual size and scale.
Test on your device
Build and run your application on your device or test the Model Targets in the Vuforia Creator App.
Improving the 3D Print Result
In case some small details did not make it through the support-removal process, further fine-tuning can be added to preserve such finer details:
- ‘Bulk up’ the geometry for these details using some additional objects.
- UltiMaker Cura allows you to add support blockers to prevent supports structures from being created in hard-to-reach areas.
- You can also add boxes, spheres, or other geometry as needed to the model by loading the Alpha Wrapped mesh in the CAD software or a tool like Blender.
- Edges that connect to three or more faces cause problems for the Alpha Wrap filter. These should be rare, but if you encounter this, the simplest solution is to load the model into Blender, go to Edit mode, and use Alt+M to select Split and then “Faces by Edges” to remove all edge connectivity. Each face then gets its own copy of the vertices, which solves the problem.
- Printing the model at a larger size adds more material to the weaker parts, which increases the accessibility for removing the support helper structures.
Print the model on an SLS (Selective Laser Sintering) printer instead of an FDM (or SLA) so that no supports are needed in the first place.