From 8685e94b76eab36190db83c118fe89a34d172148 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sun, 24 May 2015 12:47:22 +0200 Subject: [PATCH] Bug fix: Sketcher fillet on construction lines ============================================== The fillet applied to construction lines generates normal (not construction) geometry. How to replicate? 1.Make a square and make all lines construction lines. 2.Apply fillet tool, there result will be a white line fillet connecting two blue constructions lines. --- src/Mod/Sketcher/Gui/CommandCreateGeo.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp index a2892e9bc..9d6b88601 100644 --- a/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp +++ b/src/Mod/Sketcher/Gui/CommandCreateGeo.cpp @@ -3976,6 +3976,7 @@ public: int VtId = sketchgui->getPreselectPoint(); if (Mode == STATUS_SEEK_First && VtId != -1) { int GeoId; + bool construction=false; Sketcher::PointPos PosId=Sketcher::none; sketchgui->getSketchObject()->getGeoVertexIndex(VtId,GeoId,PosId); const Part::Geometry *geom = sketchgui->getSketchObject()->getGeometry(GeoId); @@ -3990,6 +3991,7 @@ public: if (GeoIdList.size() == 2 && GeoIdList[0] >= 0 && GeoIdList[1] >= 0) { const Part::Geometry *geom1 = sketchgui->getSketchObject()->getGeometry(GeoIdList[0]); const Part::Geometry *geom2 = sketchgui->getSketchObject()->getGeometry(GeoIdList[1]); + construction=geom1->Construction && geom2->Construction; if (geom1->getTypeId() == Part::GeomLineSegment::getClassTypeId() && geom2->getTypeId() == Part::GeomLineSegment::getClassTypeId()) { const Part::GeomLineSegment *lineSeg1 = dynamic_cast(geom1); @@ -4009,11 +4011,20 @@ public: if (radius < 0) return false; + int currentgeoid= getHighestCurveIndex(); // create fillet at point Gui::Command::openCommand("Create fillet"); Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.fillet(%d,%d,%f)", sketchgui->getObject()->getNameInDocument(), GeoId, PosId, radius); + + if(construction) { + Gui::Command::doCommand(Gui::Command::Doc, + "App.ActiveDocument.%s.toggleConstruction(%d) ", + sketchgui->getObject()->getNameInDocument(), + currentgeoid+1); + } + Gui::Command::commitCommand(); Gui::Command::updateActive(); } @@ -4055,6 +4066,7 @@ public: // create fillet between lines Gui::Command::openCommand("Create fillet"); + int currentgeoid= getHighestCurveIndex(); 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(), firstCurve, secondCurve, @@ -4062,6 +4074,14 @@ public: secondPos.fX, secondPos.fY, radius); Gui::Command::commitCommand(); Gui::Command::updateActive(); + + if(lineSeg1->Construction && lineSeg2->Construction) { + Gui::Command::doCommand(Gui::Command::Doc, + "App.ActiveDocument.%s.toggleConstruction(%d) ", + sketchgui->getObject()->getNameInDocument(), + currentgeoid+1); + } + Gui::Selection().clearSelection(); Mode = STATUS_SEEK_First;