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

Compare commits

...

1 Commits

Author SHA1 Message Date
jgv
6f47090071 0024103: Infinite loop in HLR algorithm on the customer's shape
Points that are not "same parameter" are excluded from processing
2016-02-16 07:49:53 +03:00
3 changed files with 69 additions and 0 deletions

View File

@@ -44,6 +44,10 @@
#include <TColStd_Array1OfInteger.hxx>
#include <TopTrans_CurveTransition.hxx>
#include <BRepAdaptor_HCurve2d.hxx>
#include <Geom_Curve.hxx>
#include <BRep_Tool.hxx>
#define Tolpetit 1.e-10 // pour dist au carre
#define tole 5.e-6
@@ -535,6 +539,23 @@ static void ComputeTangency (const Contap_TheSearch& solrst,
const Handle(Adaptor2d_HCurve2d)& thearc = PStart.Arc();
theparam = PStart.Parameter();
gp_Pnt2d Ptoproj=Contap_HCurve2dTool::Value(thearc,theparam);
//jgv: for the issue 24103 to exclude points that are not same parameter:
//these points can be out of the surface's domain and lead to failure of Walking algorithm.
gp_Pnt PointFromSurf = Surf->Value(Ptoproj.X(), Ptoproj.Y());
Handle(BRepAdaptor_HCurve2d) brhc = Handle(BRepAdaptor_HCurve2d)::DownCast(thearc);
TopoDS_Edge theedge = brhc->ChangeCurve2d().Edge();
Standard_Real fpar, lpar;
Handle(Geom_Curve) thecurve = BRep_Tool::Curve(theedge, fpar, lpar);
if (!thecurve.IsNull())
{
gp_Pnt PointFromEdge = thecurve->Value(theparam);
Standard_Real TolEdge = BRep_Tool::Tolerance(theedge);
if (PointFromSurf.Distance(PointFromEdge) > 2.*TolEdge)
continue;
}
//////////////////////////////////////////////////////////
//-- lbr le 15 mai 97
//-- On elimine les points qui sont egalement present sur une restriction solution
Standard_Boolean SurUneRestrictionSolution = Standard_False;

24
tests/bugs/modalg_5/bug24103_1 Executable file
View File

@@ -0,0 +1,24 @@
puts "============"
puts "OCC24103"
puts "============"
puts ""
######################################################
# Infinite loop in HLR algorithm on the customer's shape
######################################################
pload XDE
smallview
right
stepread [locate_data_file bug24100_REFLECT_CURVE_PART_5_SOL_ohne_Metadaten.stp] a *
explode a_1
donly a_1_1
fit
reflectlines result a_1_1 1 0 0
set length 4217.78
set only_screen_axo 1

24
tests/bugs/modalg_5/bug24103_2 Executable file
View File

@@ -0,0 +1,24 @@
puts "============"
puts "OCC24103"
puts "============"
puts ""
######################################################
# Infinite loop in HLR algorithm on the customer's shape
######################################################
pload XDE
smallview
top
stepread [locate_data_file bug24100_REFLECT_CURVE_PART_5_SOL_ohne_Metadaten.stp] a *
explode a_1
donly a_1_1
fit
reflectlines result a_1_1 0 0 1
set length 6385.96
set only_screen_axo 1