Skip to content

Commit d346f2f

Browse files
committed
Modify tolerance checking in column_track()
1 parent 61c6db3 commit d346f2f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

mulgrids.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,12 +2003,10 @@ def column_track(self, line):
20032003
line.
20042004
"""
20052005

2006-
dl = max(norm(line[1] - line[0]), 1)
20072006
tol = 1e-3
2008-
2009-
def track_dist(p):
2010-
"""Non-dimensionalised distance of point along track"""
2011-
return norm(p - line[0]) / dl
2007+
def track_dist(p): return norm(p - line[0])
2008+
dl = track_dist(line[1])
2009+
tol_dl = tol * dl
20122010

20132011
track, dist = [], []
20142012
start_col, end_col = None, None
@@ -2034,7 +2032,7 @@ def track_dist(p):
20342032
elif col == end_col:
20352033
pts = [pts[0], line[-1]]
20362034
din, dout = track_dist(pts[0]), track_dist(pts[-1])
2037-
if abs(dout - din) > tol:
2035+
if abs(dout - din) > tol_dl:
20382036
track.append((col, pts[0], pts[-1]))
20392037
dist.append(din)
20402038

0 commit comments

Comments
 (0)