Merge pull request #21530 from jffmichi/sort_all_drilling

CAM: sort locations for all drilling operations
This commit is contained in:
sliptonic
2025-05-28 13:55:20 -05:00
committed by GitHub
4 changed files with 3 additions and 8 deletions

View File

@@ -24,7 +24,8 @@ from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD
import Path
import Path.Op.Base as PathOp
import Path.Base.Drillable as Drillable
from Path.Base import Drillable
from PathScripts import PathUtils
# lazily loaded modules
from lazy_loader.lazy_loader import LazyLoader
@@ -187,6 +188,7 @@ class ObjectOp(PathOp.ObjectOp):
holes.append({"x": location.x, "y": location.y, "r": 0})
if len(holes) > 0:
holes = PathUtils.sort_locations(holes, ["x", "y"])
self.circularHoleExecute(obj, holes)
def circularHoleExecute(self, obj, holes):

View File

@@ -250,8 +250,6 @@ class ObjectDrilling(PathCircularHoleBase.ObjectOp):
obj.RetractMode = "G98"
self.commandlist.append(Path.Command(obj.RetractMode))
holes = PathUtils.sort_locations(holes, ["x", "y"])
# This section is technical debt. The computation of the
# target shapes should be factored out for reuse.
# This will likely mean refactoring upstream CircularHoleBase to pass

View File

@@ -22,7 +22,6 @@
import Path.Base.Generator.helix as helix
from PathScripts.PathUtils import fmt
from PathScripts.PathUtils import sort_locations
from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD
import Part
@@ -242,8 +241,6 @@ class ObjectHelix(PathCircularHoleBase.ObjectOp):
self.commandlist.append(Path.Command("G0", {"Z": obj.ClearanceHeight.Value}))
holes = sort_locations(holes, ["x", "y"])
tool = obj.ToolController.Tool
tooldiamter = tool.Diameter.Value if hasattr(tool.Diameter, "Value") else tool.Diameter

View File

@@ -177,8 +177,6 @@ class ObjectTapping(PathCircularHoleBase.ObjectOp):
# http://linuxcnc.org/docs/html/gcode/g-code.html#gcode:g98-g99
self.commandlist.append(Path.Command(obj.ReturnLevel))
holes = PathUtils.sort_locations(holes, ["x", "y"])
# This section is technical debt. The computation of the
# target shapes should be factored out for reuse.
# This will likely mean refactoring upstream CircularHoleBase to pass