Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_MacroArc.cpp
index 8016c335395c701a1275e50b496c62415f0f5267..8860e4f32557268da3b093e2cb78be6898d70400 100644 (file)
@@ -436,14 +436,11 @@ std::string SketchPlugin_MacroArc::processEvent(const std::shared_ptr<Events_Mes
               aRefAttr->setAttr(anAttribute);
             }
             else if (anObject.get()) {
-              // if presentation of previous reentrant macro arc is used, the object is invalid,
-              // we should use result of previous feature of the message(Arc)
-              if (!anObject->data()->isValid()) {
-                FeaturePtr aCreatedFeature = aReentrantMessage->createdFeature();
-                if (aCreatedFeature.get())
-                  anObject = aCreatedFeature->lastResult();
-              }
-              aRefAttr->setObject(anObject);
+              // if attribute is NULL, only object is defined, it should be processed outside
+              // the feature because it might be an external feature, that will be
+              // removed/created again after restart operation
+              // #2468 - Crash when sketching circles successively on a repetition
+              aFilledAttributeName = ARC_TYPE();
             }
           }
         }
@@ -494,6 +491,9 @@ void SketchPlugin_MacroArc::fillByCenterAndTwoPassed()
     return;
 
   GeomAPI_Circ2d aCircleForArc(myCenter, myStart);
+  // avoid degerated arc, when the center and the start points are equal
+  if (!aCircleForArc.implPtr<void*>())
+    return;
 
   bool aWasBlocked = data()->blockSendAttributeUpdated(true);
   // check the end point is referred to another feature