diff --git a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp index f662794763..404b9af2d2 100644 --- a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +++ b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp @@ -2290,10 +2290,20 @@ public: startAngle += M_PI/2; } - //startAngle=-M_PI/4; - //endAngle=M_PI/4; - + //calculate focus point vecF2 + double cf;//distance from center to focus + cf = sqrt( abs(a*a - b*b) );//using abs, avoided using different formula for a>b/a 0 ? 0 : 1); + startAngle, endAngle); + int iAOE = getHighestCurveIndex();//index of the arc of ellipse we just created + + Gui::Command::doCommand(Gui::Command::Doc, + "App.ActiveDocument.%s.addGeometry(Part.Point(App.Vector(%f,%f,0)))", + sketchgui->getObject()->getNameInDocument(), + vecF2.fX,vecF2.fY); + int iPointF2 = getHighestCurveIndex();//index of the point we just created + + Gui::Command::doCommand(Gui::Command::Doc, + "App.ActiveDocument.%s.addConstraint(Sketcher.Constraint('InternalAlignment:EllipseFocus2',%d,%d,%d)) ", + sketchgui->getObject()->getNameInDocument(), + iPointF2,Sketcher::start,iAOE); + + Gui::Command::commitCommand(); Gui::Command::updateActive();