cgal/Packages/Snap_rounding_2/doc_tex/basic/snap.tex

98 lines
3.8 KiB
TeX

% +------------------------------------------------------------------------+
% | CGAL Reference Manual: snapRounding.tex
% +------------------------------------------------------------------------+
% | snap rounding of line segments
% |
% | 9.4.00 Eli Packer
% |
\RCSdef{\snapRoundingRev}{$Revision$}
\RCSdefDate{\snapRoundingDate}{$Date$}
% +------------------------------------------------------------------------+
\ccParDims
% \usepackage{graphics, amssymb,epsfig}
\chapter{Snap Rounding}
\label{chapterSnapRoundibg}
\ccChapterRelease{\snapRoundingRev. \ \snapRoundingDate}\\
\ccChapterAuthor{Eli Packer}
\newcommand{\reals}{{\rm I\!\hspace{-0.025em} R}}
\def\A{{\cal A}}
\def\S{{\cal S}}
% +------------------------------------------------------------------------+
\section{Introduction}
Snap rounding is a well known method for converting
arbitrary-precision arrangements of segments into a fixed-precision
representation. It is classified as a finite precision approximation
technique. This package makes Snap Rounding of line segments in $\reals_2$.
Iterated Snap Rounding is a modification of Snap Rounding. In
Iterated Snap Rounding,
each vertex is at leat half-the-width-of-a-pixel away from any non-incident
edge.
This package provides both Iterated Snap Rounding and Snap Rounding.
\begin{figure}
\begin{center}
\ \psfig{figure=sr1.ps,width=9cm} \
\end{center}
\vspace{-2ex}
\caption{An arrangement of segments before (a) and after (b)
Snap Rounding (hot pixels are shaded)}
\label{fig:sr1}
\end{figure}
\section{What is Snap Rounding/Iterated Snap Rounding}
Given a finite collection $\S$ of segments in the plane, the
arrangement of $\S$ denoted $\A(\S)$ is the subdivision of the plane
into vertices, edges, and faces induced by $\S$. %\cite{arrg-surveys}.
A {\it vertex\/} of the arrangement is either a segment endpoint or
the intersection of two segments. Given an arrangement of segments
whose vertices are represented with arbitrary-precision coordinates,
snap rounding (SR, for short) proceeds as follows. We tile the plane
with a grid of unit squares, {\it pixels}, each centered at a point
with integer coordinates. A pixel is {\it hot\/} if it contains a
vertex of the arrangement. Each vertex of the arrangement is replaced
by the center of the hot pixel containing it and each edge $e$ is
replaced by the polygonal chain through the centers of the hot pixels
met by $e$, in the same order as they are met by $e$.
Figure~\ref{fig:sr1} demonstrates a snap rounding output.
Since in a snap-rounded arrangement, the distance between a vertex and
a non-incident edge can be extremely small compared with the width of a
pixel in the grid used for rounding, this package provides, beside the
usual Snap Rounding, a modification of it, named Iterated Snap Rounding,
which makes the a vertex and a non-incident edge well separated. However,
the guaranteed quality of the approximation in Iterated Snap Rounding
degrades.
Figure~\ref{fig:isr_vs_sr} demonstrates the differences between Iterated
Snap Rounding and Snap Rounding.
\begin{figure}
\begin{center}
\ \psfig{figure=isr_vs_sr.ps,width=13cm} \
\end{center}
\vspace{-2ex}
\caption{An arrangement of segments before (a), after SR (b)
and ISR (c) (hot pixels are shaded)}
\label{fig:isr_vs_sr}
\end{figure}
% +========================================================================+
\section{Examples of Snap Rounding}
% +========================================================================+
The following example generates an Iterated Snap Rounding representation
of an arrangement of four line segments
and a list of points which are the vertices of the resulting polylines.
% \ccIncludeExampleCode{../../examples/Snap_rounding/example.C}
\ccIncludeExampleCode{../../examples/Snap_rounding_2/example.C}
% +--------------------------------------------------------+
% EOF