From 3797ad6bb5ac41ffe3d985d18c34c558bd2be459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Tue, 13 Apr 2021 09:53:44 +0300 Subject: [PATCH] visualize self-crossing --- IV/Makefile | 19 ++++++++++++++++++- IV/mj-msc.tex | 18 +++++++++++++++++- IV/tests.sql | 10 ++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/IV/Makefile b/IV/Makefile index 9c276f1..4c12dc2 100644 --- a/IV/Makefile +++ b/IV/Makefile @@ -9,7 +9,9 @@ FIGURES = fig8-definition-of-a-bend.pdf \ fig5-gentle-inflection-before.pdf \ fig5-gentle-inflection-after.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 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" \ --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 ./db -f tests.sql diff --git a/IV/mj-msc.tex b/IV/mj-msc.tex index 2b9c38a..e34235c 100644 --- a/IV/mj-msc.tex +++ b/IV/mj-msc.tex @@ -409,7 +409,23 @@ The "quite small angle" was arbitrarily chosen to $\smallAngle$. \subsection{Self-line Crossing When Cutting a Bend} 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} diff --git a/IV/tests.sql b/IV/tests.sql index 22e5c7c..9268db9 100644 --- a/IV/tests.sql +++ b/IV/tests.sql @@ -53,6 +53,16 @@ drop table if exists wm_demo; 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; +-- 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 $$ declare vbends geometry[];