mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0025980: Wrong result obtained by projection algorithm.
Possibility of "projection failed" state to non-analytical and non-spline surfaces added. Test-case for issue #25980
This commit is contained in:
parent
41ed1ed236
commit
aa9d6bec4e
@ -560,7 +560,6 @@ void ProjLib_CompProjectedCurve::Init()
|
||||
Standard_Boolean FromLastU=Standard_False;
|
||||
|
||||
//new part (to discard far solutions)
|
||||
//Method Extrema_ExtCS gives wrong result(ex. sphere and segment orthogonal to it)
|
||||
Standard_Real TolC = Precision::Confusion(), TolS = Precision::Confusion();
|
||||
Extrema_ExtCS CExt(myCurve->Curve(),
|
||||
mySurface->Surface(),
|
||||
@ -570,13 +569,16 @@ void ProjLib_CompProjectedCurve::Init()
|
||||
{
|
||||
// Search for the minimum solution
|
||||
Nend = CExt.NbExt();
|
||||
if(myMaxDist > 0)
|
||||
if(myMaxDist > 0 &&
|
||||
// Avoid usage of extrema result that can be wrong for extrusion
|
||||
mySurface->GetType() != GeomAbs_SurfaceOfExtrusion)
|
||||
{
|
||||
Standard_Real min_val2;
|
||||
min_val2 = CExt.SquareDistance(1);
|
||||
for(i = 2; i <= Nend; i++)
|
||||
if (CExt.SquareDistance(i) < min_val2) min_val2 = CExt.SquareDistance(i);
|
||||
if(min_val2 > myMaxDist * myMaxDist) return;
|
||||
if (min_val2 > myMaxDist * myMaxDist)
|
||||
return;
|
||||
}
|
||||
}
|
||||
// end of new part
|
||||
|
@ -522,7 +522,7 @@ void ProjLib_ProjectedCurve::Load(const Handle(Adaptor3d_HCurve)& C)
|
||||
}
|
||||
}
|
||||
|
||||
ProjLib_CompProjectedCurve Projector(mySurface,myCurve, myTolerance, myTolerance);
|
||||
ProjLib_CompProjectedCurve Projector(mySurface,myCurve, myTolerance, myTolerance, 100 * myTolerance);
|
||||
Handle(ProjLib_HCompProjectedCurve) HProjector = new ProjLib_HCompProjectedCurve();
|
||||
HProjector->Set(Projector);
|
||||
|
||||
@ -537,7 +537,7 @@ void ProjLib_ProjectedCurve::Load(const Handle(Adaptor3d_HCurve)& C)
|
||||
}
|
||||
else
|
||||
{
|
||||
StdFail_NotDone::Raise("ProjLib CompProjectedCurve Not Done");
|
||||
return;
|
||||
}
|
||||
// Approximons cette courbe algorithmique.
|
||||
Standard_Boolean Only3d = Standard_False;
|
||||
|
16
tests/bugs/modalg_5/bug25980
Normal file
16
tests/bugs/modalg_5/bug25980
Normal file
@ -0,0 +1,16 @@
|
||||
puts "========"
|
||||
puts "OCC25980"
|
||||
puts "========"
|
||||
puts ""
|
||||
#################################################
|
||||
# Wrong result obtained by projection algorithm
|
||||
#################################################
|
||||
|
||||
restore [locate_data_file c2t.draw] c
|
||||
restore [locate_data_file s1t.draw] s
|
||||
|
||||
set bug_info [catch {project x c s}]
|
||||
|
||||
if {$bug_info == 0} {
|
||||
puts "ERROR: OCC25980 is reproduced."
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user