MbSurfaceIntersectionCurve Surface Intersection Curve
The MbSurfaceIntersectionCurve class is declared in the cur_surface_intersection.h file.
A surface intersection curve MbSurfaceIntersectionCurve is defined by two curves MbSurfaceCurve curveOne and 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:
Fig. 1
Fig. 2 and 3 show the curves on the surfaces from which the intersection curve is constructed.
Fig. 2
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.
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 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.
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 PointOn( double & t, MbMatrix3D & r ) method, the radius vector of the curve r is described by the vector function
where u1, v1 are the coordinates of a two-dimensional point whose initial approximation is computed by the curveOne.*curve* → PointOn( t, point1 ) method, u1 = point1.x, v1 = point1.y, and u2, v2 are the coordinates of a two-dimensional point whose initial approximation is computed by the curveTwo.*curve* → PointOn( t, point2 ) method, u2 = point2.x, v2 = point2.y. Then, in the general case (buildType = cbt_Specific), the parameters u1, v1, u2, v2 are refined by an iterative method that uses the equations
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.
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.