wip demo self-crossing: it's now incorrectly mutating things

This commit is contained in:
Motiejus Jakštys 2021-05-19 22:57:45 +03:00 committed by Motiejus Jakštys
parent c30153c554
commit a37385e0d1
2 changed files with 15 additions and 1 deletions

View File

@ -48,12 +48,18 @@ but they will be eliminated by joining A and B anyway.
Also, there is another way to remove self-crossing, without removing most of Also, there is another way to remove self-crossing, without removing most of
the bend. E.g. from: the bend. E.g. from:
\ \ \ /
B\ | __ B\ | __
| | / \ | | / \
| |____/A | | |____/A |
\__________| \__________|
Instead of:
\ /
\/ A'
B
To: To:
\ \_ \ \_

8
wm.sql
View File

@ -234,6 +234,14 @@ begin
-- bends[i] = append(bends[i], multi[2][2..n]) -- bends[i] = append(bends[i], multi[2][2..n])
-- remove bends from bends[i+1] to bends[j] inclusive. -- remove bends from bends[i+1] to bends[j] inclusive.
if j < i then
bends[j] = st_geometryn(multi, 1);
bends[j] = st_setpoint(bends[j], st_npoints(bends[j])-1, st_pointn(bends[i], st_npoints(bends[i])));
bends = bends[1:j] || bends[i+1:array_length(bends, 1)];
else
--
end if;
end loop; end loop;
end loop; end loop;