From e56805893e282d777019d8e5e34ca66d807bdb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 19 May 2021 22:57:52 +0300 Subject: [PATCH] add gentle inflection contribution by Tomas Straupis --- wm.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wm.sql b/wm.sql index 09da3ee..b0c4cd9 100644 --- a/wm.sql +++ b/wm.sql @@ -194,6 +194,11 @@ 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. + 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)); + -- Detected a gentle inflection. -- Move head of the tail to the tail of head bends[i] = st_removepoint(bends[i], 0);