- std::shared_ptr<GeomAPI_Pnt> anAnchor = aCircle.project(aFlyoutPnt);
- std::shared_ptr<GeomAPI_XYZ> anAnchorXYZ = anAnchor->xyz();
- anAnchorXYZ = anAnchorXYZ->decreased(aCenter->xyz());
- std::shared_ptr<GeomAPI_Dir> aDeltaDir(new GeomAPI_Dir(anAnchorXYZ));
- const double aDelta = 1e-3;
- anAnchor->setX(anAnchor->x() + aDelta * aDeltaDir->x());
- anAnchor->setY(anAnchor->y() + aDelta * aDeltaDir->y());
- anAnchor->setZ(anAnchor->z() + aDelta * aDeltaDir->z());
-
- SetMeasuredGeometry(aCircle.impl<gp_Circ>(), anAnchor->impl<gp_Pnt>());
+ std::shared_ptr<GeomAPI_Pnt> anAnchor = SketcherPrs_Tools::getAnchorPoint(myConstraint, myPlane);
+
+ gp_Circ aCirc = aCircle.impl<gp_Circ>();
+ gp_Pnt anAncorPnt = anAnchor->impl<gp_Pnt>();
+ // anchor point should not coincide to the location point of the circle
+ // OCCT does not process this case.
+ if (anAncorPnt.Distance(aCirc.Location()) < 1e-7)
+ return;
+ SetMeasuredGeometry(aCirc, anAncorPnt);