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:
@@ -14,6 +14,7 @@
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
#include <Adaptor3d_TopolTool.ixx>
|
||||
#include <Precision.hxx>
|
||||
#include <GeomAdaptor_Surface.hxx>
|
||||
|
||||
#include <gp_Cone.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
@@ -1080,6 +1081,10 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
Standard_Real tol = Max(0.01*aDefl2, 1.e-9);
|
||||
Standard_Integer l;
|
||||
|
||||
// Calculations of B-spline values will be made using adaptor,
|
||||
// because it caches the data for performance
|
||||
GeomAdaptor_Surface aBSplAdaptor(aBS);
|
||||
|
||||
anUFlg(1) = Standard_True;
|
||||
anUFlg(nbsu) = Standard_True;
|
||||
//myNbSamplesU = 2;
|
||||
@@ -1095,10 +1100,12 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
}
|
||||
|
||||
t2 = anUPars(j);
|
||||
gp_Pnt p1 = aBS->Value(t2, t1);
|
||||
// gp_Pnt p1 = aBS->Value(t2, t1);
|
||||
gp_Pnt p1 = aBSplAdaptor.Value(t2, t1);
|
||||
for(k = j+2; k <= nbsu; ++k) {
|
||||
t2 = anUPars(k);
|
||||
gp_Pnt p2 = aBS->Value(t2, t1);
|
||||
// gp_Pnt p2 = aBS->Value(t2, t1);
|
||||
gp_Pnt p2 = aBSplAdaptor.Value(t2, t1);
|
||||
//gce_MakeLin MkLin(p1, p2);
|
||||
//const gp_Lin& lin = MkLin.Value();
|
||||
|
||||
@@ -1113,7 +1120,8 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
break;
|
||||
}
|
||||
|
||||
gp_Pnt pp = aBS->Value(anUPars(l), t1);
|
||||
// gp_Pnt pp = aBS->Value(anUPars(l), t1);
|
||||
gp_Pnt pp = aBSplAdaptor.Value(anUPars(l), t1);
|
||||
Standard_Real d = lin.SquareDistance(pp);
|
||||
|
||||
if(d <= aDefl2) continue;
|
||||
@@ -1180,10 +1188,12 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
}
|
||||
|
||||
t2 = aVPars(j);
|
||||
gp_Pnt p1 = aBS->Value(t1, t2);
|
||||
// gp_Pnt p1 = aBS->Value(t1, t2);
|
||||
gp_Pnt p1 = aBSplAdaptor.Value(t1, t2);
|
||||
for(k = j+2; k <= nbsv; ++k) {
|
||||
t2 = aVPars(k);
|
||||
gp_Pnt p2 = aBS->Value(t1, t2);
|
||||
// gp_Pnt p2 = aBS->Value(t1, t2);
|
||||
gp_Pnt p2 = aBSplAdaptor.Value(t1, t2);
|
||||
|
||||
if(p1.SquareDistance(p2) <= tol) continue;
|
||||
//gce_MakeLin MkLin(p1, p2);
|
||||
@@ -1197,7 +1207,8 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
break;
|
||||
}
|
||||
|
||||
gp_Pnt pp = aBS->Value(t1, aVPars(l));
|
||||
// gp_Pnt pp = aBS->Value(t1, aVPars(l));
|
||||
gp_Pnt pp = aBSplAdaptor.Value(t1, aVPars(l));
|
||||
Standard_Real d = lin.SquareDistance(pp);
|
||||
|
||||
if(d <= aDefl2) continue;
|
||||
|
Reference in New Issue
Block a user