mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-09 18:50:54 +03:00
0024083: BRepCheck_Wire crashes processing a wire consisting of many edges
A check on 0 is added. A recursive method Propagate() is replaced by a non-recursive implementation. Adding test case for issue CR24083
This commit is contained in:
parent
6f005d2afc
commit
22774b6295
@ -1529,40 +1529,51 @@ Standard_Boolean BRepCheck_Wire::GeometricControls() const
|
|||||||
return myGctrl;
|
return myGctrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Propagate
|
//function : Propagate
|
||||||
//purpose : fill <mapE> with edges connected to <edg> through vertices
|
//purpose : fill <mapE> with edges connected to <edg> through vertices
|
||||||
// contained in <mapVE>
|
// contained in <mapVE>
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
static void Propagate(const TopTools_IndexedDataMapOfShapeListOfShape& mapVE,
|
static void Propagate(const TopTools_IndexedDataMapOfShapeListOfShape& mapVE,
|
||||||
const TopoDS_Shape& edg,
|
const TopoDS_Shape& edg,
|
||||||
TopTools_MapOfShape& mapE)
|
TopTools_MapOfShape& mapE)
|
||||||
{
|
{
|
||||||
if (mapE.Contains(edg)) {
|
TopTools_ListOfShape currentEdges;
|
||||||
return;
|
currentEdges.Append(edg);
|
||||||
}
|
|
||||||
mapE.Add(edg); // attention, if oriented == Standard_True, edge should
|
do
|
||||||
// be FORWARD or REVERSED. It is not checked.
|
{
|
||||||
// =============
|
TopTools_ListOfShape nextEdges;
|
||||||
// attention, if oriented == Standard_True, <edg> must
|
TopTools_ListIteratorOfListOfShape itrc(currentEdges);
|
||||||
// be FORWARD or REVERSED. That is not checked.
|
for (; itrc.More(); itrc.Next())
|
||||||
|
{
|
||||||
TopExp_Explorer ex;
|
const TopoDS_Shape& Edge = itrc.Value();
|
||||||
for (ex.Init(edg,TopAbs_VERTEX); ex.More(); ex.Next()) {
|
mapE.Add(Edge);
|
||||||
const TopoDS_Vertex& vtx = TopoDS::Vertex(ex.Current());
|
|
||||||
// debug on vertex
|
TopExp_Explorer ex(Edge, TopAbs_VERTEX);
|
||||||
Standard_Integer indv = mapVE.FindIndex(vtx);
|
for (; ex.More(); ex.Next())
|
||||||
if (indv != 0) {
|
{
|
||||||
for (TopTools_ListIteratorOfListOfShape itl(mapVE(indv)); itl.More(); itl.Next()) {
|
const TopoDS_Vertex& vtx = TopoDS::Vertex(ex.Current());
|
||||||
if (!itl.Value().IsSame(edg) &&
|
Standard_Integer indv = mapVE.FindIndex(vtx);
|
||||||
!mapE.Contains(itl.Value())) {
|
if (indv != 0)
|
||||||
Propagate(mapVE,itl.Value(),mapE);
|
{
|
||||||
}
|
const TopTools_ListOfShape& edges = mapVE(indv);
|
||||||
|
|
||||||
|
TopTools_ListIteratorOfListOfShape itl(edges);
|
||||||
|
for (; itl.More(); itl.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Shape& E = itl.Value();
|
||||||
|
if (!Edge.IsSame(E) && !mapE.Contains(E))
|
||||||
|
nextEdges.Append(E);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
currentEdges = nextEdges;
|
||||||
}
|
}
|
||||||
|
while (!currentEdges.IsEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : GetOrientation
|
//function : GetOrientation
|
||||||
//purpose :
|
//purpose :
|
||||||
|
13
tests/bugs/modalg_5/bug24083
Executable file
13
tests/bugs/modalg_5/bug24083
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
puts "================"
|
||||||
|
puts "CR24083"
|
||||||
|
puts "================"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# BRepCheck_Wire crashes processing a wire consisting of many edges
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug24083_polyline.brep] result
|
||||||
|
|
||||||
|
set length 141421
|
||||||
|
|
||||||
|
set 2dviewer 1
|
Loading…
x
Reference in New Issue
Block a user