mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0031144: Shape Healing - ShapeAnalysis::OuterWire() infinite loop on solid obtained from IFC
Implementation of ShapeAnalysis::OuterWire() is revised to avoid infinite cycle if face contains internal vertex.
This commit is contained in:
@@ -241,9 +241,10 @@ Standard_Boolean ShapeAnalysis::IsOuterBound(const TopoDS_Face& face)
|
|||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : OuterBound
|
//function : OuterBound
|
||||||
//purpose : replacement of bad BRepTools::OuterBound()
|
//purpose : replacement of bad BRepTools::OuterBound(), to be merged
|
||||||
|
// - skips internal vertices in face, if any, without exception
|
||||||
|
// - returns positively oriented wire rather than greater one
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//:n3
|
|
||||||
|
|
||||||
TopoDS_Wire ShapeAnalysis::OuterWire(const TopoDS_Face& face)
|
TopoDS_Wire ShapeAnalysis::OuterWire(const TopoDS_Face& face)
|
||||||
{
|
{
|
||||||
@@ -251,21 +252,26 @@ TopoDS_Wire ShapeAnalysis::OuterWire(const TopoDS_Face& face)
|
|||||||
F.Orientation(TopAbs_FORWARD);
|
F.Orientation(TopAbs_FORWARD);
|
||||||
|
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
TopoDS_Wire W;
|
TopoDS_Iterator anIt (F, Standard_False);
|
||||||
TopoDS_Iterator exp (F, Standard_False);
|
while (anIt.More())
|
||||||
while ( exp.More() ) {
|
{
|
||||||
if(exp.Value().ShapeType() != TopAbs_WIRE)
|
TopoDS_Shape aWire = anIt.Value();
|
||||||
|
anIt.Next();
|
||||||
|
|
||||||
|
// skip possible internal vertices in face
|
||||||
|
if (aWire.ShapeType() != TopAbs_WIRE)
|
||||||
continue;
|
continue;
|
||||||
W = TopoDS::Wire ( exp.Value() );
|
|
||||||
exp.Next();
|
// if current wire is the last one, return it without analysis
|
||||||
if ( ! exp.More() ) return W;
|
if (! anIt.More())
|
||||||
//szv#4:S4163:12Mar99 SGI warns
|
return TopoDS::Wire (aWire);
|
||||||
TopoDS_Shape sh = F.EmptyCopied();
|
|
||||||
TopoDS_Face fc = TopoDS::Face( sh );
|
TopoDS_Shape aTestFace = F.EmptyCopied();
|
||||||
B.Add ( fc, W );
|
B.Add (aTestFace, aWire);
|
||||||
if ( ShapeAnalysis::IsOuterBound ( fc ) ) return W;
|
if (ShapeAnalysis::IsOuterBound (TopoDS::Face (aTestFace)))
|
||||||
|
return TopoDS::Wire (aWire);
|
||||||
}
|
}
|
||||||
return W;
|
return TopoDS_Wire();
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
17
tests/bugs/mesh/bug31144
Normal file
17
tests/bugs/mesh/bug31144
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
puts "======="
|
||||||
|
puts "0031144: Shape Healing - ShapeAnalysis::OuterWire() infinite loop on solid obtained from IFC"
|
||||||
|
puts "======="
|
||||||
|
puts ""
|
||||||
|
puts "REQUIRED ALL: Meshing statuses: Failure"
|
||||||
|
|
||||||
|
cpulimit 10
|
||||||
|
|
||||||
|
restore [locate_data_file bug31144.brep] a
|
||||||
|
|
||||||
|
checkshape a
|
||||||
|
tolerance a
|
||||||
|
|
||||||
|
puts "Note: incmesh is called because this is the only known way to call problematic method"
|
||||||
|
incmesh a 1.
|
||||||
|
|
||||||
|
trinfo a
|
Reference in New Issue
Block a user