From 91fd699f2d9a9b5eb06ab6b91381706b5c82c96b Mon Sep 17 00:00:00 2001 From: tarman3 Date: Wed, 12 Nov 2025 14:05:00 +0200 Subject: [PATCH] CAM: Path.Geom.cmdsForEdge() - remove useless 'useHelixForBSpline' --- src/Mod/CAM/Path/Dressup/Boundary.py | 1 - src/Mod/CAM/Path/Dressup/Tags.py | 1 - src/Mod/CAM/Path/Geom.py | 23 +++++++++++------------ 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/Mod/CAM/Path/Dressup/Boundary.py b/src/Mod/CAM/Path/Dressup/Boundary.py index 4c5421d823..bb3b1d22f3 100644 --- a/src/Mod/CAM/Path/Dressup/Boundary.py +++ b/src/Mod/CAM/Path/Dressup/Boundary.py @@ -283,7 +283,6 @@ class PathBoundary: Path.Geom.cmdsForEdge( e, flip, - False, tc.HorizFeed.Value, tc.VertFeed.Value, ) diff --git a/src/Mod/CAM/Path/Dressup/Tags.py b/src/Mod/CAM/Path/Dressup/Tags.py index dd23e216d9..56e0f20739 100644 --- a/src/Mod/CAM/Path/Dressup/Tags.py +++ b/src/Mod/CAM/Path/Dressup/Tags.py @@ -556,7 +556,6 @@ class MapWireToTag: Path.Geom.cmdsForEdge( e, False, - False, hSpeed=self.hSpeed, vSpeed=self.vSpeed, ) diff --git a/src/Mod/CAM/Path/Geom.py b/src/Mod/CAM/Path/Geom.py index 4215cf7e68..e86121f93a 100644 --- a/src/Mod/CAM/Path/Geom.py +++ b/src/Mod/CAM/Path/Geom.py @@ -278,13 +278,14 @@ def speedBetweenPoints(p0, p1, hSpeed, vSpeed): return speed -def cmdsForEdge(edge, flip=False, useHelixForBSpline=True, hSpeed=0, vSpeed=0): - """cmdsForEdge(edge, flip=False, useHelixForBSpline=True) -> List(Path.Command) +def cmdsForEdge(edge, flip=False, hSpeed=0, vSpeed=0): + """cmdsForEdge(edge, flip=False) -> List(Path.Command) Returns a list of Path.Command representing the given edge. If flip is True the edge is considered to be backwards. - If useHelixForBSpline is True an Edge based on a BSplineCurve is considered - to represent a helix and results in G2 or G3 command. Otherwise edge has - no direct Path.Command mapping and will be approximated by straight segments.""" + Edge based on a Part.Line is results in G1 command. + Horizontal Edge based on a Part.Circle is results in G2 or G3 command. + Other edge has no direct Path.Command mapping + and will be approximated by straight segments.""" pt = edge.valueAt(edge.LastParameter) if not flip else edge.valueAt(edge.FirstParameter) params = {"X": pt.x, "Y": pt.y, "Z": pt.z} if isinstance(edge.Curve, (Part.Line, Part.LineSegment)): @@ -299,13 +300,11 @@ def cmdsForEdge(edge, flip=False, useHelixForBSpline=True, hSpeed=0, vSpeed=0): p2 = edge.valueAt((edge.FirstParameter + edge.LastParameter) / 2) p3 = pt - if hasattr(edge.Curve, "Axis") and ( - ( - isinstance(edge.Curve, Part.Circle) - and isRoughly(edge.Curve.Axis.x, 0) - and isRoughly(edge.Curve.Axis.y, 0) - ) - or (useHelixForBSpline and isinstance(edge.Curve, Part.BSplineCurve)) + if ( + hasattr(edge.Curve, "Axis") + and isinstance(edge.Curve, Part.Circle) + and isRoughly(edge.Curve.Axis.x, 0) + and isRoughly(edge.Curve.Axis.y, 0) ): # This is an arc or a helix and it should be represented by a simple G2/G3 command if edge.Curve.Axis.z < 0: