From 9a70106e9fc7374956837df43d634e8b03cc9421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Tue, 2 Mar 2021 18:34:42 +0200 Subject: [PATCH] syntax shortening --- IV/wm.sql | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/IV/wm.sql b/IV/wm.sql index 11a1afa..c8bd05a 100644 --- a/IV/wm.sql +++ b/IV/wm.sql @@ -147,14 +147,10 @@ begin exit when array_length(phead, 1) < 3; -- if inflection angle between ptail[1:3] "large", stop processing this bend - if abs(st_angle(phead[1], phead[2], phead[3]) - pi) > small_angle then - exit; - end if; + exit when abs(st_angle(phead[1], phead[2], phead[3]) - pi) > small_angle; -- distance from head's first vertex should be larger than from second vertex - if st_distance(ptail, phead[2]) < st_distance(ptail, phead[3]) then - exit; - end if; + exit when st_distance(ptail, phead[2]) < st_distance(ptail, phead[3]); -- detected a gentle inflection. Move head of the tail to the tail of head bends[i] = st_removepoint(bends[i], 0);