visualize self-crossing

This commit is contained in:
Motiejus Jakštys 2021-05-19 22:57:47 +03:00 committed by Motiejus Jakštys
parent 80de8f7950
commit 95756033a2
3 changed files with 45 additions and 2 deletions

View File

@ -9,7 +9,9 @@ FIGURES = fig8-definition-of-a-bend.pdf \
fig5-gentle-inflection-before.pdf \ fig5-gentle-inflection-before.pdf \
fig5-gentle-inflection-after.pdf \ fig5-gentle-inflection-after.pdf \
inflection-1-gentle-inflection-before.pdf \ inflection-1-gentle-inflection-before.pdf \
inflection-1-gentle-inflection-after.pdf inflection-1-gentle-inflection-after.pdf \
fig6-self-crossing-before.pdf \
fig6-self-crossing-after.pdf
.PHONY: test .PHONY: test
test: .faux_test test: .faux_test
@ -113,6 +115,21 @@ inflection-1-gentle-inflection-after.pdf: layer2img.py Makefile .faux_test
--group2-where="name='inflection-1' AND stage='cinflections-polygon' AND gen=1" \ --group2-where="name='inflection-1' AND stage='cinflections-polygon' AND gen=1" \
--outfile=$@ --outfile=$@
fig6-self-crossing-before.pdf: layer2img.py Makefile .faux_test
python ./layer2img.py \
--widthdiv=4 \
--group1-table=wm_debug \
--group1-where="name='fig6' AND stage='bbends' AND gen=1" \
--group2-table=wm_visuals \
--group2-where="name='fig6-baseline'" \
--outfile=$@
fig6-self-crossing-after.pdf: layer2img.py Makefile .faux_test
python ./layer2img.py \
--widthdiv=4 \
--group1-table=wm_debug \
--group1-where="name='fig6' AND stage='dcrossings' AND gen=1" \
--outfile=$@
.faux_test: tests.sql wm.sql .faux_db .faux_test: tests.sql wm.sql .faux_db
./db -f tests.sql ./db -f tests.sql

View File

@ -409,7 +409,23 @@ The "quite small angle" was arbitrarily chosen to $\smallAngle$.
\subsection{Self-line Crossing When Cutting a Bend} \subsection{Self-line Crossing When Cutting a Bend}
When bend's baseline crosses another bend, it is called self-crossing. This is When bend's baseline crosses another bend, it is called self-crossing. This is
undesirable in the upcoming operators, and self-crossings should be removed. undesirable in the upcoming operators, and self-crossings should be removed
following the rules of the article.
\begin{figure}[h]
\centering
\begin{subfigure}[b]{.4\textwidth}
\includegraphics[width=\textwidth]{fig6-self-crossing-before}
\caption{Bend's baseline is crossing another bend}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.4\textwidth}
\includegraphics[width=\textwidth]{fig6-self-crossing-after}
\caption{Bend's baseline is crossing another bend}
\end{subfigure}
\caption{Originally Figure 6: self-line crossing}
\label{fig:fig6-self-crossing}
\end{figure}
\subsection{Attributes of a Single Bend} \subsection{Attributes of a Single Bend}

View File

@ -53,6 +53,16 @@ drop table if exists wm_demo;
create table wm_demo (name text, i bigint, way geometry); create table wm_demo (name text, i bigint, way geometry);
insert into wm_demo (name, way) select name, ST_SimplifyWM(way, name) from wm_figures; insert into wm_demo (name, way) select name, ST_SimplifyWM(way, name) from wm_figures;
-- wm_visuals holds visual aids for the paper.
drop table if exists wm_visuals;
create table wm_visuals (name text, way geometry);
do $$
declare fig6 geometry;
begin
select way from wm_debug where name='fig6' and stage='bbends' and gen=1 into fig6 limit 1 offset 2;
insert into wm_visuals (name, way) values('fig6-baseline', st_makeline(st_startpoint(fig6), st_endpoint(fig6)));
end $$ language plpgsql;
do $$ do $$
declare declare
vbends geometry[]; vbends geometry[];