summaryrefslogtreecommitdiff
path: root/lib/utils/smoothing.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-06-04 20:01:53 +0200
committerGitHub <noreply@github.com>2025-06-04 20:01:53 +0200
commit547237d50a201e7768ea3701f51c3d7036eb7f13 (patch)
treed1083092272bcdc50d4b51530e3f9cc8f21cc372 /lib/utils/smoothing.py
parentc27098508b586ab2b1082d702661e8dba9db9604 (diff)
Smoothing and clamping (#3772)
* smoothing: ensure start and end of original path * clamp path: never intersecting path could also be entirely in the exterior of the shape
Diffstat (limited to 'lib/utils/smoothing.py')
-rw-r--r--lib/utils/smoothing.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/utils/smoothing.py b/lib/utils/smoothing.py
index 9c16bb0f..1511b0a3 100644
--- a/lib/utils/smoothing.py
+++ b/lib/utils/smoothing.py
@@ -57,4 +57,8 @@ def smooth_path(path, smoothness=1.0, iterations=5):
r[-1] = ll[-1]
points = ll * 0.75 + r * 0.25
- return [Point(*coord) for coord in points]
+ # we want to keep the old start and end points
+ start = [Point(* path[0])]
+ end = [Point(* path[-1])]
+
+ return start + [Point(*coord) for coord in points] + end