mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024682: Move out B-spline cache from curves and surfaces to dedicated classes BSplCLib_Cache and BSplSLib_Cache
1. B-spline cache was moved into separated classes: BSplCLib_Cache for 2D and 3D curves and BSplSLib_Cache for surfaces. 2. The cache is used now in corresponding adaptor classes (Geom2dAdaptor_Curve, GeomAdaptor_Curve and GeomAdaptor_Surface) when the curve or surface is a B-spline. 3. Algorithms were changed to use adaptors for B-spline calculations instead of curves or surfaces. 4. Precised calculation of derivatives of surface of revolution is implemented for the points of surface placed on the axis of revolution (Geom_SurfaceOfRevolution.cxx) 5. Small modifications are made to adjust algorithms to new behavior of B-spline calculation. 6. Test cases were modified according to the modern behavior. 7. Changes in BOPAlgo_WireSplitter, BOPTools_AlgoTools, BRepLib_CheckCurveOnSurface and ShapeAnalysis_Wire to use adaptors instead of geometric entities 8. Allow Geom2dAdaptor and GeomAdaptor in case of offset curve to use corresponding adaptor for basis curve Modification of test-cases according to the new behavior.
This commit is contained in:
@@ -108,7 +108,7 @@ inline Standard_Boolean IsOriented(const TopoDS_Shape& S)
|
||||
}
|
||||
|
||||
static
|
||||
void CurveDirForParameter(const Handle(Geom2d_Curve)& aC2d,
|
||||
void CurveDirForParameter(const Geom2dAdaptor_Curve& aC2d,
|
||||
const Standard_Real aPrm,
|
||||
gp_Pnt2d& Pnt,
|
||||
gp_Vec2d& aVec2d);
|
||||
@@ -1653,14 +1653,15 @@ void ChoixUV(const TopoDS_Vertex& theVertex,
|
||||
C2d = BRep_Tool::CurveOnSurface(anE, theFace, aFirstParam, aLastParam);
|
||||
if(C2d.IsNull())
|
||||
continue;
|
||||
Geom2dAdaptor_Curve aCA(C2d);
|
||||
|
||||
aParam =(aVOrientation != anE.Orientation()) ? aFirstParam : aLastParam;
|
||||
aPnt = C2d->Value(aParam);
|
||||
aPnt = aCA.Value(aParam);
|
||||
|
||||
if(!IsDistanceIn2DTolerance(aFaceSurface, aPnt, aPntRef, aTol3d, Standard_False))
|
||||
continue;
|
||||
|
||||
CurveDirForParameter(C2d, aParam, aPnt, aDer);
|
||||
CurveDirForParameter(aCA, aParam, aPnt, aDer);
|
||||
|
||||
if (aVOrientation == anE.Orientation())
|
||||
aDer.Reverse();
|
||||
@@ -1753,21 +1754,21 @@ void ChoixUV(const TopoDS_Vertex& theVertex,
|
||||
//function : CurveDirForParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void CurveDirForParameter(const Handle(Geom2d_Curve)& aC2d,
|
||||
const Standard_Real aPrm,
|
||||
gp_Pnt2d& Pnt,
|
||||
gp_Vec2d& aVec2d)
|
||||
void CurveDirForParameter(const Geom2dAdaptor_Curve& aC2d,
|
||||
const Standard_Real aPrm,
|
||||
gp_Pnt2d& Pnt,
|
||||
gp_Vec2d& aVec2d)
|
||||
{
|
||||
Standard_Real aTol=gp::Resolution();
|
||||
Standard_Integer i;
|
||||
|
||||
aC2d->D1(aPrm, Pnt, aVec2d);
|
||||
aC2d.D1(aPrm, Pnt, aVec2d);
|
||||
//
|
||||
if (aVec2d.Magnitude() <= aTol) {
|
||||
for (i = 2; i <= 100; i++){
|
||||
aVec2d = aC2d->DN(aPrm, i);
|
||||
aVec2d = aC2d.DN(aPrm, i);
|
||||
if (aVec2d.Magnitude() > aTol) {
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user