From 6d81f31f11edadc96bede6327d5003ea024df9fa Mon Sep 17 00:00:00 2001 From: sliptonic Date: Fri, 1 Jul 2022 16:48:21 -0500 Subject: [PATCH] Additional changes to support G73 --- src/Mod/Path/App/PathSegmentWalker.cpp | 2 +- src/Mod/Path/GCode-description.md | 55 ++++++++++---------- src/Mod/Path/PathScripts/PathArray.py | 2 +- src/Mod/Path/PathScripts/PathGeom.py | 2 +- src/Mod/Path/PathScripts/PathSimulatorGui.py | 4 +- 5 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/Mod/Path/App/PathSegmentWalker.cpp b/src/Mod/Path/App/PathSegmentWalker.cpp index 32dd2e729d..5928033eaa 100644 --- a/src/Mod/Path/App/PathSegmentWalker.cpp +++ b/src/Mod/Path/App/PathSegmentWalker.cpp @@ -275,7 +275,7 @@ void PathSegmentWalker::walk(PathSegmentVisitor &cb, const Base::Vector3d &start // relative mode absolutecenter = false; - } else if ((name=="G81")||(name=="G82")||(name=="G83")||(name=="G84")||(name=="G85")||(name=="G86")||(name=="G89")){ + } else if ((name=="G73")||(name=="G81")||(name=="G82")||(name=="G83")||(name=="G84")||(name=="G85")||(name=="G86")||(name=="G89")){ // drill,tap,bore double r = 0; if (cmd.has("R")) diff --git a/src/Mod/Path/GCode-description.md b/src/Mod/Path/GCode-description.md index 800953c267..62492caa66 100644 --- a/src/Mod/Path/GCode-description.md +++ b/src/Mod/Path/GCode-description.md @@ -2,30 +2,31 @@ This is a documentation of all GCodes used by the FreeCAD Path Workbench -| Command | Description | Supported parameters | -| --- | --- | --- | -| G0, G00 | Rapid move | X,Y,Z,A,B,C | -| G1, G01 | Normal interpolated move | X,Y,Z,A,B,C | -| G2, G02 | Clockwise arc | X,Y,Z,A,B,C,I,J,K | -| G3, G03 | Counterclockwise arc | X,Y,Z,A,B,C,I,J,K | -| G40 | Turn off tool radius compensation | Radius compensation is done in FreeCAD | -| G41 | Tool radius compensation value | Radius compensation is done in FreeCAD | -| G42 | Tool radius compensation value | Radius compensation is done in FreeCAD | -| G43 | Tool length offset | | -| G44 | Tool length offset | | -| G53 | Machine coordinate system fixture | ??? | -| G54 | Scratchpad coordinate system fixture | ??? | -| G55 - G59.9 | Machine specific work offset fixtures relative to homing switches | ??? | -| G81 | Machine specific drill operation | X,Y,Z,R,Q | -| G82 | Machine specific drill operation | X,Y,Z,R,Q | -| G83 | Machine specific drill operation | X,Y,Z,R,Q | -| G90 | Absolute coordinates | | -| G91 | Relative coordinates | | -| G98 | Return to initial Z level in canned cycle | | -| G99 | Return to R level in canned cycle | | -| M0, M00 | Compulsory stop | | -| M1, M01 | Optional stop | | -| M3, M03 | Spindle on (clockwise rotation) | S\ | -| M4, M04 | Spindle on (counterclockwise rotation) | S\ | -| M6, M06 | Tool change | T\ | -| (\) | comment | | +| Command | Description | Supported parameters | +| --- | --- | --- | +| G0, G00 | Rapid move | X,Y,Z,A,B,C | +| G1, G01 | Normal interpolated move | X,Y,Z,A,B,C | +| G2, G02 | Clockwise arc | X,Y,Z,A,B,C,I,J,K | +| G3, G03 | Counterclockwise arc | X,Y,Z,A,B,C,I,J,K | +| G40 | Turn off tool radius compensation | Radius compensation is done in FreeCAD | +| G41 | Tool radius compensation value | Radius compensation is done in FreeCAD | +| G42 | Tool radius compensation value | Radius compensation is done in FreeCAD | +| G43 | Tool length offset | | +| G44 | Tool length offset | | +| G53 | Machine coordinate system fixture | ??? | +| G54 | Scratchpad coordinate system fixture | ??? | +| G55 - G59.9 | Machine specific work offset fixtures relative to homing switches | ??? | +| G73 | Machine specific drill operation | X,Y,Z,R,Q | +| G81 | Machine specific drill operation | X,Y,Z,R,Q | +| G82 | Machine specific drill operation | X,Y,Z,R,Q | +| G83 | Machine specific drill operation | X,Y,Z,R,Q | +| G90 | Absolute coordinates | | +| G91 | Relative coordinates | | +| G98 | Return to initial Z level in canned cycle | | +| G99 | Return to R level in canned cycle | | +| M0, M00 | Compulsory stop | | +| M1, M01 | Optional stop | | +| M3, M03 | Spindle on (clockwise rotation) | S\ | +| M4, M04 | Spindle on (counterclockwise rotation) | S\ | +| M6, M06 | Tool change | T\ | +| (\) | comment | | diff --git a/src/Mod/Path/PathScripts/PathArray.py b/src/Mod/Path/PathScripts/PathArray.py index 1088763ddf..295a34f72b 100644 --- a/src/Mod/Path/PathScripts/PathArray.py +++ b/src/Mod/Path/PathScripts/PathArray.py @@ -295,7 +295,7 @@ class PathArray: CmdMoveStraight = ["G1", "G01"] CmdMoveCW = ["G2", "G02"] CmdMoveCCW = ["G3", "G03"] - CmdDrill = ["G81", "G82", "G83"] + CmdDrill = ["G73", "G81", "G82", "G83"] CmdMoveArc = CmdMoveCW + CmdMoveCCW CmdMove = CmdMoveStraight + CmdMoveArc diff --git a/src/Mod/Path/PathScripts/PathGeom.py b/src/Mod/Path/PathScripts/PathGeom.py index 2d9ea687c3..1486c73496 100644 --- a/src/Mod/Path/PathScripts/PathGeom.py +++ b/src/Mod/Path/PathScripts/PathGeom.py @@ -87,7 +87,7 @@ CmdMoveRapid = ["G0", "G00"] CmdMoveStraight = ["G1", "G01"] CmdMoveCW = ["G2", "G02"] CmdMoveCCW = ["G3", "G03"] -CmdMoveDrill = ["G81", "G82", "G83"] +CmdMoveDrill = ["G73", "G81", "G82", "G83"] CmdMoveArc = CmdMoveCW + CmdMoveCCW CmdMove = CmdMoveStraight + CmdMoveArc + CmdMoveDrill CmdMoveAll = CmdMove + CmdMoveRapid diff --git a/src/Mod/Path/PathScripts/PathSimulatorGui.py b/src/Mod/Path/PathScripts/PathSimulatorGui.py index f2cdb36c82..ba712b6092 100644 --- a/src/Mod/Path/PathScripts/PathSimulatorGui.py +++ b/src/Mod/Path/PathScripts/PathSimulatorGui.py @@ -290,7 +290,7 @@ class PathSimulation: if cmd.Name in ["G80"]: self.firstDrill = True - if cmd.Name in ["G81", "G82", "G83"]: + if cmd.Name in ["G73", "G81", "G82", "G83"]: if self.firstDrill: extendcommand = Path.Command("G0", {"Z": cmd.r}) self.curpos = self.RapidMove(extendcommand, self.curpos) @@ -372,7 +372,7 @@ class PathSimulation: ) = self.voxSim.GetResultMesh() if cmd.Name in ["G80"]: self.firstDrill = True - if cmd.Name in ["G81", "G82", "G83"]: + if cmd.Name in ["G73", "G81", "G82", "G83"]: extendcommands = [] if self.firstDrill: extendcommands.append(Path.Command("G0", {"Z": cmd.r}))