B-Rep Geometry

# Overview

Geometrical entities are used to define exact geometrical shape of the 3D objects.

Trimming (or bounding) of the 3D object is defined by the topological entities (see B-Rep Topology), whereas geometrical entities define underlying (sometimes unbounded) shape.

CAD Exchanger API follows the ISO 10303-42 specification and allows to describe:

• elementary geometry (circle, ellipse, hyperbola; plane, conical, spherical surface, etc);
• swept surfaces (surfaces of revolution and extrusion);
• Non-Uniform Rational B-Splines (NURBS);
• Bezier curves and surfaces;
• Offset curves and surfaces.

Curves can be defined in 3D model space or in 2D parametric space of a surface. Such curves are called parametric space curves or p-curves.

## Parametric definition

Geometrical objects are defined using parametric definitions:

• curves are defined in 3D space as C(t) where C is a 3D (x,y,z) point and t is a parameter from a range [a, b]
• surfaces are defined in 3D space as S(u,v) where S is a 3D (x,y,z) point and u, v are parameters from a parametric space [u_min, u_max; v_min, v_max].

Parametric ranges can be bounded or unbounded. For instance, lines or planes use unbounded range, while circles and Bezier use bounded ranges.

# Curves

CAD Exchanger provides two hierarchy of classes - for 3D and 2D curves. The former derives from the ModelData_Curve class and the latter from the ModelData_Curve2d class.

CAD Exchanger supports the following curve types. The type of the curve is returned by ModelData_Curve::Type() (or ModelData_Curve2d::Type()) as ModelData_CurveType enumeration.

Type C++ classes Example
Line ModelData_Line, ModelData_Line2d
Circle ModelData_Circle, ModelData_Circle2d
Ellipse ModelData_Ellipse, ModelData_Ellipse2d
Hyperbola ModelData_Hyperbola, ModelData_Hyperbola2d
Parabola ModelData_Parabola, ModelData_Parabola2d
Bezier curve ModelData_BezierCurve, ModelData_BezierCurve2d
B-Spline curve ModelData_BSplineCurve, ModelData_BSplineCurve2d
Offset curve ModelData_OffsetCurve, ModelData_OffsetCurve2d
Trimmed curve ModelData_TrimmedCurve, ModelData_TrimmedCurve2d

## Evaluation of points

Parametric range of the curve can be received using ModelData_Curve::UMin() and ModelData_Curve::UMax().

Points are evaluated using a parameter on the curve, as follows:

ModelData_Line aLine = ...;
ModelData_Point aPoint = aLine.Value (2.);

For periodic curves (ModelData_Curve::IsPeriodic() returns true), e.g. circles, points can be evaluation beyond the default parametric range.

# Surfaces

CAD Exchanger supports the following surface types. The type of the surface is returned by ModelData_Surface::Type() as ModelData_SurfaceType enumeration.

Type C++ class Example
Plane ModelData_Plane
Conical Surface ModelData_ConicalSurface
Cylindrical Surface ModelData_CylindricalSurface
Spherical Surface ModelData_SphericalSurface
Toroidal Surface ModelData_ToroidalSurface
Surface of Linear Extrusion ModelData_SurfaceOfLinearExtrusion
Surface of Revolution ModelData_SurfaceOfRevolution
Bezier Surface ModelData_BezierSurface
B-Spline Surface ModelData_BSplineSurface
Offset Surface ModelData_OffsetSurface
Rectangular Trimmed Surface ModelData_RectangularTrimmedSurface

## Evaluation of points

Parametric space of the surface can be received using ModelData_Surface::UMin(), UMax() and ModelData_Surface::VMin(), VMax().

Points are evaluated using a parameter on the surface, as follows:

ModelData_CylindricalSurface aSphere = ...;
ModelData_Point aPoint = aSphere.Value (M_PI / 4, M_PI / 6);

For surfaces periodic in specified direction (ModelData_Surface::IsUPeriodic() or ModelData_Surface::IsVPeriodic() return true), e.g. cylindrical surfaces, points can be evaluation beyond the default parametric range in respective direction.

# Examples

Refer to Model Explorer.