From 705dabaa5670b9d5ec6c583e76d8441c6051334a Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Thu, 16 May 2024 06:43:01 +0200 Subject: fix gap after auto-route satin (#2907) --- lib/stitches/auto_satin.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/stitches/auto_satin.py') diff --git a/lib/stitches/auto_satin.py b/lib/stitches/auto_satin.py index 09f331bf..e681a4f7 100644 --- a/lib/stitches/auto_satin.py +++ b/lib/stitches/auto_satin.py @@ -70,12 +70,18 @@ class SatinSegment(object): def to_satin(self): satin = self.satin + # get cut points before actually cutting the satin to avoid + # rounding errors which may produce gaps in between the satins if self.start > 0.0: - before, satin = satin.split(self.start) + start = satin.find_cut_points(self.start) + if self.end < 1.0: + end = satin.find_cut_points(self.end) + # cut satin + if self.start > 0.0: + before, satin = satin.split(None, cut_points=start) if self.end < 1.0: - satin, after = satin.split( - (self.end - self.start) / (1.0 - self.start)) + satin, after = satin.split(None, cut_points=end) if self.reverse: satin = satin.reverse() -- cgit v1.2.3