Skip to content

Commit

Permalink
Bug fix: Sketcher fillet on construction lines
Browse files Browse the repository at this point in the history
==============================================

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.
  • Loading branch information
abdullahtahiriyo authored and wwmayer committed May 30, 2015
1 parent 75fa129 commit 8685e94
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Mod/Sketcher/Gui/CommandCreateGeo.cpp
Expand Up @@ -3976,6 +3976,7 @@ class DrawSketchHandlerFillet: public DrawSketchHandler
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);
Expand All @@ -3990,6 +3991,7 @@ class DrawSketchHandlerFillet: public DrawSketchHandler
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<const Part::GeomLineSegment *>(geom1);
Expand All @@ -4009,11 +4011,20 @@ class DrawSketchHandlerFillet: public DrawSketchHandler
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();
}
Expand Down Expand Up @@ -4055,13 +4066,22 @@ class DrawSketchHandlerFillet: public DrawSketchHandler

// 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,
firstPos.fX, firstPos.fY,
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;
Expand Down

0 comments on commit 8685e94

Please sign in to comment.