AABB tree: benchmark across kernels and updated intersection tests (more accurate).

need to fix compilation issue with EPIC kernel (I guess one include missing)
This commit is contained in:
Pierre Alliez 2009-07-05 13:58:00 +00:00
parent b150ee2114
commit 9772610e5f
5 changed files with 36 additions and 12 deletions

View File

@ -93,7 +93,8 @@ void Scene::update_bbox()
m_bbox = (*it).bbox();
for(; it != m_pPolyhedron->points_end();it++)
m_bbox = m_bbox + (*it).bbox();
std::cout << "done." << std::endl;
std::cout << "done (" << m_pPolyhedron->size_of_facets()
<< " facets)" << std::endl;
}
void Scene::draw()

View File

@ -1,10 +1,15 @@
#ifndef AABB_DEMO_TYPES_H
#define AABB_DEMO_TYPES_H
#include <CGAL/Polyhedron_3.h>
#include <CGAL/basic.h>
//#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
//#include <CGAL/Cartesian.h>
#include <CGAL/Simple_cartesian.h>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Simple_cartesian<double> Kernel; // fastest in experiments
//typedef CGAL::Cartesian<double> Kernel;
//typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT FT;
typedef Kernel::Ray_3 Ray;
typedef Kernel::Line_3 Line;
@ -13,6 +18,8 @@ typedef Kernel::Plane_3 Plane;
typedef Kernel::Vector_3 Vector;
typedef Kernel::Segment_3 Segment;
typedef Kernel::Triangle_3 Triangle;
#include <CGAL/Polyhedron_3.h>
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
#endif // AABB_DEMO_TYPES_H

View File

@ -18,17 +18,17 @@ The surface triangle mesh chosen for benchmarking intersections is the knot mode
\hline
\end{tabular}
The following table measures the number of intersection queries per second on the 14,400 triangle version of the knot mesh model for ray, line, segment and plane queries. Each ray query is generated by choosing a random source point within the bounding box of the mesh and a random vector. A line or segment query is generated by choosing two random points within the bounding box. A plane query is generated by picking a random point within the bounding box and a random normal vector. Note that a plane query generally intersects many triangles of the input surface mesh. This explains the low performance numbers for the intersection functions which enumerate all intersections.
The following table measures the number of intersection queries per second on the 14,400 triangle version of the knot mesh model for ray, line, segment and plane queries. Each ray query is generated by choosing a random source point within the mesh bounding box and a random vector. A line or segment query is generated by choosing two random points inside the bounding box. A plane query is generated by picking a random point inside the bounding box and a random normal vector. Note that a plane query generally intersects many triangles of the input surface mesh. This explains the low performance numbers for the intersection functions which enumerate all intersections.
\begin{tabular}{|l|r|r|r|r|}
\hline
Function & Ray & Line & Segment & Plane \\
Function & Segment & Ray & Line & Plane \\
\hline
do\_intersect() & 164,182 & 171,862 & 177,007 & 217,287 \\
number\_of\_intersected\_primitives() & 89,075 & 90,334 & 104,475 & 10,248 \\
any\_intersection() & 163,657 & 169,989 & 183,011 & 220,203 \\
all\_intersections() & 62,625 & 60,168 & 73,525 & 3,026 \\
all\_intersected\_primitives() & 83,992 & 85,347 & 97,258 & 6,273 \\
do\_intersect() & 142,806 & 140,309 & 152,327 & 231,066 \\
number\_of\_intersected\_primitives() & 144,272 & 141,992 & 153,140 & 230,133 \\
any\_intersection() & 147,468 & 143,230 & 148,235 & 229,336 \\
all\_intersections() & 46,507 & 38,471 & 36,374 & 2,644 \\
all\_intersected\_primitives() & 65,553 & 54,838 & 53,183 & 5,693 \\
\hline
\end{tabular}
@ -52,6 +52,22 @@ Curve \ref{fig:AABB-tree-bench} plots the number of queries per second (here the
\end{figure}
\end{center}
The following table measures the number of \ccc{all_intersections() queries per second on the 14,400 triangle version of the knot mesh model for random segment queries. The \ccc{Simple_cartesian} kernel is substantially faster than the \ccc{Cartesian} kernel.
\begin{tabular}{|l|c|}
\hline
Kernel & #queries/s (all\_intersections() with segment queries)\\
\hline
\ccc{Simple_cartesian<double>} & 46,507 \\
\ccc{Simple_cartesian<float>} & 43,187 \\
\ccc{Cartesian<double>} & 5,335 \\
\ccc{Cartesian<float>} & 5,522 \\
\ccc{Exact_predicates_inexact_constructions} & xxxx \\
\hline
\end{tabular}
\subsection{Distances}
The surface triangle mesh chosen for benchmarking distances is again the knot model in four increasing resolutions obtained through Loop subdivision. In the following table we first measure the tree construction time which includes the construction of the internal KD-tree data structure to accelerate the distance queries (note how the internal KD-tree construction is negligible compared to the AABB tree construction, while it brings an acceleration of up to one order of magnitude). We then measure the number of queries per second for the three types distance queries (\ccc{closest_point}, \ccc{squared_distance} and \ccc{closest_point_and_primitive}) from point queries randomly chosen inside the bounding box.

View File

@ -1,3 +1,3 @@
cleanup.bat
anchor.ppt
teaser.ppt
teaser.ppt

View File

@ -89,7 +89,7 @@ intersection_triangle_segment_aux(const typename K::Segment_3 &s1,
return make_object(make_segment(q1,q2));
}
return Object(); // PA: careful, this code is unreachable
// return Object(); // unreachable
}