From eb0d7ba6a50886182ca7ed5b3cef2b30ef056545 Mon Sep 17 00:00:00 2001 From: tarman3 Date: Thu, 26 Feb 2026 13:48:34 +0200 Subject: [PATCH] CAM: CircularHoleBase.holeDiameter() - Remove useless obj --- src/Mod/CAM/CAMTests/TestPathHelix.py | 14 ++++---------- src/Mod/CAM/Path/Op/CircularHoleBase.py | 6 +++--- src/Mod/CAM/Path/Op/Gui/CircularHoleBase.py | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/Mod/CAM/CAMTests/TestPathHelix.py b/src/Mod/CAM/CAMTests/TestPathHelix.py index fc050e60a8..83026d23a8 100644 --- a/src/Mod/CAM/CAMTests/TestPathHelix.py +++ b/src/Mod/CAM/CAMTests/TestPathHelix.py @@ -72,7 +72,7 @@ class TestPathHelix(PathTestUtils.PathTestBase): model = base[0] for sub in base[1]: pos = proxy.holePosition(model, sub) - self.assertRoughly(round(pos.Length / 10, 0), proxy.holeDiameter(op, model, sub)) + self.assertRoughly(round(pos.Length / 10, 0), proxy.holeDiameter(model, sub)) def test02(self): """Verify Helix generates proper holes for rotated model""" @@ -88,9 +88,7 @@ class TestPathHelix(PathTestUtils.PathTestBase): for sub in base[1]: pos = proxy.holePosition(model, sub) # Path.Log.track(deg, pos, pos.Length) - self.assertRoughly( - round(pos.Length / 10, 0), proxy.holeDiameter(op, model, sub) - ) + self.assertRoughly(round(pos.Length / 10, 0), proxy.holeDiameter(model, sub)) def test03(self): """Verify Helix generates proper holes for rotated base model""" @@ -112,9 +110,7 @@ class TestPathHelix(PathTestUtils.PathTestBase): for sub in base[1]: pos = proxy.holePosition(model, sub) # Path.Log.track(deg, pos, pos.Length) - self.assertRoughly( - round(pos.Length / 10, 0), proxy.holeDiameter(op, model, sub) - ) + self.assertRoughly(round(pos.Length / 10, 0), proxy.holeDiameter(model, sub)) def test04(self): """Verify Helix generates proper holes for rotated clone base model""" @@ -136,9 +132,7 @@ class TestPathHelix(PathTestUtils.PathTestBase): for sub in base[1]: pos = proxy.holePosition(model, sub) # Path.Log.track(deg, pos, pos.Length) - self.assertRoughly( - round(pos.Length / 10, 0), proxy.holeDiameter(op, model, sub) - ) + self.assertRoughly(round(pos.Length / 10, 0), proxy.holeDiameter(model, sub)) def testPathDirection(self): """Verify that the generated paths obeys the given parameters""" diff --git a/src/Mod/CAM/Path/Op/CircularHoleBase.py b/src/Mod/CAM/Path/Op/CircularHoleBase.py index 39613eaaaa..f431146240 100644 --- a/src/Mod/CAM/Path/Op/CircularHoleBase.py +++ b/src/Mod/CAM/Path/Op/CircularHoleBase.py @@ -88,8 +88,8 @@ class ObjectOp(PathOp.ObjectOp): Can safely be overwritten by subclasses.""" pass - def holeDiameter(self, obj, base, sub): - """holeDiameter(obj, base, sub) ... returns the diameter of the specified hole.""" + def holeDiameter(self, base, sub): + """holeDiameter(base, sub) ... returns the diameter of the specified hole.""" try: shape = base.Shape.getElement(sub) if isinstance(shape, Part.Vertex): @@ -179,7 +179,7 @@ class ObjectOp(PathOp.ObjectOp): { "x": pos.x, "y": pos.y, - "r": self.holeDiameter(obj, base, sub), + "r": self.holeDiameter(base, sub), } ) diff --git a/src/Mod/CAM/Path/Op/Gui/CircularHoleBase.py b/src/Mod/CAM/Path/Op/Gui/CircularHoleBase.py index 37b6d5b6b1..66cf6b2145 100644 --- a/src/Mod/CAM/Path/Op/Gui/CircularHoleBase.py +++ b/src/Mod/CAM/Path/Op/Gui/CircularHoleBase.py @@ -84,7 +84,7 @@ class TaskPanelHoleGeometryPage(PathOpGui.TaskPanelBaseGeometryPage): item.setData(self.DataObjectSub, sub) self.form.baseList.setItem(self.form.baseList.rowCount() - 1, 0, item) - dia = obj.Proxy.holeDiameter(obj, base, sub) + dia = obj.Proxy.holeDiameter(base, sub) item = QtGui.QTableWidgetItem() item.setData(QtCore.Qt.DisplayRole, float(dia)) item.setTextAlignment(QtCore.Qt.AlignHCenter)