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

0027569: [Regression in 6.9.0] Projecting a curve hangs

Parameterization speed is taken into account to avoid ProjLib projector usage in case of bad input data.
Test case is added.
Test cases correction.
This commit is contained in:
aml
2016-06-09 14:38:04 +03:00
committed by bugmaster
parent f117cc5a81
commit 6728599615
3 changed files with 39 additions and 6 deletions

View File

@@ -289,7 +289,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Perform (Handle(Geom_Curv
}
GeomAdaptor_Curve aC3DAdaptor(c3d);
Standard_Real aMinParSpeed = Precision::Infinite(); // Minimal parameterization speed.
for(; anIdx <= bspl->NbKnots() && aFirstParam < Last; anIdx++)
{
// Fill current knot interval.
@@ -320,8 +320,12 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Perform (Handle(Geom_Curv
{
Standard_Real aParam = aFirstParam + aStep * anIntIdx;
aC3DAdaptor.D0 (aParam, p3d2);
aLength3d += p3d2.Distance(p3d1);
const Standard_Real aDist = p3d2.Distance(p3d1);
aLength3d += aDist;
p3d1 = p3d2;
aMinParSpeed = Min(aMinParSpeed, aDist / aStep);
}
const Standard_Real aCoeff = aLength3d / (aLastParam - aFirstParam);
if (Abs(aCoeff) > gp::Resolution())
@@ -337,7 +341,8 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::Perform (Handle(Geom_Curv
}
const Standard_Real aMaxQuotientCoeff = 1500.0;
if (anEvenlyCoeff > aMaxQuotientCoeff)
if (anEvenlyCoeff > aMaxQuotientCoeff &&
aMinParSpeed > Precision::Confusion() )
{
PerformByProjLib(c3d, First, Last, c2d);
// PerformByProjLib fail detection:

View File

@@ -0,0 +1,28 @@
puts "============"
puts "OCC27569"
puts "============"
puts ""
######################################################
# [Regression in 6.9.0] Projecting a curve hangs
######################################################
pload QAcommands
restore [locate_data_file bug27569.brep] aS
explode aS
mkcurve c aS_1
mksurface s aS_2
# Performance check
chrono h reset; chrono h start
OCC24008 c s;
chrono h stop; set q [dchrono h show]
regexp {CPU user time: ([-0-9.+eE]+) seconds} $q full aTime
set MAX_TIME 1.0
if { $aTime > ${MAX_TIME} } {
puts "Elapsed time is more than ${MAX_TIME} seconds - Faulty"
} else {
puts "Elapsed time is less than ${MAX_TIME} seconds - OK"
}

View File

@@ -1,5 +1,5 @@
# !!!! This file is generated automatically, do not edit manually! See end script
puts "TODO CR23096 ALL: NBSHAPES : Faulty"
puts "TODO CR23096 ALL: TPSTAT : Faulty"
set filename ie_soapbox-A.stp
@@ -8,8 +8,8 @@ set ref_data {
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 0 ) Summary = 0 ( 0 )
TPSTAT : Faulties = 0 ( 0 ) Warnings = 28 ( 20 ) Summary = 28 ( 20 )
CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
NBSHAPES : Solid = 2 ( 2 ) Shell = 2 ( 2 ) Face = 112 ( 112 ) Summary = 685 ( 687 )
STATSHAPE : Solid = 2 ( 2 ) Shell = 2 ( 2 ) Face = 112 ( 112 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 286 ( 288 )
NBSHAPES : Solid = 2 ( 2 ) Shell = 2 ( 2 ) Face = 112 ( 112 ) Summary = 687 ( 687 )
STATSHAPE : Solid = 2 ( 2 ) Shell = 2 ( 2 ) Face = 112 ( 112 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 288 ( 288 )
TOLERANCE : MaxTol = 0.5386330267 ( 1.019942733 ) AvgTol = 0.009444234359 ( 0.01316262156 )
LABELS : N0Labels = 1 ( 1 ) N1Labels = 0 ( 0 ) N2Labels = 0 ( 0 ) TotalLabels = 1 ( 1 ) NameLabels = 1 ( 1 ) ColorLabels = 0 ( 0 ) LayerLabels = 0 ( 0 )
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )