syntax shortening

This commit is contained in:
Motiejus Jakštys 2021-05-19 22:57:45 +03:00 committed by Motiejus Jakštys
parent 5e47e90370
commit d5eb0d7440

8
wm.sql
View File

@ -147,14 +147,10 @@ begin
exit when array_length(phead, 1) < 3; exit when array_length(phead, 1) < 3;
-- if inflection angle between ptail[1:3] "large", stop processing this bend -- 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 when abs(st_angle(phead[1], phead[2], phead[3]) - pi) > small_angle;
exit;
end if;
-- distance from head's first vertex should be larger than from second vertex -- 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 when st_distance(ptail, phead[2]) < st_distance(ptail, phead[3]);
exit;
end if;
-- detected a gentle inflection. Move head of the tail to the tail of head -- detected a gentle inflection. Move head of the tail to the tail of head
bends[i] = st_removepoint(bends[i], 0); bends[i] = st_removepoint(bends[i], 0);