1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0027531: Modeling Algorithms - Make the algorithm Approx_SameParameter more clear and robust

Approx/Approx_SameParameter.cxx,hxx:
Class Approx_SameParameter refactoring. Logic is changed in many places to unify usage, simplify maintenance.
Method Curve2d() is changed to return Geom2d_Curve instead of Geom2d_BSplineCurve. Corresponding message is added to the upgrade guide.
.lxx file is merged into .hxx.
Tangent computation is extracted into special method.
Comparing number of sample points after CheckSameParameter(...) is added to define cases with projection fails.
Undesirable behavior when curves are not same parameterized is fixed.

Geom2dAdaptor/Geom2dAdaptor.cxx: treatment of offset curve is added

Adaptor3d/Adaptor3d_TopolTool.cxx: minor improvement of performance for BSpline surfaces with huge number of knots

Tests were modified according to new behavior of sameparameter algorithm
This commit is contained in:
ifv
2019-05-31 16:36:44 +03:00
committed by bugmaster
parent 739c7e5968
commit fffc249f21
63 changed files with 814 additions and 672 deletions

View File

@@ -16,6 +16,7 @@
#include <Adaptor2d_Curve2d.hxx>
#include <Geom2dAdaptor_Curve.hxx>
#include <Geom2d_BezierCurve.hxx>
#include <Geom2d_BSplineCurve.hxx>
#include <Geom2d_Circle.hxx>
@@ -88,7 +89,21 @@ Handle(Geom2d_Curve) Geom2dAdaptor::MakeCurve
C2D = HC.BSpline();
}
break;
case GeomAbs_OffsetCurve:
{
const Geom2dAdaptor_Curve* pGAC = dynamic_cast<const Geom2dAdaptor_Curve*>(&HC);
if (pGAC != 0)
{
C2D = pGAC->Curve();
}
else
{
Standard_DomainError::Raise("Geom2dAdaptor::MakeCurve, Not Geom2dAdaptor_Curve");
}
}
break;
default:
throw Standard_DomainError("Geom2dAdaptor::MakeCurve, OtherCurve");
@@ -99,8 +114,19 @@ Handle(Geom2d_Curve) Geom2dAdaptor::MakeCurve
((HC.FirstParameter() != C2D->FirstParameter()) ||
(HC.LastParameter() != C2D->LastParameter()))) {
C2D = new Geom2d_TrimmedCurve
(C2D,HC.FirstParameter(),HC.LastParameter());
if (C2D->IsPeriodic() ||
(HC.FirstParameter() >= C2D->FirstParameter() &&
HC.LastParameter() <= C2D->LastParameter()))
{
C2D = new Geom2d_TrimmedCurve
(C2D, HC.FirstParameter(), HC.LastParameter());
}
else
{
Standard_Real tf = Max(HC.FirstParameter(), C2D->FirstParameter());
Standard_Real tl = Min(HC.LastParameter(), C2D->LastParameter());
C2D = new Geom2d_TrimmedCurve(C2D, tf, tl);
}
}
return C2D;