MbLoftedSurface Surface Based on a Family of Curves

The MbLoftedSurface class is declared in the surf_lofted_surface.h file.

The MbLoftedSurface surface is derived from MbSurface and passes through a given family of curves. It is defined by an array of curves uCurves of type RPArray<MbCurve3D>, an array of corresponding values of the second parameter vParams, an array of attributes of identical curves vLabels, the parameter bounds umin, umax, vmin, vmax, the closedness flags uclosed and vclosed, and the boundary conditions at the initial and final curves of the family, stored in the border1 and border2 structures.

The boundary conditions include the derivative direction, a flag indicating whether a normal is specified at a point-like end section, a derivative magnitude factor, and the direction of surface progression near the end section. The version used to calculate the coefficients of the surface equation is stored in the surfaceVersion field.

Auxiliary data are used to speed up calculations.

The first surface parameter u coincides with the parameters of the curves curves. All curves curves must have the same parameter domain; MbReparamCurve3D curves can be used for this purpose. The first surface parameter takes values in the interval umin ≤ u ≤ umax, which corresponds to the domain of the curves curves. The surface can be periodic in the first parameter if all curves in the curves set are periodic.

The second surface parameter v takes values in the interval vmin ≤ v ≤ vmax. The value v = vmin corresponds to the initial value in the set, vParams[0], and the value v = vmax corresponds to the final value in the set, vParams[vParams.MaxIndex()]. The surface can be periodic in the second parameter.

If all curves in the curves set are different, the values in the vLabels set are equal to the indices of the corresponding curves in the curves set. If adjacent curves in the curves set include identical curves translated relative to one another, the corresponding values in the vLabels set are equal to the lowest index of the replicated curve in the curves set.

The method

void PointOn(double &        u,
             double &        v,
             MbCartPoint3D & s)

computes a point on the surface and adjusts the parameters if they fall outside the rectangular domain.

The radius vector of the surface s is described by the vector function

\begin{equation} \begin{gathered} \mathbf{s}(u, v) = (1 - 3w^{2} + 2w^{3}) \cdot \mathbf{curves}[i](u) + (3w^{2} + 2w^{3}) \cdot \mathbf{curves}[i+1](u) + (w - 2w^{2} + w^{3}) \cdot \mathbf{derive}[i](u) \\ {}+ (-w^{2} + w^{3}) \cdot \mathbf{derive}[i+1](u) \cdot \bigl(\mathit{vParams}[i+1] - \mathit{vParams}[i]\bigr), \end{gathered} \end{equation}

where

\begin{equation} w = \frac{v - \mathit{vParams[i]}}{\mathit{vParams[i+1]} - \mathit{vParams[i]}}, \end{equation}

derive[i] and derive[i+1] are the derivatives of the curves[i] and curves[i+1] curves, respectively. The index i of the segment used to calculate the position vector of a point and its derivatives is determined by the condition vParams[i] ≤ v ≤ vParams[i+1]. If adjacent elements of the vLabels set have equal values, the surface between the corresponding curves is equivalent to an extrusion surface. The following figure shows a surface based on a family of curves:

../../../../_images/O.5.15.1.png

The shape of the surface depends on the arrangement of the curves and on the vParams set of parameter values at which the surface passes through the curves. To prevent surface self-intersections, the values in the vParams set must vary in proportion to the average distance between the curves.

The surface curves s(const, v) with u = const are MbHermit3D Hermite curves. The surface may have poles if the first and/or last curves in curves degenerate into a point, or if all curves curves coincide at one of their ends.