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

@@ -45,7 +45,7 @@ def generate(
step_over,
tool_diameter,
inner_radius=0.0,
direction="CW",
direction="Climb",
startAt="Outside",
):
"""generate(edge, hole_radius, inner_radius, step_over) ... generate helix commands.
@@ -96,7 +96,7 @@ def generate(
elif startAt not in ["Inside", "Outside"]:
raise ValueError("Invalid value for parameter 'startAt'")
elif direction not in ["CW", "CCW"]:
elif direction not in ["Climb", "Conventional"]:
raise ValueError("Invalid value for parameter 'direction'")
if type(step_over) not in [float, int]:
@@ -145,7 +145,7 @@ def generate(
def helix_cut_r(r):
commandlist = []
arc_cmd = "G2" if direction == "CW" else "G3"
arc_cmd = "G2" if direction == "Climb" else "G3"
commandlist.append(
Path.Command("G0", {"X": startPoint.x + r, "Y": startPoint.y})
)

View File

@@ -182,12 +182,12 @@ class ObjectDressup:
def getDirectionOfPath(self, obj):
op = PathDressup.baseOp(obj.Base)
side = op.Side if hasattr(op, "Side") else "Inside"
direction = op.Direction if hasattr(op, "Direction") else "CCW"
direction = op.Direction if hasattr(op, "Direction") else "Conventional"
if side == "Outside":
return "left" if direction == "CW" else "right"
return "left" if direction == "Climb" else "right"
else:
return "right" if direction == "CW" else "left"
return "right" if direction == "Climb" else "left"
def getArcDirection(self, obj):
direction = self.getDirectionOfPath(obj)
@@ -328,7 +328,7 @@ class ObjectDressup:
else: # obj.StyleOff == "Perpendicular"
append(self.createStraightMove(obj, end, end + normal))
extend = obj.ExtendLeadOut.Value
extend = obj.ExtendLeadOut.Value
if extend != 0:
# append extension
extendend = end + normal / length * extend

View File

@@ -147,10 +147,10 @@ def getAngle(vector):
return a
def diffAngle(a1, a2, direction="CW"):
"""diffAngle(a1, a2, [direction='CW'])
def diffAngle(a1, a2, direction="Climb"):
"""diffAngle(a1, a2, [direction='Climb'])
Returns the difference between two angles (a1 -> a2) into a given direction."""
if direction == "CW":
if direction == "Climb":
while a1 < a2:
a1 += 2 * math.pi
a = a1 - a2
@@ -466,7 +466,7 @@ def edgeForCmd(cmd, startPoint):
cw = True
else:
cw = False
angle = diffAngle(getAngle(A), getAngle(B), "CW" if cw else "CCW")
angle = diffAngle(getAngle(A), getAngle(B), "Climb" if cw else "CCW")
height = endPoint.z - startPoint.z
pitch = height * math.fabs(2 * math.pi / angle)
if angle > 0:

View File

@@ -340,7 +340,7 @@ class ObjectOp(PathOp.ObjectOp):
verts = hWire.Wires[0].Vertexes
idx = 0
if obj.Direction == "CCW":
if obj.Direction == "Conventional":
idx = len(verts) - 1
x = verts[idx].X
y = verts[idx].Y

View File

