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

This commit is contained in:
Motiejus Jakštys 2021-03-05 17:49:32 +02:00
parent ff777063fb
commit 497735d0b1
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
the bend. E.g. from:
\ \
\ /
B\ | __
| | / \
| |____/A |
\__________|
Instead of:
\ /
\/ A'
B
To:
\ \_

View File

@ -234,6 +234,14 @@ begin
-- bends[i] = append(bends[i], multi[2][2..n])
-- 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;