explain heuristic

This commit is contained in:
Motiejus Jakštys 2021-05-19 20:24:25 +03:00
parent 9f695409a1
commit 72d025c1f8

View File

@ -194,8 +194,10 @@ begin
-- distance from head's 1st vertex should be larger than from 2nd vertex
exit when st_distance(ptail, phead[2]) < st_distance(ptail, phead[3]);
-- bend with smaller baseline wins when two neighboring bends can
-- have gentle inflections.
-- Between two bends, bend with smaller baseline wins when two
-- neighboring bends can have gentle inflections. This is a heuristic
-- that can be safely removed, but in practice has shown to avoid
-- creating some very bendy lines.
exit when st_distance(st_pointn(bends[i], 1), st_pointn(bends[i], -1)) <
st_distance(st_pointn(bends[i-1], 1), st_pointn(bends[i-1], -1));