.. role:: blue :class: blue MbSurfaceIntersectionCurve Surface Intersection Curve ===================================================== .. _MbSurfaceIntersectionCurve_Surface_Intersection_Curve_: .. kernel version: The :blue:`MbSurfaceIntersectionCurve` class is declared in the *cur_surface_intersection.h* file. A surface intersection curve MbSurfaceIntersectionCurve is defined by two curves :blue:`MbSurfaceCurve` **curveOne** and :ref:`MbSurfaceCurve ` **curveTwo** on the intersecting surfaces, a construction parameter **buildType**, and a tolerance **tolerance**. The curve also contains some additional data that is not mandatory and is used to speed up the work of the curve methods. The curves **curveOne**\(\ *t*) and **curveTwo**\(\ *t*) have the same domain of the parameter *t* and coincide in space with a certain known accuracy. The **buildType** parameter of the intersection curve specifies the curve type and carries information about the way of computing the radius vector of a point on the curve. The **buildType** parameter takes the values *cbt_Specific*, *cbt_Ordinary*, *cbt_Boundary*, *cbt_Tolerant*. Fig. 1 shows two surfaces and their intersection curve: .. figure:: /MODELER/CURVES/pictures/O.4.24.1.png :width: 10cm :align: center Fig. 1 Fig. 2 and 3 show the curves on the surfaces from which the intersection curve is constructed. .. figure:: /MODELER/CURVES/pictures/O.4.24.2.png :width: 10cm :align: center Fig. 2 .. figure:: /MODELER/CURVES/pictures/O.4.24.3.png :width: 10cm :align: center Fig. 3 In the general case, the intersection curve has the *cbt_Specific* type; the two-dimensional curves **curveOne.curve** and **curveTwo.curve** are splines and approximate the intersection of the surfaces *curveOne.surface* and *curveTwo.surface*. The splines on the surfaces have consistent control points. At the control points, the splines on the surfaces **curveOne** and **curveTwo** coincide and have the same parameter values. On the segments between the spline control points, the MbSurfaceIntersectionCurve also returns the exact value of the point radius vector. In the general case, a point of the surface intersection curve is computed by an iterative method that uses the two-dimensional curves *curveOne*.*curve* and *curveTwo*.*curve* as an initial approximation. In particular cases, the intersection curve has the *cbt_Ordinary*, *cbt_Boundary*, or *cbt_Tolerant* type, and a point of the surface intersection curve is computed as the arithmetic mean of the radius vectors of the curves **curveOne**\( *t* ) and **curveTwo**\( *t* ). If *buildType = cbt_Ordinary*, then the MbSurfaceIntersectionCurve curve exactly describes the intersection of the surfaces, and the curves **curveOne**\( *t* ) and **curveTwo**\( *t* ) coincide in space. An example of such a curve is the intersection curve of a plane and a cylindrical surface whose axis is orthogonal to the plane, see Fig. 4. .. figure:: /MODELER/CURVES/pictures/O.4.24.4.png :width: 10cm :align: center Fig. 4 On the plane, **curveOne**.\ *curve* is a circle, and on the cylindrical surface, **curveTwo**.\ *curve* is a segment whose parametric length is equal to the parametric length of the two-dimensional curve on the plane. The equality of the parametric lengths is achieved by constructing, on the basis of the segment, a reparameterized curve :ref:`MbReparamCurve `. If *buildType = cbt_Boundary*, then the MbSurfaceIntersectionCurve curve describes a surface boundary, see Fig. 5. For such a curve, the equalities *curveOne*.*curve* = *curveTwo*.*curve* and *curveOne.surface* = *curveTwo.surface* hold. .. figure:: /MODELER/CURVES/pictures/O.4.24.5.png :width: 10cm :align: center Fig. 5 If *buildType = cbt_Tolerant*, then the MbSurfaceIntersectionCurve curve describes the intersection of surfaces approximately. The curves *curveOne*(*t*) and **curveTwo**\( *t* ) coincide in space with accuracy **tolerance**. Such curves are constructed when another construction is impossible, for example, when it is necessary to intersect two surfaces that touch each other not exactly but with some “noise”. In the :blue:`PointOn`\( double & *t*, :blue:`MbMatrix3D` & *r* ) method, the radius vector of the curve *r* is described by the vector function .. math:: \mathbf{r}(t) = 0.5 \left( \mathbf{curveOne.surface}(u_1, v_1) + \mathbf{curveTwo.surface}(u_2, v_2) \right), where *u*\ :sub:`1`, *v*\ :sub:`1` are the coordinates of a two-dimensional point whose initial approximation is computed by the *curveOne*.*curve* → :blue:`PointOn`\( *t*, *point1* ) method, *u*\ :sub:`1` = *point1.x*, *v*\ :sub:`1` = *point1.y*, and *u*\ :sub:`2`, *v*\ :sub:`2` are the coordinates of a two-dimensional point whose initial approximation is computed by the *curveTwo*.*curve* → :blue:`PointOn`\( *t*, *point2* ) method, *u*\ :sub:`2` = *point2.x*, *v*\ :sub:`2` = *point2.y*. Then, in the general case (*buildType = cbt_Specific*), the parameters *u*\ :sub:`1`, *v*\ :sub:`1`, *u*\ :sub:`2`, *v*\ :sub:`2` are refined by an iterative method that uses the equations .. math:: \mathbf{curveOne.surface}(u_1, v_1) = \mathbf{plane}(x, y), .. math:: \mathbf{curveTwo.surface}(u_2, v_2) = \mathbf{plane}(x, y), where **plane** is a plane perpendicular to the segment connecting two nearest control points of the intersection curve. The intersection curve in the general case and the control points used to construct the curves **curveOne** and **curveTwo** are shown in Fig. 6. .. figure:: /MODELER/CURVES/pictures/O.4.24.6.png :width: 10cm :align: center Fig. 6 The parameter domain of the intersection curve coincides with the domain of the common parameter of the curves **curveOne** and **curveTwo**. A surface intersection curve may be periodic. Among its data, a surface intersection curve contains a three-dimensional curve **spaceCurve**, which coincides with the intersection curve with accuracy **tolerance**. The **spaceCurve** curve is used to construct planar projections of edges. The **spaceCurve** curve is an auxiliary object and is computed only when necessary.