retain zero-sized bends

This commit is contained in:
Motiejus Jakštys 2021-05-19 22:57:49 +03:00 committed by Motiejus Jakštys
parent 8c10fbecfb
commit 0da5f8433c
2 changed files with 6 additions and 5 deletions

View File

@ -53,8 +53,8 @@ insert into wm_figures (name, way) values ('selfcrossing-1-rev',ST_Reverse(ST_Tr
delete from wm_debug where name in (select distinct name from wm_figures);
delete from wm_demo where name in (select distinct name from wm_figures);
insert into wm_demo (name, way) select name, ST_SimplifyWM(way, 10000, name) from wm_figures where name != 'fig8';
insert into wm_demo (name, way) select name, ST_SimplifyWM(way, 15, name) from wm_figures where name = 'fig8';
insert into wm_demo (name, way) select name, ST_SimplifyWM(way, .1, name) from wm_figures where name != 'fig8';
insert into wm_demo (name, way) select name, ST_SimplifyWM(way, .1, name) from wm_figures where name = 'fig8';
do $$

7
wm.sql
View File

@ -431,7 +431,8 @@ begin
i = 1;
while i < array_length(bendattrs, 1)-1 loop
i = i + 1;
continue when area_threshold >= bendattrs[i].adjsize;
continue when bendattrs[i].adjsize = 0;
continue when bendattrs[i].adjsize > area_threshold;
if i = 2 then
leftsize = bendattrs[i].adjsize + 1;
@ -445,8 +446,8 @@ begin
rightsize = bendattrs[i+1].adjsize;
end if;
continue when leftsize <= bendattrs[i].adjsize;
continue when rightsize <= bendattrs[i].adjsize;
continue when bendattrs[i].adjsize >= leftsize;
continue when bendattrs[i].adjsize >= rightsize;
-- Local minimum. Elminate!
mutated = true;