CAM: CircularHoleBase.holeDiameter() - Remove useless obj

This commit is contained in:
tarman3
2026-02-27 20:43:56 +02:00
parent eaf76e4d0a
commit eb0d7ba6a5
3 changed files with 8 additions and 14 deletions
+4 -10
View File
@@ -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"""
+3 -3
View File
@@ -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),
}
)
+1 -1
View File
@@ -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)