Wrote section on auxiliary geometric algorithms.

This commit is contained in:
Lutz Kettner 2004-04-13 23:59:44 +00:00
parent 2151d2fed4
commit a997e05f94
2 changed files with 106 additions and 32 deletions

View File

@ -3,36 +3,13 @@
There are geometric algorithms available in \cgal, not directly There are geometric algorithms available in \cgal, not directly
processing a mesh, but that can be helpful in the mesh processing processing a mesh, but that can be helpful in the mesh processing
context, for example, a fast self intersection test, the smallest context, for example, a fast self intersection test, the smallest
enclosing sphere, or the minimum width of a point set. enclosing sphere, or the minimum width of a point set. We use a few
large meshes (see Fig.~\ref{fig:models}) to evaluate performance on a
The self intersection test is based on the general algorithm for fast laptop with an Intel Pentium4 Mobile CPU running at 1.80GHz with 512KB
box intersections~\cite{cgal:ze-fsbi-02}, applied to the bounding cache and 254MB main memory under Linux. For our largest mesh, the
boxes of individual facets, i.e. triangles, as a filtering step. The Raptor, the algorithms started swapping. Nevertheless, the runtimes
triangles of intersecting boxes are then checked in detail, i.e., if are acceptable. For the final paper, we can in addition run the
they share common edge, they do not intersect, if they share a common experiments on a larger machine.
vertex, the may intersect or not depending on the opposite edge, and
otherwise the intersection test for triangles in the \cgal\ geometric
kernel is used to decide the intersection. A geometric kernel with
exact predicates is sufficient for this algorithm.
if they are not adjacent in the data structur
boxes that are reported as are then
\paragraph{Smallest enclosing spheres} are commonly used as bounding
volumes, for example, to speed up intersection tests.
All 7 digits after the decimal are identical between the exact and the
double implementation.
% \begin{tabular}{l|ll}
% \textbf{smallest enclosing sphere} & \texttt{double} & exact
% \texttt{qmpq} (non opt.)\\\hline
% Bunny & 0.02 & 14 \\
% Lion vase & 0.15 & 396 \\
% David & 0.13 & 215 \\
% Raptor & 0.35 & 589
% \end{tabular}
% models used for benchmarking % models used for benchmarking
\begin{figure} \begin{figure}
@ -47,8 +24,20 @@ double implementation.
\label{fig:models} \label{fig:models}
\end{figure} \end{figure}
\paragraph{Convex hulls} are commonly used as bounding
volumes, for example, to speed up intersection tests. The self intersection test is based on the general algorithm for fast
box intersections~\cite{cgal:ze-fsbi-02}, applied to the bounding
boxes of individual facets, i.e. triangles, as a filtering step. The
triangles of intersecting boxes are then checked in detail, i.e., if
they share common edge, they do not intersect, if they share a common
vertex, the may intersect or not depending on the opposite edge, and
otherwise the intersection test for triangles in the \cgal\ geometric
kernel is used to decide the intersection. A geometric kernel with
exact predicates is sufficient for this algorithm. Interestingly, only
the lion vase is free of self intersections. The algorithm is fast,
see the table below, though not sufficient for interactive use.
Nevertheless, a final quality check is possible for quite large meshes
before they, for example, go into production.
\noindent\hspace*{-3mm}% \noindent\hspace*{-3mm}%
{\small {\small
@ -65,6 +54,61 @@ volumes, for example, to speed up intersection tests.
\end{tabular} \end{tabular}
} }
Smallest enclosing spheres, min.~sphere for short, are commonly used
as bounding volumes in bounding volume hierarchies, for example, to
speed up intersection tests. This algorithm~\cite{minsphere} needs a
geometric kernel with an exact number type. We use \CodeFmt{gmpq} from
the GMP number type package here~\cite{cgal:g-gmpal-96}. The runtimes
are slow, but still feasible for huge meshes. In contrast, when we run
the algorithm with the \CodeFmt{double} number type, it becomes fast
enough to be considered for interactive purposes, for example,
selecting a good view frustrum in a viewer. We compared the resulting
spheres of the algorithm run with the exact and with the floating-point number
type. In all cases the sphere center coordinates and the radius
where exactly the same up to the seven digits after the
decimal. Nonetheless it must be said that the \CodeFmt{double} version
can fail here. We want to point out the running time anomaly in above
table---the smaller lion vase needs longer than the larger david
sculpture---which is o.k. for this data sensitive algorithm. It is
worst-case linear time, but depends on a heuristic to be really fast.
% \begin{tabular}{l|ll}
% \textbf{smallest enclosing sphere} & \texttt{double} & exact
% \texttt{qmpq} (non opt.)\\\hline
% Bunny & 0.02 & 14 \\
% Lion vase & 0.15 & 396 \\
% David & 0.13 & 215 \\
% Raptor & 0.35 & 589
% \end{tabular}
Convex hulls are, similar to the smallest enclosing sphere, sometimes
useful as a bounding volumes, for example, as a placeholder for faster
interaction. For the quickhull algorithm~\cite{bdh-qach-96} used here
in \cgal\ a \cgal\ geometric kernel with exact predicates suffices,
and the convex hull can be computed significantly faster than the
exact smallest enclosing sphere, however, also far slower than the
\CodeFmt{double} version of the smallest enclosing sphere.
In fact we are more interested in the convex hull as a preprocessing
to another optimization algorithm, the width of a point set. The
minimum width is obtained by two parallel planes of smalles possible
distance that enclose all point between them. The printing time for
three-dimensional stereo-lithographic printer is proportional to the
height of the object printed. Minimizing this height can be done by
computing the normal direction that minimizes the width between the
two planes, and then align this normal direction with the printer
height direction.
The width algorithm requires an exact number type, so we use the
result of the convex hull computation, convert all vertices to exact
points, recompute the convex hull, and run the width algorithm. The
runtimes in the table above are for the conversion, recomputing of the
convex hull and the width computation together, but excluding the
first convex hull computation that runs on the full data set.
% \begin{tabular}{l|l} % \begin{tabular}{l|l}
% & \textbf{self intersection} \\\hline % & \textbf{self intersection} \\\hline
% Bunny & 3.2 \\ % Bunny & 3.2 \\

View File

@ -2,6 +2,36 @@
% == Data structures ====================================== % == Data structures ======================================
%====================================================== %======================================================
@article{bdh-qach-96
, author = "C. Bradford Barber and David P. Dobkin and Hannu Huhdanpaa"
, title = "The {Quickhull} Algorithm for Convex Hulls"
, journal = "ACM Trans. Math. Softw."
, volume = 22
, number = 4
, month = dec
, year = 1996
, pages = "469--483"
, succeeds = "bdh-qach-93"
, update = "01.04 icking, 98.03 icking"
}
@manual{ cgal:g-gmpal-96
,author = "T. Granlund"
,title = "{GNU MP}, The {GNU} Multiple Precision Arithmetic Library,
version 2.0.2"
,month = jun
,year = 1996
}
@article{ cgal:ze-fsbi-02
,author = "Afra Zomorodian and Herbert Edelsbrunner"
,title = "Fast Software for Box Intersection"
,journal = "Int. J. Comput. Geom. Appl."
,year = 2002
,volume = 12
,pages = "143--172"
}
@inproceedings{ bksv-agppd-00, @inproceedings{ bksv-agppd-00,
author = {H. Br{\"o}nnimann and L. Kettner and author = {H. Br{\"o}nnimann and L. Kettner and
S. Schirra and R. Veltkamp}, S. Schirra and R. Veltkamp},