From 956604682769bcd4a171bf5459ef13186745cd25 Mon Sep 17 00:00:00 2001 From: Adrian Croucher Date: Wed, 3 Apr 2024 15:43:35 +1300 Subject: [PATCH] Check track segment length also for start, end columns --- mulgrids.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mulgrids.py b/mulgrids.py index fe4b359..26f902d 100755 --- a/mulgrids.py +++ b/mulgrids.py @@ -2028,15 +2028,10 @@ def track_dist(p): if len(pts) > 0: if col == start_col: pts = [line[0], pts[-1]] - din = 0 - add_col = True elif col == end_col: pts = [pts[0], line[-1]] - din = track_dist(pts[0]) - add_col = True - else: - din, dout = track_dist(pts[0]), track_dist(pts[-1]) - add_col = abs(dout - din) > tol + din, dout = track_dist(pts[0]), track_dist(pts[-1]) + add_col = abs(dout - din) > tol if add_col: track.append((col, pts[0], pts[-1])) dist.append(din)