MbContour3D Contour
The MbContour3D class is declared in the cur_contour3d.h file.
The MbContour3D contour is defined by a set of RPArray<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: MbLine3D, MbLineSegment3D, 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 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: tmin = 0. The parametric length of the contour is equal to the sum of the parametric lengths of its segments:
where wimin and wimax 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 PointOn(double & t, MbCartPoint3D & r) method, the radius vector r of the curve is described by the vector function
where segments[k](wk) is the working contour segment with index k, and wk is the parameter of the working segment, equal to
The segment with index k is determined from the contour parameter t by the condition
where wimin and wimax are the minimum and maximum values of the parameter of the i-th segment. The contour is shown in the figure:
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 MbContour3D contour is the most general type of curve.