Geometry and Topology
NOTE
Target Audience: Advanced Implementers & Geometry Kernel Developers
Prerequisites: Please read the Glossary and Data Model Map first.
This page provides a deep dive into the mathematical and structural representation of geometry in STEP, covering NURBS, complex topology, and geometric continuity.
1. Foundations of NURBS
NURBS (Non-Uniform Rational B-Splines) are the mathematical backbone of STEP B-rep.
Relationships: Bézier, B-Spline, and NURBS
Think of these as a hierarchy of increasing control and mathematical complexity:
| Curve Type | Hierarchy | Key Characteristics |
|---|---|---|
| Bézier Curve | Base | The simplest form. A single polynomial segment. Moving one control point affects the entire curve. |
| B-Spline | Extension | A sequence of Bézier curves joined together. Moving a control point only affects a local segment (Local Control). |
| NURBS | Final Form | Adds Weights (Rational) and Non-Uniform knots. Can perfectly represent circles and ellipses, which regular B-splines cannot. |
The "NURBS" Name Breakdown:
- Non-Uniform: Knots don't have to be equally spaced (allows for varying "speed" along the parameter
). - Rational: Uses Weights. This is required to define exact conic sections (circles, ellipses, hyperbolas).
- B-Spline: Basis-Spline. A method of joining multiple polynomial segments with a specific level of continuity.
Note on T-Splines: Standard STEP (ISO 10303) does not natively support T-Splines as a distinct mathematical entity. When CAD systems (like Fusion 360 or Rhino) export T-Spline models to STEP, they are automatically converted into a collection of standard NURBS patches. This ensures compatibility with all STEP-compliant software but may result in a higher number of faces.
Key Components
| Term | Meaning | Impact on Shape |
|---|---|---|
| Degree (次数) | The degree of the polynomial (e.g., 3 for cubic splines). | Higher degrees allow for smoother curves but increase calculation cost. |
| Knot Vector (ノットベクトル) | A sequence of parameter values that determine where the spline segments meet. | Multiple knots at the same position (multiplicity) create "sharp" corners or discontinuities. |
| Control Points | Points that "pull" the curve toward them. | Moving a control point locally affects the shape. |
| Weights (重み) | Used in Rational B-splines. | Allows exact representation of conic sections (circles, ellipses, hyperbolas). |
Mathematical Definition
NURBS can represent both curves and surfaces.
1. NURBS Curve
A NURBS curve is defined as:
(In plain text: Sum of (Basis * Weight * ControlPoint) / Sum of (Basis * Weight))
2. NURBS Surface
A NURBS surface is defined as the bivariate extension:
(In plain text: Sum of (Basis_u * Basis_v * Weight * ControlPoint) / Sum of (Basis_u * Basis_v * Weight))
Interactive NURBS Playground
Use the viewer below to experiment with NURBS parameters. Switch between Curve and Surface modes to see how Weights (Rational) and Knots (Non-Uniform) influence the geometry.
Where:
: Control Points (grid for surfaces). : Weights. : B-spline Basis Functions of degree (and for surfaces), defined by the Cox-de Boor recursion formula. : Parameters.
Basis Function Recursion (Cox-de Boor)
The basis functions
- Degree 0:
if , else . - Degree
:
Matrix Representation (Implementation Perspective)
In computer graphics and CAD kernels, B-splines can be evaluated using matrix forms. For a single segment:
Where:
: The parameter vector . : The basis matrix (determined by the degree and knot vector). : The vector of control points.
Note: For NURBS, the same operation is performed on weighted control points in homogeneous coordinates
How is it uniquely determined?
A NURBS curve is uniquely defined by four inputs:
- Degree (
): Determines the polynomial complexity. - Knot Vector (
): A non-decreasing sequence of numbers (e.g., ). It dictates how the control points influence the curve along the parameter . - Control Points (
): The skeleton of the curve. - Weights (
): The "strength" of each control point. If all weights are 1.0, the curve is a non-rational B-spline.
Uniqueness Note: In STEP, these are explicitly stored in entities like B_SPLINE_CURVE_WITH_KNOTS. A NURBS curve is only "determined" within the range of its knot vector (typically
Parameter Space: 2D vs. 3D
STEP uses two ways to define curves on surfaces:
- Space Curve (3D): Defined directly in 3D XYZ space (e.g.,
B_SPLINE_CURVE_WITH_KNOTS). - PCurve (2D): Defined in the 2D UV parameter space of a surface (e.g.,
PCURVE).
Why both?
Robust geometry kernels use PCURVE to ensure that the boundary of a face (the trim line) lies exactly on the surface, preventing "gaps" or "leaks" in the model during import/export.
2. Topology and B-rep Types
STEP strictly separates Topology (connectivity) from Geometry (mathematical shape).
Geometry vs. Topology Separation
- Topology: Defines the "skeleton" of the model (who is next to whom).
- Geometry: Defines the "meat" of the model (the exact coordinates and formulas).
Closed vs. Open Shells
- MANIFOLD_SOLID_BREP: Represents a "water-tight" solid. It must have a volume.
- SHELL_BASED_SURFACE_MODEL: Represents surfaces with no volume (e.g., a thin sheet of metal).
Voids and Hollow Solids
For solids with internal cavities (voids), STEP uses ORIENTED_CLOSED_SHELL.
- Outer Bound: The exterior shell (oriented "out").
- Voids: One or more internal closed shells (oriented "in").
3. Geometric Entities & Primitives
Primitives (CSG)
While STEP is primarily B-rep, it supports "Primitives" which can be used in CSG (Constructive Solid Geometry) operations or as B-rep underlying geometry:
BLOCK: A rectangular box.CYLINDER: A cylinder.SPHERE: A sphere.TORUS: A doughnut shape.
Complex Surfaces & Fillets
CAD kernels prioritize using the simplest mathematical definition (Elementary Surfaces) to keep files lightweight and precise before falling back to NURBS.
- Elementary Surfaces for Fillets:
CYLINDRICAL_SURFACE: Often used for constant-radius fillets along straight edges.TOROIDAL_SURFACE/SPHERICAL_SURFACE: Used for fillets at corners or along circular edges.
- NURBS (
B_SPLINE_SURFACE): Used for Variable Radius Fillets or complex "blends" where multiple surfaces meet. - Note: Many CAD systems offer an "Export all surfaces as NURBS" option. While this increases file size, it is sometimes used to improve compatibility between systems that might struggle to interpret complex elementary surface intersections.
- Offset Surface: A surface defined at a constant distance from a base surface (
OFFSET_SURFACE).
4. Continuity and Quality
Geometric Continuity (G0, G1, G2)
When two surfaces or curves meet, their "smoothness" is defined by continuity.
| Type | Name | Visual Result |
|---|---|---|
| G0 | Positional | The elements touch, but there is a visible "crease". |
| G1 | Tangential | The transition is smooth (no crease), but the reflection might "jump". |
| G2 | Curvature | The transition is perfectly smooth; reflections flow across the boundary. |
STEP Implementation: Continuity is often explicitly declared in NURBS entities (e.g., continuity: geometric_continuity_2).
5. Physical Properties (Mass Properties)
STEP can store calculated physical data so that the receiving system can verify the integrity of the geometry.
- Volume: Stored in
GEOMETRIC_ITEM_SPECIFIC_USAGElinked to aVOLUME_UNIT. - Mass / Center of Gravity: Often stored under
PROPERTY_DEFINITIONentities. - Validation Properties: Special entities like
VALUATION_PROPERTYare used to store "check values" for area and volume. If the imported model's volume differs from this value, the import is considered failed or "lossy".
💡 Implementation Tips
- Check for Water-tightness: If you are importing a
MANIFOLD_SOLID_BREP, verify that everyEDGE_CURVEis shared by exactly twoADVANCED_FACEs (manifold condition). - Handle Degree 1 Splines: Often, CAD systems export polylines as degree 1 NURBS.
- Torus Inversion: Pay attention to the
axisandradiusattributes ofTOROIDAL_SURFACE. If the minor radius is larger than the major radius, it becomes a self-intersecting "spindle torus".
📚 Next Steps
- Common Pitfalls - Learn about tolerance issues.
- Validation and CAx-IF - How to use validation properties.
🔗 Further Reading & References
- The NURBS Book (Les Piegl and Wayne Tiller): The "Bible" of NURBS. Essential for anyone implementing geometry kernels.
- NURBS-Python (geomdl) Documentation: Excellent practical examples and visual explanations of NURBS math.
- CAx-IF Recommended Practices: Official guidelines on how to implement STEP geometry to ensure interoperability between CAD systems.
- ISO 10303-42: The official part of the STEP standard that defines "Geometric and topological representation."