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
- Navigate to the Measure tab in the ribbon
- 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:
| Option | Description |
|---|---|
| Active surface | Fit to the currently active surface object |
| Selected surfaces | Fit to all currently selected surfaces |
| Visible surfaces | Fit to all visible surface objects |
| All surfaces | Fit 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 primitives | Fit 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:
| Primitive | Description |
|---|---|
| Point | Fit centroid (average position of all points) |
| Line | Fit best-fit line using principal component analysis |
| Circle | Fit circle to points (requires coplanar points) |
| Sphere | Fit sphere to points (minimum 4 points) |
| Ellipsoid | Fit ellipsoid with three independent axes |
| Cylinder | Fit cylinder (axis and radius) |
| Plane | Fit best-fit plane using least squares |
| Cuboid | Fit oriented bounding box |
Parameters
Fitting Algorithms
Each primitive type uses an appropriate fitting algorithm:
| Primitive | Algorithm |
|---|---|
| Point | Centroid calculation (mean of all input points) |
| Line | Principal axis from PCA or line regression |
| Circle | Algebraic circle fit in the best-fit plane |
| Sphere | Algebraic sphere fit (Pratt method) |
| Ellipsoid | Least-squares ellipsoid fitting |
| Cylinder | RANSAC-based or iterative cylinder fitting |
| Plane | Least-squares plane fitting (SVD-based) |
| Cuboid | Oriented bounding box from PCA |
Workflow
Fitting to a Surface
- Ensure the target surface is active or visible
- Open the Primitive Fitting tool
- Select the appropriate target option (e.g., Active surface)
- Choose the primitive type to fit
- Click Apply
- 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
- The fitted primitive is created and added to the Primitives list
Fitting to Selected Region
- Open the Primitive Fitting tool
- Select Selected triangles on visible surface object(s)
- Use the ROI tools to select the region of interest
- Choose the primitive type
- Click Apply
Fitting to Existing Points
- Create measurements or primitives with point data
- Open the Primitive Fitting tool
- Select Points from existing measurements and primitives
- Click the Select points button and choose points from the dialog
- Select the primitive type
- 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
Related Tools
- Primitives — Create primitives manually
- Measurement between Primitives — Measure between fitted primitives
- Measurements — Create point-based measurements for fitting input