1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-06-30 12:14:08 +03:00

0032601: Foundation Classes - Poly_Connect hangs on the given incorrect triangulation

This commit is contained in:
msv 2021-10-01 22:23:36 +03:00 committed by smoskvin
parent 0f05f21194
commit 41fc11b056
3 changed files with 37 additions and 18 deletions

View File

@ -223,6 +223,8 @@ void Poly_Connect::Initialize(const Standard_Integer N)
mytr = myfirst; mytr = myfirst;
mysense = Standard_True; mysense = Standard_True;
mymore = (myfirst != 0); mymore = (myfirst != 0);
myPassedTr.Clear();
myPassedTr.Add (mytr);
if (mymore) if (mymore)
{ {
Standard_Integer i, no[3]; Standard_Integer i, no[3];
@ -252,7 +254,8 @@ void Poly_Connect::Next()
if ((n[j] == mynode) && (n[(j+1)%3] == myothernode)) { if ((n[j] == mynode) && (n[(j+1)%3] == myothernode)) {
mytr = t[i]; mytr = t[i];
myothernode = n[(j+2)%3]; myothernode = n[(j+2)%3];
mymore = (mytr != myfirst); mymore = !myPassedTr.Contains (mytr);
myPassedTr.Add (mytr);
return; return;
} }
} }
@ -275,7 +278,8 @@ void Poly_Connect::Next()
if ((n[j] == mynode) && (n[(j+2)%3] == myothernode)) { if ((n[j] == mynode) && (n[(j+2)%3] == myothernode)) {
mytr = t[i]; mytr = t[i];
myothernode = n[(j+1)%3]; myothernode = n[(j+1)%3];
mymore = Standard_True; mymore = !myPassedTr.Contains (mytr);
myPassedTr.Add (mytr);
return; return;
} }
} }

View File

@ -22,6 +22,7 @@
#include <Standard_Handle.hxx> #include <Standard_Handle.hxx>
#include <TColStd_Array1OfInteger.hxx> #include <TColStd_Array1OfInteger.hxx>
#include <TColStd_PackedMapOfInteger.hxx>
#include <Standard_Integer.hxx> #include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx> #include <Standard_Boolean.hxx>
class Poly_Triangulation; class Poly_Triangulation;
@ -159,6 +160,7 @@ private:
Standard_Integer myothernode; Standard_Integer myothernode;
Standard_Boolean mysense; Standard_Boolean mysense;
Standard_Boolean mymore; Standard_Boolean mymore;
TColStd_PackedMapOfInteger myPassedTr;
}; };

View File

@ -0,0 +1,13 @@
puts "============"
puts "0032601: Foundation Classes - Poly_Connect hangs on the given incorrect triangulation"
puts "============"
puts ""
cpulimit 30
restore [locate_data_file cone_bad_tri.brep] a
vinit Viewer1/View1
vdefaults -autotriang 0
vdisplay a
vfit
vsetdispmode 1