+ fixes #0002117: problems with rendering an arc - NAN

This commit is contained in:
wmayer 2015-09-15 12:53:22 +02:00
parent 2a569497b9
commit 7dc59751cc

View File

@ -240,13 +240,19 @@ public:
unsetCursor(); unsetCursor();
resetPositionText(); resetPositionText();
Gui::Command::openCommand("Add sketch line"); try {
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.addGeometry(Part.Line(App.Vector(%f,%f,0),App.Vector(%f,%f,0)),%s)", Gui::Command::openCommand("Add sketch line");
sketchgui->getObject()->getNameInDocument(), Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.addGeometry(Part.Line(App.Vector(%f,%f,0),App.Vector(%f,%f,0)),%s)",
EditCurve[0].fX,EditCurve[0].fY,EditCurve[1].fX,EditCurve[1].fY, sketchgui->getObject()->getNameInDocument(),
geometryCreationMode==Construction?"True":"False"); EditCurve[0].fX,EditCurve[0].fY,EditCurve[1].fX,EditCurve[1].fY,
geometryCreationMode==Construction?"True":"False");
Gui::Command::commitCommand(); Gui::Command::commitCommand();
}
catch (const Base::Exception& e) {
Base::Console().Error("Failed to add line: %s\n", e.what());
Gui::Command::abortCommand();
}
// add auto constraints for the line segment start // add auto constraints for the line segment start
if (sugConstr1.size() > 0) { if (sugConstr1.size() > 0) {
@ -444,42 +450,49 @@ public:
if (Mode==STATUS_End){ if (Mode==STATUS_End){
unsetCursor(); unsetCursor();
resetPositionText(); resetPositionText();
Gui::Command::openCommand("Add sketch box");
int firstCurve = getHighestCurveIndex() + 1; int firstCurve = getHighestCurveIndex() + 1;
Gui::Command::doCommand(Gui::Command::Doc,
"geoList = []\n"
"geoList.append(Part.Line(App.Vector(%f,%f,0),App.Vector(%f,%f,0)))\n"
"geoList.append(Part.Line(App.Vector(%f,%f,0),App.Vector(%f,%f,0)))\n"
"geoList.append(Part.Line(App.Vector(%f,%f,0),App.Vector(%f,%f,0)))\n"
"geoList.append(Part.Line(App.Vector(%f,%f,0),App.Vector(%f,%f,0)))\n"
"App.ActiveDocument.%s.addGeometry(geoList,%s)\n"
"conList = []\n"
"conList.append(Sketcher.Constraint('Coincident',%i,2,%i,1))\n"
"conList.append(Sketcher.Constraint('Coincident',%i,2,%i,1))\n"
"conList.append(Sketcher.Constraint('Coincident',%i,2,%i,1))\n"
"conList.append(Sketcher.Constraint('Coincident',%i,2,%i,1))\n"
"conList.append(Sketcher.Constraint('Horizontal',%i))\n"
"conList.append(Sketcher.Constraint('Horizontal',%i))\n"
"conList.append(Sketcher.Constraint('Vertical',%i))\n"
"conList.append(Sketcher.Constraint('Vertical',%i))\n"
"App.ActiveDocument.%s.addConstraint(conList)\n",
EditCurve[0].fX,EditCurve[0].fY,EditCurve[1].fX,EditCurve[1].fY, // line 1
EditCurve[1].fX,EditCurve[1].fY,EditCurve[2].fX,EditCurve[2].fY, // line 2
EditCurve[2].fX,EditCurve[2].fY,EditCurve[3].fX,EditCurve[3].fY, // line 3
EditCurve[3].fX,EditCurve[3].fY,EditCurve[0].fX,EditCurve[0].fY, // line 4
sketchgui->getObject()->getNameInDocument(), // the sketch
geometryCreationMode==Construction?"True":"False", // geometry as construction or not
firstCurve,firstCurve+1, // coincident1
firstCurve+1,firstCurve+2, // coincident2
firstCurve+2,firstCurve+3, // coincident3
firstCurve+3,firstCurve, // coincident4
firstCurve, // horizontal1
firstCurve+2, // horizontal2
firstCurve+1, // vertical1
firstCurve+3, // vertical2
sketchgui->getObject()->getNameInDocument()); // the sketch
Gui::Command::commitCommand(); try {
Gui::Command::openCommand("Add sketch box");
Gui::Command::doCommand(Gui::Command::Doc,
"geoList = []\n"
"geoList.append(Part.Line(App.Vector(%f,%f,0),App.Vector(%f,%f,0)))\n"
"geoList.append(Part.Line(App.Vector(%f,%f,0),App.Vector(%f,%f,0)))\n"
"geoList.append(Part.Line(App.Vector(%f,%f,0),App.Vector(%f,%f,0)))\n"
"geoList.append(Part.Line(App.Vector(%f,%f,0),App.Vector(%f,%f,0)))\n"
"App.ActiveDocument.%s.addGeometry(geoList,%s)\n"
"conList = []\n"
"conList.append(Sketcher.Constraint('Coincident',%i,2,%i,1))\n"
"conList.append(Sketcher.Constraint('Coincident',%i,2,%i,1))\n"
"conList.append(Sketcher.Constraint('Coincident',%i,2,%i,1))\n"
"conList.append(Sketcher.Constraint('Coincident',%i,2,%i,1))\n"
"conList.append(Sketcher.Constraint('Horizontal',%i))\n"
"conList.append(Sketcher.Constraint('Horizontal',%i))\n"
"conList.append(Sketcher.Constraint('Vertical',%i))\n"
"conList.append(Sketcher.Constraint('Vertical',%i))\n"
"App.ActiveDocument.%s.addConstraint(conList)\n",
EditCurve[0].fX,EditCurve[0].fY,EditCurve[1].fX,EditCurve[1].fY, // line 1
EditCurve[1].fX,EditCurve[1].fY,EditCurve[2].fX,EditCurve[2].fY, // line 2
EditCurve[2].fX,EditCurve[2].fY,EditCurve[3].fX,EditCurve[3].fY, // line 3
EditCurve[3].fX,EditCurve[3].fY,EditCurve[0].fX,EditCurve[0].fY, // line 4
sketchgui->getObject()->getNameInDocument(), // the sketch
geometryCreationMode==Construction?"True":"False", // geometry as construction or not
firstCurve,firstCurve+1, // coincident1
firstCurve+1,firstCurve+2, // coincident2
firstCurve+2,firstCurve+3, // coincident3
firstCurve+3,firstCurve, // coincident4
firstCurve, // horizontal1
firstCurve+2, // horizontal2
firstCurve+1, // vertical1
firstCurve+3, // vertical2
sketchgui->getObject()->getNameInDocument()); // the sketch
Gui::Command::commitCommand();
}
catch (const Base::Exception& e) {
Base::Console().Error("Failed to add box: %s\n", e.what());
Gui::Command::abortCommand();
}
// add auto constraints at the start of the first side // add auto constraints at the start of the first side
if (sugConstr1.size() > 0) { if (sugConstr1.size() > 0) {
@ -930,10 +943,10 @@ public:
if (Mode == STATUS_Do || Mode == STATUS_Close) { if (Mode == STATUS_Do || Mode == STATUS_Close) {
bool addedGeometry = true; bool addedGeometry = true;
if (SegmentMode == SEGMENT_MODE_Line) { if (SegmentMode == SEGMENT_MODE_Line) {
// open the transaction
Gui::Command::openCommand("Add line to sketch wire");
// issue the geometry // issue the geometry
try { try {
// open the transaction
Gui::Command::openCommand("Add line to sketch wire");
Gui::Command::doCommand(Gui::Command::Doc, Gui::Command::doCommand(Gui::Command::Doc,
"App.ActiveDocument.%s.addGeometry(Part.Line(App.Vector(%f,%f,0),App.Vector(%f,%f,0)),%s)", "App.ActiveDocument.%s.addGeometry(Part.Line(App.Vector(%f,%f,0),App.Vector(%f,%f,0)),%s)",
sketchgui->getObject()->getNameInDocument(), sketchgui->getObject()->getNameInDocument(),
@ -951,8 +964,9 @@ public:
Mode = STATUS_SEEK_Second; Mode = STATUS_SEEK_Second;
return true; return true;
} }
Gui::Command::openCommand("Add arc to sketch wire");
try { try {
Gui::Command::openCommand("Add arc to sketch wire");
Gui::Command::doCommand(Gui::Command::Doc, Gui::Command::doCommand(Gui::Command::Doc,
"App.ActiveDocument.%s.addGeometry(Part.ArcOfCircle" "App.ActiveDocument.%s.addGeometry(Part.ArcOfCircle"
"(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),%f,%f),%s)", "(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),%f,%f),%s)",
@ -967,6 +981,7 @@ public:
Gui::Command::abortCommand(); Gui::Command::abortCommand();
} }
} }
int lastCurve = getHighestCurveIndex(); int lastCurve = getHighestCurveIndex();
// issue the constraint // issue the constraint
if (addedGeometry && (previousPosId != Sketcher::none)) { if (addedGeometry && (previousPosId != Sketcher::none)) {
@ -1351,17 +1366,23 @@ public:
unsetCursor(); unsetCursor();
resetPositionText(); resetPositionText();
Gui::Command::openCommand("Add sketch arc"); try {
Gui::Command::doCommand(Gui::Command::Doc, Gui::Command::openCommand("Add sketch arc");
"App.ActiveDocument.%s.addGeometry(Part.ArcOfCircle" Gui::Command::doCommand(Gui::Command::Doc,
"(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),%f)," "App.ActiveDocument.%s.addGeometry(Part.ArcOfCircle"
"%f,%f),%s)", "(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),"
sketchgui->getObject()->getNameInDocument(), "%f,%f),%s)",
CenterPoint.fX, CenterPoint.fY, sqrt(rx*rx + ry*ry), sketchgui->getObject()->getNameInDocument(),
startAngle, endAngle, CenterPoint.fX, CenterPoint.fY, sqrt(rx*rx + ry*ry),
geometryCreationMode==Construction?"True":"False"); //arcAngle > 0 ? 0 : 1); startAngle, endAngle,
geometryCreationMode==Construction?"True":"False"); //arcAngle > 0 ? 0 : 1);
Gui::Command::commitCommand(); Gui::Command::commitCommand();
}
catch (const Base::Exception& e) {
Base::Console().Error("Failed to add arc: %s\n", e.what());
Gui::Command::abortCommand();
}
// Auto Constraint center point // Auto Constraint center point
if (sugConstr1.size() > 0) { if (sugConstr1.size() > 0) {
@ -1648,17 +1669,23 @@ public:
unsetCursor(); unsetCursor();
resetPositionText(); resetPositionText();
Gui::Command::openCommand("Add sketch arc"); try {
Gui::Command::doCommand(Gui::Command::Doc, Gui::Command::openCommand("Add sketch arc");
"App.ActiveDocument.%s.addGeometry(Part.ArcOfCircle" Gui::Command::doCommand(Gui::Command::Doc,
"(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),%f)," "App.ActiveDocument.%s.addGeometry(Part.ArcOfCircle"
"%f,%f),%s)", "(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),"
sketchgui->getObject()->getNameInDocument(), "%f,%f),%s)",
CenterPoint.fX, CenterPoint.fY, radius, sketchgui->getObject()->getNameInDocument(),
startAngle, endAngle, CenterPoint.fX, CenterPoint.fY, radius,
geometryCreationMode==Construction?"True":"False"); startAngle, endAngle,
geometryCreationMode==Construction?"True":"False");
Gui::Command::commitCommand(); Gui::Command::commitCommand();
}
catch (const Base::Exception& e) {
Base::Console().Error("Failed to add arc: %s\n", e.what());
Gui::Command::abortCommand();
}
// Auto Constraint first picked point // Auto Constraint first picked point
if (sugConstr1.size() > 0) { if (sugConstr1.size() > 0) {
@ -1955,16 +1982,22 @@ public:
unsetCursor(); unsetCursor();
resetPositionText(); resetPositionText();
Gui::Command::openCommand("Add sketch circle"); try {
Gui::Command::doCommand(Gui::Command::Doc, Gui::Command::openCommand("Add sketch circle");
"App.ActiveDocument.%s.addGeometry(Part.Circle" Gui::Command::doCommand(Gui::Command::Doc,
"(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),%s)", "App.ActiveDocument.%s.addGeometry(Part.Circle"
sketchgui->getObject()->getNameInDocument(), "(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),%s)",
EditCurve[0].fX, EditCurve[0].fY, sketchgui->getObject()->getNameInDocument(),
sqrt(rx*rx + ry*ry), EditCurve[0].fX, EditCurve[0].fY,
geometryCreationMode==Construction?"True":"False"); sqrt(rx*rx + ry*ry),
geometryCreationMode==Construction?"True":"False");
Gui::Command::commitCommand(); Gui::Command::commitCommand();
}
catch (const Base::Exception& e) {
Base::Console().Error("Failed to add circle: %s\n", e.what());
Gui::Command::abortCommand();
}
// add auto constraints for the center point // add auto constraints for the center point
if (sugConstr1.size() > 0) { if (sugConstr1.size() > 0) {
@ -2751,19 +2784,19 @@ private:
int currentgeoid = getHighestCurveIndex(); // index of the ellipse we just created int currentgeoid = getHighestCurveIndex(); // index of the ellipse we just created
Gui::Command::openCommand("Add sketch ellipse");
Gui::Command::doCommand(Gui::Command::Doc,
"App.ActiveDocument.%s.addGeometry(Part.Ellipse"
"(App.Vector(%f,%f,0),App.Vector(%f,%f,0),App.Vector(%f,%f,0)),%s)",
sketchgui->getObject()->getNameInDocument(),
periapsis.fX, periapsis.fY,
positiveB.fX, positiveB.fY,
centroid.fX, centroid.fY,
geometryCreationMode==Construction?"True":"False");
currentgeoid++;
try { try {
Gui::Command::openCommand("Add sketch ellipse");
Gui::Command::doCommand(Gui::Command::Doc,
"App.ActiveDocument.%s.addGeometry(Part.Ellipse"
"(App.Vector(%f,%f,0),App.Vector(%f,%f,0),App.Vector(%f,%f,0)),%s)",
sketchgui->getObject()->getNameInDocument(),
periapsis.fX, periapsis.fY,
positiveB.fX, positiveB.fY,
centroid.fX, centroid.fY,
geometryCreationMode==Construction?"True":"False");
currentgeoid++;
Gui::Command::doCommand(Gui::Command::Doc, Gui::Command::doCommand(Gui::Command::Doc,
"App.ActiveDocument.%s.ExposeInternalGeometry(%d)", "App.ActiveDocument.%s.ExposeInternalGeometry(%d)",
sketchgui->getObject()->getNameInDocument(), sketchgui->getObject()->getNameInDocument(),
@ -3168,22 +3201,22 @@ public:
int currentgeoid = getHighestCurveIndex(); int currentgeoid = getHighestCurveIndex();
Gui::Command::openCommand("Add sketch arc of ellipse");
Gui::Command::doCommand(Gui::Command::Doc,
"App.ActiveDocument.%s.addGeometry(Part.ArcOfEllipse"
"(Part.Ellipse(App.Vector(%f,%f,0),App.Vector(%f,%f,0),App.Vector(%f,%f,0)),"
"%f,%f),%s)",
sketchgui->getObject()->getNameInDocument(),
majAxisPoint.fX, majAxisPoint.fY,
minAxisPoint.fX, minAxisPoint.fY,
centerPoint.fX, centerPoint.fY,
startAngle, endAngle,
geometryCreationMode==Construction?"True":"False");
currentgeoid++;
try { try {
Gui::Command::openCommand("Add sketch arc of ellipse");
Gui::Command::doCommand(Gui::Command::Doc,
"App.ActiveDocument.%s.addGeometry(Part.ArcOfEllipse"
"(Part.Ellipse(App.Vector(%f,%f,0),App.Vector(%f,%f,0),App.Vector(%f,%f,0)),"
"%f,%f),%s)",
sketchgui->getObject()->getNameInDocument(),
majAxisPoint.fX, majAxisPoint.fY,
minAxisPoint.fX, minAxisPoint.fY,
centerPoint.fX, centerPoint.fY,
startAngle, endAngle,
geometryCreationMode==Construction?"True":"False");
currentgeoid++;
Gui::Command::doCommand(Gui::Command::Doc, Gui::Command::doCommand(Gui::Command::Doc,
"App.ActiveDocument.%s.ExposeInternalGeometry(%d)", "App.ActiveDocument.%s.ExposeInternalGeometry(%d)",
sketchgui->getObject()->getNameInDocument(), sketchgui->getObject()->getNameInDocument(),
@ -3563,16 +3596,23 @@ public:
if (Mode==STATUS_End) { if (Mode==STATUS_End) {
unsetCursor(); unsetCursor();
resetPositionText(); resetPositionText();
Gui::Command::openCommand("Add sketch circle");
Gui::Command::doCommand(Gui::Command::Doc,
"App.ActiveDocument.%s.addGeometry(Part.Circle"
"(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),%s)",
sketchgui->getObject()->getNameInDocument(),
CenterPoint.fX, CenterPoint.fY,
radius,
geometryCreationMode==Construction?"True":"False");
Gui::Command::commitCommand(); try {
Gui::Command::openCommand("Add sketch circle");
Gui::Command::doCommand(Gui::Command::Doc,
"App.ActiveDocument.%s.addGeometry(Part.Circle"
"(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),%s)",
sketchgui->getObject()->getNameInDocument(),
CenterPoint.fX, CenterPoint.fY,
radius,
geometryCreationMode==Construction?"True":"False");
Gui::Command::commitCommand();
}
catch (const Base::Exception& e) {
Base::Console().Error("Failed to add circle: %s\n", e.what());
Gui::Command::abortCommand();
}
// Auto Constraint first picked point // Auto Constraint first picked point
if (sugConstr1.size() > 0) { if (sugConstr1.size() > 0) {
@ -3827,12 +3867,18 @@ public:
unsetCursor(); unsetCursor();
resetPositionText(); resetPositionText();
Gui::Command::openCommand("Add sketch point"); try {
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.addGeometry(Part.Point(App.Vector(%f,%f,0)))", Gui::Command::openCommand("Add sketch point");
sketchgui->getObject()->getNameInDocument(), Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.addGeometry(Part.Point(App.Vector(%f,%f,0)))",
EditPoint.fX,EditPoint.fY); sketchgui->getObject()->getNameInDocument(),
EditPoint.fX,EditPoint.fY);
Gui::Command::commitCommand(); Gui::Command::commitCommand();
}
catch (const Base::Exception& e) {
Base::Console().Error("Failed to add point: %s\n", e.what());
Gui::Command::abortCommand();
}
// add auto constraints for the line segment start // add auto constraints for the line segment start
if (sugConstr.size() > 0) { if (sugConstr.size() > 0) {
@ -4106,19 +4152,25 @@ public:
int currentgeoid= getHighestCurveIndex(); int currentgeoid= getHighestCurveIndex();
// create fillet at point // create fillet at point
Gui::Command::openCommand("Create fillet"); try {
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.fillet(%d,%d,%f)", Gui::Command::openCommand("Create fillet");
sketchgui->getObject()->getNameInDocument(), Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.fillet(%d,%d,%f)",
GeoId, PosId, radius); sketchgui->getObject()->getNameInDocument(),
GeoId, PosId, radius);
if(construction) { if(construction) {
Gui::Command::doCommand(Gui::Command::Doc, Gui::Command::doCommand(Gui::Command::Doc,
"App.ActiveDocument.%s.toggleConstruction(%d) ", "App.ActiveDocument.%s.toggleConstruction(%d) ",
sketchgui->getObject()->getNameInDocument(), sketchgui->getObject()->getNameInDocument(),
currentgeoid+1); currentgeoid+1);
}
Gui::Command::commitCommand();
}
catch (const Base::Exception& e) {
Base::Console().Error("Failed to create fillet: %s\n", e.what());
Gui::Command::abortCommand();
} }
Gui::Command::commitCommand();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool autoRecompute = hGrp->GetBool("AutoRecompute",false); bool autoRecompute = hGrp->GetBool("AutoRecompute",false);
@ -4165,16 +4217,22 @@ public:
return false; return false;
construction=lineSeg1->Construction && lineSeg2->Construction; construction=lineSeg1->Construction && lineSeg2->Construction;
int currentgeoid= getHighestCurveIndex();
// create fillet between lines // create fillet between lines
Gui::Command::openCommand("Create fillet"); try {
int currentgeoid= getHighestCurveIndex(); Gui::Command::openCommand("Create fillet");
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.fillet(%d,%d,App.Vector(%f,%f,0),App.Vector(%f,%f,0),%f)", Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.fillet(%d,%d,App.Vector(%f,%f,0),App.Vector(%f,%f,0),%f)",
sketchgui->getObject()->getNameInDocument(), sketchgui->getObject()->getNameInDocument(),
firstCurve, secondCurve, firstCurve, secondCurve,
firstPos.fX, firstPos.fY, firstPos.fX, firstPos.fY,
secondPos.fX, secondPos.fY, radius); secondPos.fX, secondPos.fY, radius);
Gui::Command::commitCommand(); Gui::Command::commitCommand();
}
catch (const Base::Exception& e) {
Base::Console().Error("Failed to create fillet: %s\n", e.what());
Gui::Command::abortCommand();
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool autoRecompute = hGrp->GetBool("AutoRecompute",false); bool autoRecompute = hGrp->GetBool("AutoRecompute",false);
@ -4360,7 +4418,8 @@ public:
Gui::Command::updateActive(); Gui::Command::updateActive();
} }
catch (const Base::Exception& e) { catch (const Base::Exception& e) {
Base::Console().Error("%s\n", e.what()); Base::Console().Error("Failed to trim edge: %s\n", e.what());
Gui::Command::abortCommand();
} }
} }
} }
@ -4553,7 +4612,8 @@ public:
* right button of the mouse */ * right button of the mouse */
} }
catch (const Base::Exception& e) { catch (const Base::Exception& e) {
Base::Console().Error("%s\n", e.what()); Base::Console().Error("Failed to add external geometry: %s\n", e.what());
Gui::Command::abortCommand();
} }
return true; return true;
} }
@ -4714,7 +4774,7 @@ public:
if (Mode==STATUS_End){ if (Mode==STATUS_End){
unsetCursor(); unsetCursor();
resetPositionText(); resetPositionText();
Gui::Command::openCommand("Add slot");
int firstCurve = getHighestCurveIndex() + 1; int firstCurve = getHighestCurveIndex() + 1;
// add the geometry to the sketch // add the geometry to the sketch
double start, end; double start, end;
@ -4732,6 +4792,7 @@ public:
} }
try { try {
Gui::Command::openCommand("Add slot");
Gui::Command::doCommand(Gui::Command::Doc, Gui::Command::doCommand(Gui::Command::Doc,
"geoList = []\n" "geoList = []\n"
"geoList.append(Part.ArcOfCircle(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),%f,%f))\n" "geoList.append(Part.ArcOfCircle(Part.Circle(App.Vector(%f,%f,0),App.Vector(0,0,1),%f),%f,%f))\n"
@ -4788,7 +4849,7 @@ public:
static_cast<Sketcher::SketchObject *>(sketchgui->getObject())->solve(); static_cast<Sketcher::SketchObject *>(sketchgui->getObject())->solve();
} }
catch (const Base::Exception& e) { catch (const Base::Exception& e) {
Base::Console().Error("%s\n", e.what()); Base::Console().Error("Failed to add slot: %s\n", e.what());
Gui::Command::abortCommand(); Gui::Command::abortCommand();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");
bool autoRecompute = hGrp->GetBool("AutoRecompute",false); bool autoRecompute = hGrp->GetBool("AutoRecompute",false);
@ -5022,7 +5083,7 @@ public:
static_cast<Sketcher::SketchObject *>(sketchgui->getObject())->solve(); static_cast<Sketcher::SketchObject *>(sketchgui->getObject())->solve();
} }
catch (const Base::Exception& e) { catch (const Base::Exception& e) {
Base::Console().Error("%s\n", e.what()); Base::Console().Error("Failed to add hexagon: %s\n", e.what());
Gui::Command::abortCommand(); Gui::Command::abortCommand();
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher"); ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Sketcher");