From 191e5532a851c0a1bbadbf3495f2fe57117c6e11 Mon Sep 17 00:00:00 2001 From: Gabriel Wicke Date: Sun, 7 Jun 2020 15:59:51 -0700 Subject: [PATCH] Path: Fix for optimizeLinearSegments Reduce cumulative error by holding onto the original point in a sequence of linear optimizations. In testing, this fixes artifacts I have seen on very finely sampled paths with very gradual curvature. Further improvements are needed for this optimization, but at least this change avoids a regression over the status quo. --- src/Mod/Path/PathScripts/PathSurface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathSurface.py b/src/Mod/Path/PathScripts/PathSurface.py index 373f95bde9..5e05ee6252 100644 --- a/src/Mod/Path/PathScripts/PathSurface.py +++ b/src/Mod/Path/PathScripts/PathSurface.py @@ -2093,7 +2093,7 @@ class ObjectSurface(PathOp.ObjectOp): for nxt in line[2:]: if not pnt.isOnLineSegment(prv, nxt): pts.append(pnt) - prv = pnt + prv = pnt pnt = nxt pts.append(line[-1]) return pts