CAM: Rename CW/CCW to Climb/Conventional for consistency (#14364)

* Find and replace CW/CCW with Climb/Conventional

* Find and replace CCW/CW in CAM tests

* Find and replace in some UI files
This commit is contained in:
James Waples
2024-06-12 16:48:57 +01:00
committed by GitHub
parent 9b198c7704
commit 7e62d07538
16 changed files with 651 additions and 652 deletions

View File

@@ -67,14 +67,14 @@ class PathTestBase(unittest.TestCase):
for i in range(0, len(edges)):
self.assertLine(edges[i], points[i], points[i + 1])
def assertArc(self, edge, pt1, pt2, direction="CW"):
def assertArc(self, edge, pt1, pt2, direction="Climb"):
"""Verify that edge is an arc between pt1 and pt2 with the given direction."""
self.assertIs(type(edge.Curve), Part.Circle)
self.assertCoincide(edge.valueAt(edge.FirstParameter), pt1)
self.assertCoincide(edge.valueAt(edge.LastParameter), pt2)
ptm = edge.valueAt((edge.LastParameter + edge.FirstParameter) / 2)
side = Path.Geom.Side.of(pt2 - pt1, ptm - pt1)
if "CW" == direction:
if "Climb" == direction:
self.assertEqual(side, Path.Geom.Side.Left)
else:
self.assertEqual(side, Path.Geom.Side.Right)

View File

@@ -59,7 +59,7 @@ class TestDressupDogbone(PathTestBase):
"""Verify bones are inserted for simple moves."""
base = TestProfile(
"Inside",
"CW",
"Climb",
"""
G0 X10 Y10 Z10
G1 Z0
@@ -84,7 +84,7 @@ class TestDressupDogbone(PathTestBase):
"""Verify bones are inserted if hole ends with rapid move out."""
base = TestProfile(
"Inside",
"CW",
"Climb",
"""
G0 X10 Y10 Z10
G1 Z0
@@ -177,7 +177,7 @@ class TestDressupDogbone(PathTestBase):
"""Verify no bone is inserted for straight move interrupted by plunge."""
base = TestProfile(
"Inside",
"CW",
"Climb",
"""
G0 X10 Y10 Z10
G1 Z0
@@ -199,7 +199,7 @@ class TestDressupDogbone(PathTestBase):
"""Verify can handle comments between moves"""
base = TestProfile(
"Inside",
"CW",
"Climb",
"""
G0 X10 Y10 Z10
G1 Z0
@@ -222,7 +222,7 @@ class TestDressupDogbone(PathTestBase):
base = TestProfile(
"Inside",
"CW",
"Climb",
"""
G0 X10 Y10 Z10
G1 Z0
@@ -248,7 +248,7 @@ class TestDressupDogbone(PathTestBase):
"""Verify can handle noops between moves"""
base = TestProfile(
"Inside",
"CW",
"Climb",
"""
G0 X10 Y10 Z10
G1 Z0
@@ -271,7 +271,7 @@ class TestDressupDogbone(PathTestBase):
base = TestProfile(
"Inside",
"CW",
"Climb",
"""
G0 X10 Y10 Z10
G1 Z0

View File

@@ -45,71 +45,71 @@ class TestPathGeom(PathTestBase):
def test01(self):
"""Verify diffAngle functionality."""
self.assertRoughly(
Path.Geom.diffAngle(0, +0 * math.pi / 4, "CW") / math.pi, 0 / 4.0
Path.Geom.diffAngle(0, +0 * math.pi / 4, "Climb") / math.pi, 0 / 4.0
)
self.assertRoughly(
Path.Geom.diffAngle(0, +3 * math.pi / 4, "CW") / math.pi, 5 / 4.0
Path.Geom.diffAngle(0, +3 * math.pi / 4, "Climb") / math.pi, 5 / 4.0
)
self.assertRoughly(
Path.Geom.diffAngle(0, -3 * math.pi / 4, "CW") / math.pi, 3 / 4.0
Path.Geom.diffAngle(0, -3 * math.pi / 4, "Climb") / math.pi, 3 / 4.0
)
self.assertRoughly(
Path.Geom.diffAngle(0, +4 * math.pi / 4, "CW") / math.pi, 4 / 4.0
Path.Geom.diffAngle(0, +4 * math.pi / 4, "Climb") / math.pi, 4 / 4.0
)
self.assertRoughly(
Path.Geom.diffAngle(0, +0 * math.pi / 4, "CCW") / math.pi, 0 / 4.0
Path.Geom.diffAngle(0, +0 * math.pi / 4, "Conventional") / math.pi, 0 / 4.0
)
self.assertRoughly(
Path.Geom.diffAngle(0, +3 * math.pi / 4, "CCW") / math.pi, 3 / 4.0
Path.Geom.diffAngle(0, +3 * math.pi / 4, "Conventional") / math.pi, 3 / 4.0
)
self.assertRoughly(
Path.Geom.diffAngle(0, -3 * math.pi / 4, "CCW") / math.pi, 5 / 4.0
Path.Geom.diffAngle(0, -3 * math.pi / 4, "Conventional") / math.pi, 5 / 4.0
)
self.assertRoughly(
Path.Geom.diffAngle(0, +4 * math.pi / 4, "CCW") / math.pi, 4 / 4.0
Path.Geom.diffAngle(0, +4 * math.pi / 4, "Conventional") / math.pi, 4 / 4.0
)
self.assertRoughly(
Path.Geom.diffAngle(+math.pi / 4, +0 * math.pi / 4, "CW") / math.pi, 1 / 4.0
Path.Geom.diffAngle(+math.pi / 4, +0 * math.pi / 4, "Climb") / math.pi, 1 / 4.0
)
self.assertRoughly(
Path.Geom.diffAngle(+math.pi / 4, +3 * math.pi / 4, "CW") / math.pi, 6 / 4.0
Path.Geom.diffAngle(+math.pi / 4, +3 * math.pi / 4, "Climb") / math.pi, 6 / 4.0
)
self.assertRoughly(
Path.Geom.diffAngle(+math.pi / 4, -1 * math.pi / 4, "CW") / math.pi, 2 / 4.0
Path.Geom.diffAngle(+math.pi / 4, -1 * math.pi / 4, "Climb") / math.pi, 2 / 4.0
)
self.assertRoughly(
Path.Geom.diffAngle(-math.pi / 4, +0 * math.pi / 4, "CW") / math.pi, 7 / 4.0
Path.Geom.diffAngle(-math.pi / 4, +0 * math.pi / 4, "Climb") / math.pi, 7 / 4.0
)
self.assertRoughly(
Path.Geom.diffAngle(-math.pi / 4, +3 * math.pi / 4, "CW") / math.pi, 4 / 4.0
Path.Geom.diffAngle(-math.pi / 4, +3 * math.pi / 4, "Climb") / math.pi, 4 / 4.0
)
self.assertRoughly(
Path.Geom.diffAngle(-math.pi / 4, -1 * math.pi / 4, "CW") / math.pi, 0 / 4.0
Path.Geom.diffAngle(-math.pi / 4, -1 * math.pi / 4, "Climb") / math.pi, 0 / 4.0
)
self.assertRoughly(
Path.Geom.diffAngle(+math.pi / 4, +0 * math.pi / 4, "CCW") / math.pi,
Path.Geom.diffAngle(+math.pi / 4, +0 * math.pi / 4, "Conventional") / math.pi,
7 / 4.0,
)
self.assertRoughly(
Path.Geom.diffAngle(+math.pi / 4, +3 * math.pi / 4, "CCW") / math.pi,
Path.Geom.diffAngle(+math.pi / 4, +3 * math.pi / 4, "Conventional") / math.pi,
2 / 4.0,
)
self.assertRoughly(
Path.Geom.diffAngle(+math.pi / 4, -1 * math.pi / 4, "CCW") / math.pi,
Path.Geom.diffAngle(+math.pi / 4, -1 * math.pi / 4, "Conventional") / math.pi,
6 / 4.0,
)
self.assertRoughly(
Path.Geom.diffAngle(-math.pi / 4, +0 * math.pi / 4, "CCW") / math.pi,
Path.Geom.diffAngle(-math.pi / 4, +0 * math.pi / 4, "Conventional") / math.pi,
1 / 4.0,
)
self.assertRoughly(
Path.Geom.diffAngle(-math.pi / 4, +3 * math.pi / 4, "CCW") / math.pi,
Path.Geom.diffAngle(-math.pi / 4, +3 * math.pi / 4, "Conventional") / math.pi,
4 / 4.0,
)
self.assertRoughly(
Path.Geom.diffAngle(-math.pi / 4, -1 * math.pi / 4, "CCW") / math.pi,
Path.Geom.diffAngle(-math.pi / 4, -1 * math.pi / 4, "Conventional") / math.pi,
0 / 4.0,
)
@@ -499,7 +499,7 @@ class TestPathGeom(PathTestBase):
),
p1,
p2,
"CW",
"Climb",
)
self.assertArc(
Path.Geom.edgeForCmd(
@@ -510,7 +510,7 @@ class TestPathGeom(PathTestBase):
),
p2,
p1,
"CCW",
"Conventional",
)
def test30(self):

View File

@@ -44,7 +44,7 @@ def _resetArgs():
"step_over": 0.5,
"tool_diameter": 5.0,
"inner_radius": 0.0,
"direction": "CW",
"direction": "Climb",
"startAt": "Inside",
}

View File

@@ -121,7 +121,7 @@ class TestPathProfile(PathTestBase):
profile.processCircles = True
profile.processHoles = True
profile.UseComp = True
profile.Direction = "CW"
profile.Direction = "Climb"
_addViewProvider(profile)
self.doc.recompute()
@@ -158,7 +158,7 @@ class TestPathProfile(PathTestBase):
profile.processCircles = True
profile.processHoles = True
profile.UseComp = False
profile.Direction = "CW"
profile.Direction = "Climb"
_addViewProvider(profile)
self.doc.recompute()
@@ -179,9 +179,9 @@ class TestPathProfile(PathTestBase):
self.assertTrue(expected_moves == operationMoves,
"expected_moves: {}\noperationMoves: {}".format(expected_moves, operationMoves))
def test03(self):
"""test03() Verify path generated on Face18, outside,
"""test03() Verify path generated on Face18, outside,
with compensation and extra offset -radius."""
# Instantiate a Profile operation and set Base Geometry
@@ -196,7 +196,7 @@ class TestPathProfile(PathTestBase):
profile.processCircles = True
profile.processHoles = True
profile.UseComp = True
profile.Direction = "CW"
profile.Direction = "Climb"
profile.OffsetExtra = -profile.OpToolDiameter / 2.0
_addViewProvider(profile)
self.doc.recompute()
@@ -227,4 +227,3 @@ def _addViewProvider(profileOp):
profileOp.ViewObject.Proxy = PathOpGui.ViewProvider(
profileOp.ViewObject, cmdRes
)