Skip to main content

Primitive Fitting

The Primitive Fitting tool automatically fits geometric primitives to target geometry using best-fit algorithms. This enables precise extraction of idealized shapes from scanned or modeled surfaces.

Accessing the Tool

  1. Navigate to the Measure tab in the ribbon
  2. Click the Primitive Fitting button in the Primitive tools section

Overview

Best fit a primitive object to a target surface, selection ROI, or points within existing measurements and primitives.


User Interface

Description

Displays: "Best fit a primitive object to a target surface, selection ROI, or points within existing measurements and primitives."

Target Object(s)

Select the source data for primitive fitting:

OptionDescription
Active surfaceFit to the currently active surface object
Selected surfacesFit to all currently selected surfaces
Visible surfacesFit to all visible surface objects
All surfacesFit to every surface in the project
Selected triangles on visible surface object(s)Fit to triangles selected using ROI tools
Points from existing measurements and primitivesFit to point data from existing markup objects

ROI Selection Tools

When Selected triangles target is chosen, ROI selection tools appear:

  • Use selection tools (rectangle, lasso, polygon) to pick triangles
  • Two-sided selection option for selecting through the model
  • Clear selection to reset

Points Selection

When Points from existing measurements and primitives is chosen:

  • Click Select points to choose from a dialog listing available points
  • Selected points are shown in the combo box

Best Fit Primitive Type

Select the type of primitive to fit:

PrimitiveDescription
PointFit centroid (average position of all points)
LineFit best-fit line using principal component analysis
CircleFit circle to points (requires coplanar points)
SphereFit sphere to points (minimum 4 points)
EllipsoidFit ellipsoid with three independent axes
CylinderFit cylinder (axis and radius)
PlaneFit best-fit plane using least squares
CuboidFit oriented bounding box

Parameters

Fitting Algorithms

Each primitive type uses an appropriate fitting algorithm:

PrimitiveAlgorithm
PointCentroid calculation (mean of all input points)
LinePrincipal axis from PCA or line regression
CircleAlgebraic circle fit in the best-fit plane
SphereAlgebraic sphere fit (Pratt method)
EllipsoidLeast-squares ellipsoid fitting
CylinderRANSAC-based or iterative cylinder fitting
PlaneLeast-squares plane fitting (SVD-based)
CuboidOriented bounding box from PCA

Workflow

Fitting to a Surface

  1. Ensure the target surface is active or visible
  2. Open the Primitive Fitting tool
  3. Select the appropriate target option (e.g., Active surface)
  4. Choose the primitive type to fit
  5. Click Apply
Best Fit Results
  • Use high-quality, noise-free surfaces for best fitting accuracy
  • For cylinder and sphere fitting, ensure the surface contains sufficient geometric features
  • Triangle selection allows fitting to specific regions, reducing influence of unwanted geometry
  1. The fitted primitive is created and added to the Primitives list

Fitting to Selected Region

  1. Open the Primitive Fitting tool
  2. Select Selected triangles on visible surface object(s)
  3. Use the ROI tools to select the region of interest
  4. Choose the primitive type
  5. Click Apply

Fitting to Existing Points

  1. Create measurements or primitives with point data
  2. Open the Primitive Fitting tool
  3. Select Points from existing measurements and primitives
  4. Click the Select points button and choose points from the dialog
  5. Select the primitive type
  6. Click Apply

Use Cases

Reverse Engineering

Fit primitives to scanned geometry to extract geometric parameters such as diameters, angles, and positions.

Quality Inspection

Compare fitted primitives to nominal dimensions to measure deviations.

Anatomical Analysis

Fit spheres to femoral heads, cylinders to long bones, or planes to joint surfaces.

Alignment Reference

Create fitted planes and axes for alignment and coordinate system definition.


Output

The fitting operation creates a new primitive object that:

  • Appears in the Primitives list
  • Can be used for Measurement between Primitives
  • Can be exported or saved with the project
  • Contains optimized geometric parameters