.. role:: blue :class: blue MbContour3D Contour =================== .. _MbContour3D_Contour_: .. версия ядра: The :blue:`MbContour3D` class is declared in the *cur_contour3d.h* file. The :blue:`MbContour3D` contour is defined by a set of RPArray\<:blue:`MbCurve3D`\> **segments** of curves joined one after another and by the *closed* flag indicating whether the curve is periodic. The contour is a composite curve. Unlike other curves, a contour may have breaks. The curves that form the contour are called segments. The segments of the contour satisfy the following conditions: the start point of each subsequent segment coincides with the end point of the previous segment. For a periodic contour, the start point of the first segment coincides with the end point of the last segment. If the contour contains only one segment of one of the following types, it is considered non-periodic: :blue:`MbLine3D`, :blue:`MbLineSegment3D`, :blue:`MbSpiral` and classes derived from it, MbBridgeCurve3D. To check whether the start and end points of the contour coincide within a specified tolerance, you must use the :blue:`IsTouch`\() method, which determines coincidence regardless of the smoothness of closure. In the general case, at the junctions of segments, the derivatives of the contour are discontinuous in length and direction. The initial value of the contour parameter is zero: *t*\ :sub:`min` = 0. The parametric length of the contour is equal to the sum of the parametric lengths of its segments: .. math:: t_{\text{max}} = \sum \left( w_{i\text{max}} - w_{i\text{min}} \right), where *w*\ :sub:`imin` and *w*\ :sub:`imax` are the minimum and maximum values of the parameter of the *i*\-th segment. When computing the radius vector of a point on the contour, the working segment and the value of its local parameter are first determined from the parameter value, then the radius vector of the working segment is computed and used as the radius vector of the contour. In the :blue:`PointOn`\(double & *t*, :ref:`MbCartPoint3D ` & **r**) method, the radius vector **r** of the curve is described by the vector function .. math:: \mathbf{r}(t) = \mathbf{segments}[k]\bigl(w_{k}\bigr), where **segments**\[k]\(*w*\ :sub:`k`) is the working contour segment with index *k*, and *w*\ :sub:`k` is the parameter of the working segment, equal to .. math:: w_{k} = w_{k\text{min}} + t - \sum_{i = 0}^{k-1} \bigl(w_{i\text{max}} - w_{i\text{min}}\bigr). The segment with index *k* is determined from the contour parameter *t* by the condition .. math:: \sum_{i = 0}^{k-1} \bigl(w_{i\text{max}} - w_{i\text{min}}\bigr) \leq t < \sum_{i = 0}^{k} \bigl(w_{i\text{max}} - w_{i\text{min}}\bigr), where *w*\ :sub:`imin` and *w*\ :sub:`imax` are the minimum and maximum values of the parameter of the *i*\-th segment. The contour is shown in the figure: .. figure:: /MODELER/CURVES/pictures/O.4.18.1.png :width: 12cm :align: center Segments of the contour must not themselves be other contours. If a contour needs to be constructed based on other contours, the latter must be treated as a collection of their constituent curves rather than as single curves. The :blue:`MbContour3D` contour is the most general type of curve.