How to Generate Deviation Maps in FreeCAD
This guide explains how to generate deviation maps in FreeCAD to verify manufacturing tolerances by comparing 3D scan data against a nominal CAD model. By leveraging FreeCAD’s Mesh and Reverse Engineering workbenches, you can import manufactured parts, align them with their original designs, compute geometric deviations, and visualize tolerance limits through a color-coded inspection map.
1. Import CAD and Scan Data
To begin tolerance inspection, load both the reference model and the measured physical part into your FreeCAD document:
- Open FreeCAD and create a new document.
- Go to File > Import and select your nominal design model (typically a STEP or IGES file).
- Repeat the process to import the 3D scan of your manufactured component (typically an STL, OBJ, or PLY mesh file).
- Rename the objects in the Tree View to
Nominal_ModelandScan_Meshto keep your workspace organized.
2. Convert the Nominal Model to a Mesh (If Required)
While some comparison tools accept direct Part shapes, generating a high-density reference mesh often yields the fastest and most reliable point-to-point comparison:
- Switch to the Mesh Workbench via the workbench dropdown.
- Select your
Nominal_Modelin the Tree View. - Navigate to Meshes > Create mesh from shape....
- Choose the Standard or Mefisto mesher.
- Set a fine surface deviation (e.g.,
0.01 mmor smaller, depending on your tolerance requirements) to ensure the tessellation error is well below your manufacturing tolerance limits. Click OK.
3. Align the Scan Data to the Nominal Model
Before calculating deviations, the scanned mesh must share the exact coordinate space and orientation of the nominal model:
- In the Mesh Workbench, select both the reference
mesh and the
Scan_Mesh. - Go to Meshes > Alignment....
- In the alignment task dialog, select 3 to 5 distinct reference points on the nominal mesh and corresponding points on the scan mesh to establish a rough alignment. Click Align.
- Run the Best Fit (Iterative Closest Point / ICP) routine within the alignment tool to lock the parts into optimal spatial correspondence.
- Click OK to apply the transformation.
4. Generate the Deviation Map
With both components aligned, compute the geometric distance between the scan surface and the nominal surface:
- Switch to the Reverse Engineering Workbench.
- Select the aligned scan mesh and the nominal reference body in the Tree View.
- Locate and select the Deviation tool (or use Reverse Engineering > View deviation).
- Configure the analysis parameters:
- Search Radius / Max Distance: Enter the maximum
deviation threshold relevant to your inspection (e.g.,
1.0 mm). - Number of Samples: Increase sample density if inspecting high-detail features.
- Search Radius / Max Distance: Enter the maximum
deviation threshold relevant to your inspection (e.g.,
- Click Compute or Apply. FreeCAD will project normal distance vectors from each point on the scan mesh to the nearest surface of the nominal model.
5. Interpret the Color-Coded Tolerance Map
The generated deviation map applies a gradient across the surface of the component to indicate tolerance variations:
- Green Areas: The manufactured part matches the nominal design within acceptable upper and lower tolerance bands.
- Red/Warm Colors: Positive deviation (excess material, tool wear, or bulging).
- Blue/Cold Colors: Negative deviation (missing material, shrinkage, or under-machining).
Use the visual scale bar generated in the 3D view to verify whether critical features fall within the upper and lower specification limits defined by your technical drawings.