wip fix gentle inflections

This commit is contained in:
Motiejus Jakštys 2021-04-12 10:10:39 +03:00
parent 17a974dc6f
commit 65a91a0ceb
4 changed files with 53 additions and 10 deletions

View File

@ -5,7 +5,9 @@ SLIDES = slides-2021-03-29.pdf
NON_ARCHIVABLES = notes.txt referatui.txt slides-2021-03-29.txt NON_ARCHIVABLES = notes.txt referatui.txt slides-2021-03-29.txt
ARCHIVABLES = $(filter-out $(NON_ARCHIVABLES),$(shell git ls-files .)) 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 .PHONY: test
test: .faux_test test: .faux_test
@ -44,6 +46,17 @@ mj-msc-full.pdf: mj-msc.pdf version.tex $(ARCHIVABLES)
done done
mv .tmp-$@ $@ 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 test-figures.pdf: layer2img.py .faux_test
python ./layer2img.py --group1-table=wm_figures --outfile=$@ 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" \ --group2-where="name='fig8' AND stage='bbends' AND gen=1" \
--outfile=$@ --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 .faux_test: tests.sql wm.sql .faux_db
./db -f tests.sql ./db -f tests.sql
touch $@ touch $@

View File

@ -58,8 +58,8 @@ def main():
group1 = read_layer(args.group1_table, args.group1_where) group1 = read_layer(args.group1_table, args.group1_where)
group2 = read_layer(args.group2_table, args.group2_where) group2 = read_layer(args.group2_table, args.group2_where)
group3 = read_layer(args.group3_table, args.group3_where) group3 = read_layer(args.group3_table, args.group3_where)
c1 = {'cmap': 'coolwarm'} if args.group1_cmap else {'color': ORANGE} c1 = {'cmap': 'coolwarm'} if args.group1_cmap else {'color': BLACK}
c2 = {'cmap': 'coolwarm'} if args.group2_cmap else {'color': BLACK} c2 = {'cmap': 'coolwarm'} if args.group2_cmap else {'color': ORANGE}
c3 = {'cmap': 'coolwarm'} if args.group3_cmap else {'color': GREEN} c3 = {'cmap': 'coolwarm'} if args.group3_cmap else {'color': GREEN}
rc('text', usetex=True) rc('text', usetex=True)

View File

@ -225,7 +225,7 @@ test cases.
\begin{figure}[H] \begin{figure}[H]
\centering \centering
\includegraphics[width=\linewidth]{fig8-definition-of-a-bend} \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} \label{fig:fig8-definition-of-a-bend}
\end{figure} \end{figure}
@ -241,6 +241,27 @@ have such an explanation or illustration.
\section{Gentle Inflection at End of a Bend} \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{Self-line Crossing When Cutting a Bend}
\section{Attributes of a Single Bend} \section{Attributes of a Single Bend}

View File

@ -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 Gentle inflection at the end of the bend
---------------------------------------- ----------------------------------------