@@ -144,7 +144,7 @@ class ObjectDeburr(PathEngraveBase.ObjectOp):
"Deburr",
QT_TRANSLATE_NOOP("App::Property", "Direction of toolpath"),
)
# obj.Direction = ["CW", "CCW"]
# obj.Direction = ["Climb", "Conventional"]
obj.addProperty(
"App::PropertyEnumeration",
"Side",
@@ -181,8 +181,8 @@ class ObjectDeburr(PathEngraveBase.ObjectOp):
# Enumeration lists for App::PropertyEnumeration properties
enums = {
"Direction": [
(translate("Path", "CW"), "CW"),
(translate("Path", "CCW"), "CCW"),
(translate("Path", "Climb"), "Climb"),
(translate("Path", "Conventional"), "Conventional"),
], # this is the direction that the profile runs
"Join": [
(translate("PathDeburr", "Round"), "Round"),
@@ -414,7 +414,7 @@ class ObjectDeburr(PathEngraveBase.ObjectOp):
wires.append(wire)
# Set direction of op
forward = obj.Direction == "CW"
forward = obj.Direction == "Climb"
# Set value of side
obj.Side = side[0]
@@ -449,7 +449,7 @@ class ObjectDeburr(PathEngraveBase.ObjectOp):
obj.Join = "Round"
obj.setExpression("StepDown", "0 mm")
obj.StepDown = "0 mm"
obj.Direction = "CW"
obj.Direction = "Climb"
obj.Side = "Outside"
obj.EntryPoint = 0

View File

@@ -68,8 +68,8 @@ class ObjectHelix(PathCircularHoleBase.ObjectOp):
# Enumeration lists for App::PropertyEnumeration properties
enums = {
"Direction": [
(translate("CAM_Helix", "CW"), "CW"),
(translate("CAM_Helix", "CCW"), "CCW"),
(translate("CAM_Helix", "Climb"), "Climb"),
(translate("CAM_Helix", "Conventional"), "Conventional"),
], # this is the direction that the profile runs
"StartSide": [
(translate("PathProfile", "Outside"), "Outside"),
@@ -105,7 +105,7 @@ class ObjectHelix(PathCircularHoleBase.ObjectOp):
"Helix Drill",
QT_TRANSLATE_NOOP(
"App::Property",
"The direction of the circular cuts, ClockWise (CW), or CounterClockWise (CCW)",
"The direction of the circular cuts, ClockWise (Climb), or CounterClockWise (Conventional)",
),
)

View File

@@ -124,7 +124,7 @@ class ObjectPocket(PathAreaOp.ObjectOp):
"Pocket",
QT_TRANSLATE_NOOP(
"App::Property",
"The direction that the toolpath should go around the part ClockWise (CW) or CounterClockWise (CCW)",
"The direction that the toolpath should go around the part ClockWise (Climb) or CounterClockWise (Conventional)",
),
)
obj.addProperty(

View File

@@ -104,7 +104,7 @@ class ObjectProfile(PathAreaOp.ObjectOp):
"Profile",
QT_TRANSLATE_NOOP(
"App::Property",
"The direction that the toolpath should go around the part ClockWise (CW) or CounterClockWise (CCW)",
"The direction that the toolpath should go around the part ClockWise (Climb) or CounterClockWise (Conventional)",
),
),
(
@@ -193,8 +193,8 @@ class ObjectProfile(PathAreaOp.ObjectOp):
# Enumeration lists for App::PropertyEnumeration properties
enums = {
"Direction": [
(translate("PathProfile", "CW"), "CW"),
(translate("PathProfile", "CCW"), "CCW"),
(translate("PathProfile", "Climb"), "Climb"),
(translate("PathProfile", "Conventional"), "Conventional"),
], # this is the direction that the profile runs
"HandleMultipleFeatures": [
(translate("PathProfile", "Collectively"), "Collectively"),
@@ -230,7 +230,7 @@ class ObjectProfile(PathAreaOp.ObjectOp):
"""areaOpPropertyDefaults(obj, job) ... returns a dictionary of default values
for the operation's properties."""
return {
"Direction": "CW",
"Direction": "Climb",
"HandleMultipleFeatures": "Collectively",
"JoinType": "Round",
"MiterLimit": 0.1,
@@ -343,11 +343,11 @@ class ObjectProfile(PathAreaOp.ObjectOp):
# Reverse the direction for holes
if isHole:
direction = "CW" if obj.Direction == "CCW" else "CCW"
direction = "Climb" if obj.Direction == "Conventional" else "Conventional"
else:
direction = obj.Direction
if direction == "CCW":
if direction == "Conventional":
params["orientation"] = 0
else:
params["orientation"] = 1
@@ -356,7 +356,7 @@ class ObjectProfile(PathAreaOp.ObjectOp):
if obj.UseComp:
offset = self.radius + obj.OffsetExtra.Value
if offset == 0.0:
if direction == "CCW":
if direction == "Conventional":
params["orientation"] = 1
else:
params["orientation"] = 0

View File

@@ -378,11 +378,11 @@ def export(objectslist, filename, argstring):
STORED_COMPENSATED_OBJ = commands
# Find mill compensation
if hasattr(obj, "Side") and hasattr(obj, "Direction"):
if obj.Side == "Outside" and obj.Direction == "CW":
if obj.Side == "Outside" and obj.Direction == "Climb":
Compensation = "L"
elif obj.Side == "Outside" and obj.Direction == "CCW":
elif obj.Side == "Outside" and obj.Direction == "Conventional":
Compensation = "R"
elif obj.Side != "Outside" and obj.Direction == "CW":
elif obj.Side != "Outside" and obj.Direction == "Climb":
Compensation = "R"
else:
Compensation = "L"