CAD Exchanger SDK
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.

Continuity

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
line2d.png
Circle ModelData_Circle, ModelData_Circle2d
circle2d.png
Ellipse ModelData_Ellipse, ModelData_Ellipse2d
ellipse2d.png
Hyperbola ModelData_Hyperbola, ModelData_Hyperbola2d
hyperbola2d.png
Parabola ModelData_Parabola, ModelData_Parabola2d
parabola2d.png
Bezier curve ModelData_BezierCurve, ModelData_BezierCurve2d
bezier_curve.png
B-Spline curve ModelData_BSplineCurve, ModelData_BSplineCurve2d
bspline_curve.png
Offset curve ModelData_OffsetCurve, ModelData_OffsetCurve2d
offset_curve_2d.png
Trimmed curve ModelData_TrimmedCurve, ModelData_TrimmedCurve2d
trimmed_curve_2d.png

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
plane.png
Conical Surface ModelData_ConicalSurface
conical_surface.png
Cylindrical Surface ModelData_CylindricalSurface
cylindrical_surface.png
Spherical Surface ModelData_SphericalSurface
spherical_surface.png
Toroidal Surface ModelData_ToroidalSurface
toroidal_surface.png
Surface of Linear Extrusion ModelData_SurfaceOfLinearExtrusion
surface_of_linear_extrusion.png
Surface of Revolution ModelData_SurfaceOfRevolution
surface_of_revolution.png
Bezier Surface ModelData_BezierSurface
bezier_surface.png
B-Spline Surface ModelData_BSplineSurface
bspline_surface.png
Offset Surface ModelData_OffsetSurface
offset_surface.png
Rectangular Trimmed Surface ModelData_RectangularTrimmedSurface
rectangular_trimmed_surface.png

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.