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)
{
#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));