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

Compare commits

..

1 Commits

Author SHA1 Message Date
drazmyslovich
828a75f228 0030873: Make ReShape tool resistant to replacement loops 2019-08-07 13:25:15 +02:00
2 changed files with 9 additions and 5 deletions

View File

@@ -156,6 +156,13 @@ void BRepTools_ReShape::replace (const TopoDS_Shape& ashape,
TopoDS_Shape shape = ashape;
TopoDS_Shape newshape = anewshape;
if ( shape.IsNull() || shape == newshape ) return;
if (Apply (newshape) == shape)
{
#ifdef OCCT_DEBUG
cout << "Warning: BRepTools_ReShape::Replace: recording the shape will lead to a loop" << endl;
#endif
return;
}
if (shape.Orientation() == TopAbs_REVERSED)
{
@@ -181,7 +188,9 @@ void BRepTools_ReShape::replace (const TopoDS_Shape& ashape,
#ifdef OCCT_DEBUG
if ( IsRecorded ( shape ) && ((myConsiderLocation && ! Value ( shape ).IsPartner ( newshape )) ||
(!myConsiderLocation && ! Value ( shape ).IsSame ( newshape ))))
{
cout << "Warning: BRepTools_ReShape::Replace: shape already recorded" << endl;
}
#endif
myShapeToReplacement.Bind(shape, TReplacement(newshape, theKind));

View File

@@ -1707,11 +1707,6 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam()
else if ( wire.IsSame ( w2 ) ) wire = w21;
else
{
Handle(ShapeAnalysis_Wire) anAnalyzer = new ShapeAnalysis_Wire(wire, myFace, Precision());
//To avoid addition of holes with null area (OCCT issue 0030250)
if (anAnalyzer->CheckSmallArea(wire))
continue;
// other wires (not boundary) are considered as holes; make sure to have them oriented accordingly
TopoDS_Shape curface = tmpF.EmptyCopied();
B.Add(curface,wire);