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:

  1. Open FreeCAD and create a new document.
  2. Go to File > Import and select your nominal design model (typically a STEP or IGES file).
  3. Repeat the process to import the 3D scan of your manufactured component (typically an STL, OBJ, or PLY mesh file).
  4. Rename the objects in the Tree View to Nominal_Model and Scan_Mesh to 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:

  1. Switch to the Mesh Workbench via the workbench dropdown.
  2. Select your Nominal_Model in the Tree View.
  3. Navigate to Meshes > Create mesh from shape....
  4. Choose the Standard or Mefisto mesher.
  5. Set a fine surface deviation (e.g., 0.01 mm or 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:

  1. In the Mesh Workbench, select both the reference mesh and the Scan_Mesh.
  2. Go to Meshes > Alignment....
  3. 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.
  4. Run the Best Fit (Iterative Closest Point / ICP) routine within the alignment tool to lock the parts into optimal spatial correspondence.
  5. 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:

  1. Switch to the Reverse Engineering Workbench.
  2. Select the aligned scan mesh and the nominal reference body in the Tree View.
  3. Locate and select the Deviation tool (or use Reverse Engineering > View deviation).
  4. 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.
  5. 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.