.. role:: blue :class: blue MbSpiralSurface Spiral Surface ============================== .. _MbSpiralSurface_Spiral_Surface_: .. версия ядра: 1180ХХ Class :blue:`MbSpiralSurface` is declared in file *surf\_spiral\_surface.h*. Spiral surface :blue:`MbSpiralSurface` belongs to the group of swept surfaces :blue:`MbSweptSurface`. Spiral surface is a special case of a swept surface with a guiding curve in the form of a cylindrical spiral. The spiral surface is defined by a generatrix curve :ref:`MbCurve3D ` * **curve**, a local coordinate system :ref:`MbPlacement3D ` **position** whose vector **position.axisZ** is the spiral axis, the spiral radius *radius*, the spiral step *step*, the position of the spiral start **origin**, and the spiral boundary parameters *vmin* and *vmax*. The surface also has some additional data that are not mandatory and are used to speed up the work of the surface methods. The spiral axis coincides with the coordinate axis **position.axisZ** of the local coordinate system. The first parameter of the surface *u* coincides with the generatrix curve parameter. The first parameter of the surface takes values on the segment *umin* ≤ *u* ≤ *umax*, which corresponds to the domain of the generatrix curve. The surface can be periodic in the first parameter if the generatrix curve is periodic. The second parameter of the surface *v* takes values on the segment *vmin* ≤ *v* ≤ *vmax*. Value *v* = 0 corresponds to a point on the generatrix curve. Value of the second parameter *v* equal to 2π corresponds to points of the generatrix curve shifted by the vector **position.axisZ** multiplied by *step*. The surface cannot be periodic in the second parameter. In method :blue:`PointOn`\( double *u*, double *v*, :ref:`MbCartPoint3D ` & **s** ) the radius vector of the surface **s** is described by the vector function .. math:: :nowrap: \begin{equation} \mathbf{s}(u, v) = \mathbf{position.origin} + \mathit{radius} \left( \cos(t)\, \mathbf{position.axisX} + \sin(t)\, \mathbf{position.axisY} \right) + \left( \frac{t \cdot \mathit{step}}{2 \pi} \right) \mathbf{position.axisZ} + \left( \mathbf{curve}(u) - \mathbf{origin} \right) \mathbf{M}(v), \end{equation} where **M**\(*v*) is a rotation matrix. Note that multiplication of the vector (**curve**\(*u*) - **origin**) by matrix **M**\(*v*) is performed on the right. The rotation matrix has the form .. math:: :nowrap: \begin{equation} M(v) = A^{-1} \cdot \begin{bmatrix} \cos v & -\sin v & 0 \\ \sin v & \cos v & 0 \\ 0 & 0 & 1 \end{bmatrix} \cdot A = \begin{bmatrix} \mathbf{position.axisX} \\ \mathbf{position.axisY} \\ \mathbf{position.axisZ} \end{bmatrix}^{-1} \cdot \begin{bmatrix} \cos v & -\sin v & 0 \\ \sin v & \cos v & 0 \\ 0 & 0 & 1 \end{bmatrix} \cdot \begin{bmatrix} \mathbf{position.axisX} \\ \mathbf{position.axisY} \\ \mathbf{position.axisZ} \end{bmatrix}. \end{equation} Matrix **A** is a coordinate transformation matrix of the radius vector of a point from the local coordinate system **position** to the global coordinate system. The rows of matrix **A** are composed of the components of the basis vectors of the local coordinate system. Matrix **M**\(*v*) maps the vector **curve**\(*u*) - **origin** into the local coordinate system, rotates it there by angle *v* around the rotation axis, and maps the rotated vector back into the global coordinate system. Spiral surface is shown in Fig. 1: .. figure:: /MODELER/SURFACES/pictures/O.5.10.1.png :width: 12cm :align: center Fig. 1 For boundary values of the second parameter of the surface the inequality *vmin* < *vmax* must hold.