explain heuristic

This commit is contained in:
Motiejus Jakštys 2021-05-19 22:57:52 +03:00 committed by Motiejus Jakštys
parent e56805893e
commit 1aad1156b0

6
wm.sql
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));