MbSurfaceIntersectionCurve Surface Intersection Curve
The MbSurfaceIntersectionCurve class is declared in the cur_surface_intersection.h file.
A surface intersection curve MbSurfaceIntersectionCurve is described by two MbSurfaceCurve curves, curveOne and MbSurfaceCurve curveTwo, on the intersecting surfaces, a construction parameter buildType, and an accuracy tolerance. The curve also has some optional data that speeds up its methods.
The curves curveOne(t) and curveTwo(t) have the same domain of the parameter t and coincide in space within a known accuracy. The buildType parameter of the intersection curve describes the curve type and specifies how the position vector of a point on the curve is calculated. When buildType = cbt_Ordinary or buildType = cbt_Boundary, the curves coincide exactly in space. When buildType = cbt_Specific or buildType = cbt_Tolerant, the curves coincide within the specified accuracy. Fig. 1 shows two surfaces and their intersection curve:
Fig. 1
Figs. 2 and 3 show the curves on the surfaces used to construct the intersection curve.
Fig. 2
Fig. 3
In the general case, the intersection curve has the type cbt_Specific. The two-dimensional curves curveOne.curve and curveTwo.curve are splines that approximate the intersection of the surfaces curveOne.surface and curveTwo.surface. The splines on the surfaces have corresponding control points. At the control points, the splines on the surfaces curveOne and curveTwo coincide and have the same parameter values. Between the spline control points, the MbSurfaceIntersectionCurve curve also returns the exact position vector of a point. In the general case, a point on the surface intersection curve is calculated using an iterative method that uses the two-dimensional curves curveOne.curve and curveTwo.curve as an initial approximation.
In special cases, the intersection curve has the type cbt_Ordinary, cbt_Boundary, or cbt_Tolerant, and a point on the surface intersection curve is calculated as the arithmetic mean of the position vectors of the curves curveOne(t) and curveTwo(t).
If buildType = cbt_Ordinary, the MbSurfaceIntersectionCurve curve describes the intersection of the surfaces exactly, and the curves curveOne(t) and curveTwo(t) coincide in space. An example is the intersection curve of a plane and a cylindrical surface whose axis is perpendicular to the plane, as shown in Fig. 4:
Fig. 4
On the plane, curveOne.curve is a circle, whereas on the cylindrical surface, curveTwo.curve is a line segment with a parametric length equal to that of the two-dimensional curve on the plane. Equal parametric lengths are achieved using a reparameterized curve MbReparamCurve constructed from the line segment.
If buildType = cbt_Boundary, the MbSurfaceIntersectionCurve curve describes a surface boundary, as shown in Fig. 5. For such a curve, the following equalities hold: curveOne.curve = curveTwo.curve and curveOne.surface = curveTwo.surface.
Fig. 5
If buildType = cbt_Tolerant, the MbSurfaceIntersectionCurve curve describes the intersection of the surfaces approximately. The curves curveOne(t) and curveTwo(t) coincide in space within the accuracy tolerance. Such curves are constructed when no other construction is possible, for example, when two surfaces must be intersected but their tangential contact is not exact and involves some “noise”.
In the method
PointOn( double & t, MbCartPoint3D & r )
the position vector r of the curve is described by the vector function
where u1, v1 are the coordinates of a two-dimensional point whose initial approximation is calculated by the method curveOne.curve⟶PointOn( t, point1 ), u1 = point1.x, v1 = point1.y; u2, v2 are the coordinates of a two-dimensional point whose initial approximation is calculated by the method curveTwo.curve⟶PointOn( t, point2 ), u2 = point2.x, v2 = point2.y. Then, in the general case (buildType = cbt_Specific), the parameters u1, v1, u2, v2 are refined using an iterative method based on the equations
where plane is a plane perpendicular to the line segment connecting the two nearest control points of the intersection curve. Fig. 6 shows the intersection curve in the general case and the control points used to construct the curves curveOne and curveTwo.
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 can be periodic.
The data of a surface intersection curve includes a three-dimensional curve spaceCurve, which coincides with the intersection curve within the accuracy tolerance. The spaceCurve curve is used to construct planar projections of edges. The spaceCurve curve is an auxiliary object and is calculated only when needed.