From 884022f0a9726f2bc395b95d3fc93c3375b363c3 Mon Sep 17 00:00:00 2001 From: jffmichi Date: Tue, 1 Aug 2023 18:14:08 +0200 Subject: [PATCH 1/2] fix flipEdge not taking into account FirstParameter and LastParameter for splines --- src/Mod/Path/Path/Geom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Path/Path/Geom.py b/src/Mod/Path/Path/Geom.py index 624af65fe8..615f2cf4ac 100644 --- a/src/Mod/Path/Path/Geom.py +++ b/src/Mod/Path/Path/Geom.py @@ -676,7 +676,7 @@ def flipEdge(edge): poles, mults, knots, perio, degree, weights, ratio ) - return Part.Edge(flipped) + return Part.Edge(flipped, ma + mi - edge.LastParameter, ma + mi - edge.FirstParameter) elif type(edge.Curve) == Part.OffsetCurve: return edge.reversed() From eb595ac3cef316ab35a2de63320c3b82e92a06ed Mon Sep 17 00:00:00 2001 From: jffmichi <> Date: Thu, 10 Aug 2023 01:17:36 +0200 Subject: [PATCH 2/2] add unit test for flipEdge with FirstParameter and LastParameter --- src/Mod/Path/PathTests/TestPathGeom.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mod/Path/PathTests/TestPathGeom.py b/src/Mod/Path/PathTests/TestPathGeom.py index d6ffd864e0..e2bad2f1ec 100644 --- a/src/Mod/Path/PathTests/TestPathGeom.py +++ b/src/Mod/Path/PathTests/TestPathGeom.py @@ -872,6 +872,9 @@ class TestPathGeom(PathTestBase): edge = Part.Edge(spline) self.assertEdgeShapesMatch(edge, Path.Geom.flipEdge(edge)) + edge = Part.Edge(spline, 4, 12) + self.assertEdgeShapesMatch(edge, Path.Geom.flipEdge(edge)) + edge = Part.Edge( Part.BSplineCurve( [