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

0026351: Wrong result found by the projection algorithm

C2 continuity intervals changed to Knots intervals in case of Bspline curve.
Fixed incorrect extremaPC usage.

Test case for issue CR26351
Update of test-cases according to the new behavior
This commit is contained in:
aml
2015-06-24 15:44:28 +03:00
committed by bugmaster
parent e03bdee2e1
commit c8bf1eb747
43 changed files with 405 additions and 203 deletions

View File

@@ -232,16 +232,28 @@ Standard_Real ShapeAnalysis_Curve::ProjectAct(const Adaptor3d_Curve& C3D,
try {
OCC_CATCH_SIGNALS
Extrema_ExtPC myExtPC(P3D,C3D);
if ( myExtPC.IsDone() && ( myExtPC.NbExt() > 0) ) {
Standard_Real dist2, dist2Min = myExtPC.SquareDistance(1);
Standard_Integer index = 1;
for ( Standard_Integer i = 2; i <= myExtPC.NbExt(); i++) {
Standard_Real dist2Min = RealLast() , dist2;
Standard_Integer index = 0;
if ( myExtPC.IsDone() && ( myExtPC.NbExt() > 0) )
{
for ( Standard_Integer i = 1; i <= myExtPC.NbExt(); i++)
{
if (!myExtPC.IsMin(i))
continue;
dist2 = myExtPC.SquareDistance(i);
if ( dist2 < dist2Min) { dist2Min = dist2; index = i; }
if ( dist2 < dist2Min)
{
dist2Min = dist2; index = i;
}
}
if (index != 0)
{
param = (myExtPC.Point(index)).Parameter();
proj = (myExtPC.Point(index)).Value();
OK = Standard_True;
}
param = (myExtPC.Point(index)).Parameter();
proj = (myExtPC.Point(index)).Value();
OK = Standard_True;
}
}
catch(Standard_Failure) {