exaggeration step and visuals

This commit is contained in:
Motiejus Jakštys 2021-05-19 22:57:50 +03:00 committed by Motiejus Jakštys
parent 38cdce820c
commit 7b31e4fdcf
4 changed files with 57 additions and 25 deletions

View File

@ -1070,7 +1070,7 @@ The smaller the distance $d$, the more similar the bends are.
Figure~\ref{fig:elimination-through-iterations} illustrates steps of figure 8 Figure~\ref{fig:elimination-through-iterations} illustrates steps of figure 8
from the original paper. There is not much to add to the original description from the original paper. There is not much to add to the original description
beyond an illustrated example. beyond repeating the elimination steps in an illustrated example.
\begin{figure}[ht] \begin{figure}[ht]
\centering \centering
@ -1092,11 +1092,39 @@ beyond an illustrated example.
\subsection{Combination Operator} \subsection{Combination Operator}
NOTE: not implemented. Combination operator was not implemented in this version.
\subsection{Exaggeration Operator} \subsection{Exaggeration Operator}
NOTE: implemented, explain. Also {\textsc intersection\_tolerance} parameter. Exaggeration operator finds bends whose \textsc{adjusted size} is smaller than
the incoming parameter --- \textsc{half-circle diameter}. Once it finds the
bend, it will exaggerate it in increments until either becomes true:
\begin{itemize}
\item \textsc{adjusted size} of the exaggerated bend is larger than area of
the half-circle.
\item The exaggerated bend starts intersecting with a neighboring bend. Then,
\end{itemize}
Exaggeration operator requires a constant \textsc{exaggeration step} $s$, which
should be between 1 and 2. It was arbitrarily picked to \exaggerationEnthusiasm
for this implementation. A single exaggeration increment is done as follows:
\begin{enumerate}
\item Find a candidate bend.
\item Find the bend's baseline.
\item Find \textsc{midpoint}, the center of the bend's baseline.
\item Mark each bend's vertex with a number between $[1,s]$. The number is
derived with elements linearly interpolated between the start and
mid-points of the bend. The other half of the bend, from mid-point to
the final vertex, is linearly interpolated between $[s,1]$.
\item Each point will be placed farther away from the baseline. The length
of misplacement is the marked value in the previous step. I.e.
\end{enumerate}
\section{Program Implementation} \section{Program Implementation}

View File

@ -61,26 +61,6 @@ begin
ways = array((select way from wm_debug where stage=_stage and name=_name order by id)); ways = array((select way from wm_debug where stage=_stage and name=_name order by id));
end $$ language plpgsql; end $$ language plpgsql;
do $$
declare fig6b1 geometry;
declare fig6b2 geometry;
declare sclong geometry;
declare scshort geometry;
begin
delete from wm_visuals where name like 'fig6-%' or name like 'selfcrossing-1%';
select way from wm_debug where name='fig6' and stage='bbends' and gen=1 into fig6b1 limit 1 offset 0;
select way from wm_debug where name='fig6' and stage='bbends' and gen=1 into fig6b2 limit 1 offset 2;
insert into wm_visuals (name, way) values('fig6-baseline', st_makeline(st_startpoint(fig6b2), st_endpoint(fig6b2)));
insert into wm_visuals (name, way) values('fig6-newline', st_makeline(st_endpoint(fig6b1), st_endpoint(fig6b2)));
select way from wm_debug where name='selfcrossing-1' and stage='bbends' and gen=1 into sclong limit 1 offset 1;
select way from wm_debug where name='selfcrossing-1' and stage='bbends' and gen=1 into scshort limit 1 offset 4;
insert into wm_visuals (name, way) values('selfcrossing-1-baseline', st_makeline(st_startpoint(sclong), st_endpoint(sclong)));
insert into wm_visuals (name, way) values('selfcrossing-1-newline', st_makeline(st_startpoint(sclong), st_endpoint(scshort)));
end $$ language plpgsql;
do $$ do $$
declare declare
vbends geometry[]; vbends geometry[];

View File

@ -9,13 +9,17 @@ BEGIN { FS="[(); ]" }
/isolation_threshold constant real default / { /isolation_threshold constant real default / {
x2 += 1; x2 += 1;
d2 = sprintf("\\newcommand{\\isolationThreshold}{%.2f}",$7); d2 = sprintf("\\newcommand{\\isolationThreshold}{%.2f}",$7);
}
/scale constant float default / {
x3 += 1;
d3 = sprintf("\\newcommand{\\exaggerationEnthusiasm}{%.1f}",$7);
} }
END{ END{
if(x1 == 1 && x2 == 1) { if(x1 == 1 && x2 == 1 && x3 == 1) {
print d1 > "vars.inc.tex" print d1 > "vars.inc.tex"
print d2 >> "vars.inc.tex" print d2 >> "vars.inc.tex"
print d3 >> "vars.inc.tex"
} else { } else {
exit 1 exit 1
} }

View File

@ -80,6 +80,26 @@ insert into wm_visuals(name, way) values('salvis', (
) )
)); ));
do $$
declare fig6b1 geometry;
declare fig6b2 geometry;
declare sclong geometry;
declare scshort geometry;
begin
delete from wm_visuals where name like 'fig6-%' or name like 'selfcrossing-1%';
select way from wm_debug where name='fig6' and stage='bbends' and gen=1 into fig6b1 limit 1 offset 0;
select way from wm_debug where name='fig6' and stage='bbends' and gen=1 into fig6b2 limit 1 offset 2;
insert into wm_visuals (name, way) values('fig6-baseline', st_makeline(st_startpoint(fig6b2), st_endpoint(fig6b2)));
insert into wm_visuals (name, way) values('fig6-newline', st_makeline(st_endpoint(fig6b1), st_endpoint(fig6b2)));
select way from wm_debug where name='selfcrossing-1' and stage='bbends' and gen=1 into sclong limit 1 offset 1;
select way from wm_debug where name='selfcrossing-1' and stage='bbends' and gen=1 into scshort limit 1 offset 4;
insert into wm_visuals (name, way) values('selfcrossing-1-baseline', st_makeline(st_startpoint(sclong), st_endpoint(sclong)));
insert into wm_visuals (name, way) values('selfcrossing-1-newline', st_makeline(st_startpoint(sclong), st_endpoint(scshort)));
end $$ language plpgsql;
do $$ do $$
declare declare
i integer; i integer;