MbSurface Surface
The MbSurface class is declared in the surface.h file.
The MbSurface surface is an inheritor of the MbSpaceItem class, Fig. 1.
Fig. 1
The surface is an abstract class. The C3D geometric kernel implements the following surfaces, which are inheritors of the MbSurface class:
MbPlane — plane,
MbCylinderSurface — cylindrical surface,
MbConeSurface — conical surface,
MbSphereSurface — spherical surface,
MbTorusSurface — toroidal surface,
MbExtrusionSurface — extrusion surface,
MbRevolutionSurface — revolution surface,
MbExpansionSurface — plane-parallel kinematic surface,
MbSpiralSurface — spiral surface,
MbEvolutionSurface — swept surface,
MbExactionSurface — swept surface with adaptation,
MbSectorSurface — sectorial surface,
MbRuledSurface — ruled surface,
MbLoftedSurface — surface based on a family of curves,
MbElevationSurface — surface based on a family of curves and a guiding curve,
MbCornerSurface — surface based on three curves,
MbCoverSurface — surface based on four curves,
MbCoonsPatchSurface — bicubic Coons surface,
MbMeshSurface — surface based on a network of curves,
MbJoinSurface — joint surface,
MbSplineSurface — NURBS surface (NonUniform Rational B-Spline surface),
MbOffsetSurface — equidistant surface,
MbChamferSurface — chamfer surface,
MbFilletSurface — fillet surface,
MbChannelSurface — fillet surface with variable radius,
MbCurveBoundedSurface — surface with arbitrary borders.
The MbSurface surface is a vector function
of two scalar parameters u and v taking values on a two-dimensional connected domain \(\Omega\). The surface is a continuous mapping of the two-dimensional connected domain \(\Omega\) into three-dimensional space. The domain \(\Omega\) is described in a two-dimensional Cartesian coordinate system. In the particular case, the domain \(\Omega\) is a rectangle, and the surface parameters take values within umin \(\leq\) u \(\leq\) umax, vmin \(\leq\) v \(\leq\) vmax. In the general case, the domain \(\Omega\) is described by two-dimensional curves. The coordinates x(u, v), y(u, v), z(u, v) of the surface point surface(u, v) are single-valued continuous functions of the parameters u and v.
The boundary values umin, umax, vmin, vmax of the parameter domain are returned by the surface methods double GetUMin(), double GetUMax(), double GetVMin(), double GetVMax() respectively.
A surface is called periodic with respect to the first parameter if there exists pu > 0 such that surface(u ± kpu, v) = surface(u, v), where k is an integer. A surface is called periodic with respect to the second parameter if there exists pv > 0 such that surface(u, v ± kpv) = surface(u, v), where k is an integer. The domain of a periodic surface parameter lies within one period for the corresponding parameter.
The method bool IsUClosed() of a surface periodic with respect to the first parameter returns true.
The method bool IsVClosed() of a surface periodic with respect to the second parameter returns true.
The method double GetUPeriod() of a surface periodic with respect to the first parameter, or of a surface that can be extended to a periodic one, returns the period pu. The method double GetVPeriod() of a surface periodic with respect to the second parameter, or of a surface that can be extended to a periodic one, returns the period pv. The domain of a periodic surface parameter always lies within one period.
Let us introduce the notation
for the partial derivatives of the surface with respect to its parameters.
The primary method of the surface is
void PointOn( double & u, double & v, MbCartPoint3D & s ).
It returns the radius vector s(u, v) of the surface point for the given parameters u and v.
The methods
void DeriveU( double & u, double & v, MbVector3D & su ),
void DeriveV( double & u, double & v, MbVector3D & sv ),
void DeriveUU( double & u, double & v, MbVector3D & suu ),
void DeriveUV( double & u, double & v, MbVector3D & suv ),
void DeriveVV( double & u, double & v, MbVector3D & svv ),
void DeriveUUU( double & u, double & v, MbVector3D & suuu ),
void DeriveUUV( double & u, double & v, MbVector3D & suuv ),
void DeriveUVV( double & u, double & v, MbVector3D & suvv ),
void DeriveVVV( double & u, double & v, MbVector3D & svvv )
return the derivatives su, sv, suu, suv, svv, suuu, suuv, suvv, svvv of the surface radius vector for the given parameters u and v, respectively. The listed methods adjust the surface parameters when they go beyond the domain (the exception is the plane MbPlane). When the parameter u goes beyond the interval [umin, umax], surfaces that are non-periodic with respect to the first parameter shift the parameter u to the nearest boundary umin or umax, while surfaces that are periodic with respect to the first parameter add or subtract the required number of periods. When the parameter v goes beyond the interval [vmin, vmax], surfaces that are non-periodic with respect to the second parameter shift the parameter v to the nearest boundary vmin or vmax, while surfaces that are periodic with respect to the second parameter add or subtract the required number of periods.
The method
void _PointOn( double u, double v, MbCartPoint3D & s )
returns the radius vector s(u, v) of the surface point for the given parameters u and v both within the surface parameter domain and beyond it. Each non-periodic surface is extended beyond the parameter domain according to its own law. In the absence of such a law (in the general case), a non-periodic surface is extended beyond the parameter domain along the tangent to the corresponding boundary point of the surface.
The methods
void _DeriveU( double u, double v, MbVector3D & su ),
void _DeriveV( double u, double v, MbVector3D & sv ),
void _DeriveUU( double u, double v, MbVector3D & suu ),
void _DeriveUV( double u, double v, MbVector3D & suv ),
void _DeriveVV( double u, double v, MbVector3D & svv ),
void _DeriveUUU( double u, double v, MbVector3D & suuu ),
void _DeriveUUV( double u, double v, MbVector3D & suuv ),
void _DeriveUVV( double u, double v, MbVector3D & suvv ),
void _DeriveVVV( double u, double v, MbVector3D & svvv )
return the derivatives su, sv, suu, suv, svv, suuu, suuv, suvv, svvv of the surface radius vector for the given parameters u and v both within the surface domain and beyond it.
Surfaces override the following methods of a three-dimensional geometric object:
methods for geometric object transformation,
void Move( const MbVector3D & v, MbRegTransform * iReg = NULL ),
void Rotate( const MbAxis3D & axis, double angle, MbRegTransform * iReg = NULL ),
void Transform( const MbMatrix3D & m, MbRegTransform * iReg = NULL ),
methods for copying, checking for coincidence, checking for the possibility of making objects coincident, and making objects coincident,
MbSpaceItem & Duplicate( MbRegDuplicate * iReg = NULL ),
bool IsSame( const MbSpaceItem & item ),
bool IsSimilar( const MbSpaceItem & item ),
bool SetEqual( const MbSpaceItem & item ),
methods returning a type from the geometric object enumeration,
MbeSpaceType IsA(),
MbeSpaceType Type(),
MbeSpaceType Family(),
methods for retrieving and editing the internal data of an object,
MbProperty & CreateProperty( MbePrompt name ),
void GetProperties( MbProperties & properties ),
void SetProperties( MbProperties & properties ),
a method that fills the polygonal copy of a geometric object,
void CalculateWire( double sag, MbMesh & mesh ).
Most surfaces have a rectangular parameter domain. Among all surfaces, MbCurveBoundedSurface stands out as a universal surface. MbCurveBoundedSurface has curvilinear boundaries and may have arbitrary cutouts inside. MbCurveBoundedSurface is built on the basis of any surface with a rectangular parameter domain.