From 86b9574893f1dbe20c9dfe164321ae04328b5b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 19 May 2021 22:57:47 +0300 Subject: [PATCH] wip fix gentle inflections --- Makefile | 30 +++++++++++++++++++++++++++++- layer2img.py | 4 ++-- mj-msc.tex | 23 ++++++++++++++++++++++- notes.txt | 6 ------ 4 files changed, 53 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 628a22a..7946c93 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,9 @@ SLIDES = slides-2021-03-29.pdf NON_ARCHIVABLES = notes.txt referatui.txt slides-2021-03-29.txt ARCHIVABLES = $(filter-out $(NON_ARCHIVABLES),$(shell git ls-files .)) -FIGURES = fig8-definition-of-a-bend.pdf +FIGURES = fig8-definition-of-a-bend.pdf \ + fig5-gentle-inflection-before.pdf \ + fig5-gentle-inflection-after.pdf .PHONY: test test: .faux_test @@ -44,6 +46,17 @@ mj-msc-full.pdf: mj-msc.pdf version.tex $(ARCHIVABLES) done mv .tmp-$@ $@ +mj-msc-gray.pdf: mj-msc.pdf + gs \ + -sOutputFile=$@ \ + -sDEVICE=pdfwrite \ + -sColorConversionStrategy=Gray \ + -dProcessColorModel=/DeviceGray \ + -dCompatibilityLevel=1.4 \ + -dNOPAUSE \ + -dBATCH \ + $< + test-figures.pdf: layer2img.py .faux_test python ./layer2img.py --group1-table=wm_figures --outfile=$@ @@ -56,6 +69,21 @@ fig8-definition-of-a-bend.pdf: layer2img.py Makefile .faux_test --group2-where="name='fig8' AND stage='bbends' AND gen=1" \ --outfile=$@ +fig5-gentle-inflection-before.pdf: layer2img.py Makefile .faux_test + python ./layer2img.py \ + --group1-table=wm_debug \ + --group1-where="name='fig5' AND stage='bbends' AND gen=1" \ + --group2-cmap=1 \ + --group2-table=wm_debug \ + --group2-where="name='fig5' AND stage='bbends-polygon' AND gen=1" \ + --outfile=$@ + +fig5-gentle-inflection-after.pdf: layer2img.py Makefile .faux_test + python ./layer2img.py \ + --group1-table=wm_debug \ + --group1-where="name='fig5' AND stage='cinflections' AND gen=1" \ + --outfile=$@ + .faux_test: tests.sql wm.sql .faux_db ./db -f tests.sql touch $@ diff --git a/layer2img.py b/layer2img.py index da8908d..196a9f5 100644 --- a/layer2img.py +++ b/layer2img.py @@ -58,8 +58,8 @@ def main(): group1 = read_layer(args.group1_table, args.group1_where) group2 = read_layer(args.group2_table, args.group2_where) group3 = read_layer(args.group3_table, args.group3_where) - c1 = {'cmap': 'coolwarm'} if args.group1_cmap else {'color': ORANGE} - c2 = {'cmap': 'coolwarm'} if args.group2_cmap else {'color': BLACK} + c1 = {'cmap': 'coolwarm'} if args.group1_cmap else {'color': BLACK} + c2 = {'cmap': 'coolwarm'} if args.group2_cmap else {'color': ORANGE} c3 = {'cmap': 'coolwarm'} if args.group3_cmap else {'color': GREEN} rc('text', usetex=True) diff --git a/mj-msc.tex b/mj-msc.tex index 720c979..b138965 100644 --- a/mj-msc.tex +++ b/mj-msc.tex @@ -225,7 +225,7 @@ test cases. \begin{figure}[H] \centering \includegraphics[width=\linewidth]{fig8-definition-of-a-bend} - \caption{Originally figure 8: detected bends are highlighted} + \caption{Originally Figure 8: detected bends are highlighted} \label{fig:fig8-definition-of-a-bend} \end{figure} @@ -241,6 +241,27 @@ have such an explanation or illustration. \section{Gentle Inflection at End of a Bend} +The example in this section was clear, but insufficient: it does not specify +how many vertices should be included when calculating the end-of-bend +inflection. We chose the iterative approach -- as long as the angle is "right" +and the distance is decreasing, the algorithm should keep going; practically +not having an upper bound on the number of iterations. + +\begin{figure}[h] + \centering + \begin{subfigure}[b]{.45\textwidth} + \includegraphics[width=\textwidth]{fig5-gentle-inflection-before} + \caption{Before applying the inflection rule} + \end{subfigure} + \hfill + \begin{subfigure}[b]{.45\textwidth} + \includegraphics[width=\textwidth]{fig5-gentle-inflection-after} + \caption{After applying the inflection rule} + \end{subfigure} + \caption{Originally Figure 5: gentle inflections at the ends of the bend} + \label{fig:fig5-gentle-inflection} +\end{figure} + \section{Self-line Crossing When Cutting a Bend} \section{Attributes of a Single Bend} diff --git a/notes.txt b/notes.txt index cc8d617..81b64f4 100644 --- a/notes.txt +++ b/notes.txt @@ -1,9 +1,3 @@ -Definition of a bend --------------------- - -Ends of the line should always be bends, otherwise not -all line vertices are covered by bends (definition elsewhere). - Gentle inflection at the end of the bend ----------------------------------------