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:
parent
0f05f21194
commit
41fc11b056
@ -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];
|
||||||
@ -247,15 +249,16 @@ void Poly_Connect::Next()
|
|||||||
if (mysense) {
|
if (mysense) {
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
if (t[i] != 0) {
|
if (t[i] != 0) {
|
||||||
myTriangulation->Triangle (t[i]).Get (n[0], n[1], n[2]);
|
myTriangulation->Triangle (t[i]).Get (n[0], n[1], n[2]);
|
||||||
for (j = 0; j < 3; j++) {
|
for (j = 0; j < 3; j++) {
|
||||||
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);
|
||||||
return;
|
myPassedTr.Add (mytr);
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// sinon, depart vers la gauche.
|
// sinon, depart vers la gauche.
|
||||||
@ -270,15 +273,16 @@ void Poly_Connect::Next()
|
|||||||
if (!mysense) {
|
if (!mysense) {
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
if (t[i] != 0) {
|
if (t[i] != 0) {
|
||||||
myTriangulation->Triangle (t[i]).Get (n[0], n[1], n[2]);
|
myTriangulation->Triangle (t[i]).Get (n[0], n[1], n[2]);
|
||||||
for (j = 0; j < 3; j++) {
|
for (j = 0; j < 3; j++) {
|
||||||
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);
|
||||||
return;
|
myPassedTr.Add (mytr);
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
13
tests/bugs/fclasses/bug32601
Normal file
13
tests/bugs/fclasses/bug32601
Normal 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
|
Loading…
x
Reference in New Issue
Block a user