From 2421c82abe01ed5e10ac7f7f8421c266d8fba904 Mon Sep 17 00:00:00 2001 From: Pierre Alliez Date: Sun, 26 Apr 2009 20:59:43 +0000 Subject: [PATCH] AABB tree: added (commented) example of projection against a set of segments. does not compile for now --- AABB_tree/doc_tex/AABB_tree/AABB_tree_user.tex | 2 +- .../AABB_tree/AABB_segment_3_example.cpp | 15 ++++++++++++++- .../package_info/AABB_tree/description.txt | 2 +- .../package_info/AABB_tree/long_description.txt | 17 +---------------- AABB_tree/package_info/AABB_tree/maintainer | 1 - 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/AABB_tree/doc_tex/AABB_tree/AABB_tree_user.tex b/AABB_tree/doc_tex/AABB_tree/AABB_tree_user.tex index ad075c33b26..3ca4861f357 100644 --- a/AABB_tree/doc_tex/AABB_tree/AABB_tree_user.tex +++ b/AABB_tree/doc_tex/AABB_tree/AABB_tree_user.tex @@ -1,7 +1,7 @@ \section{Introduction} \label{AABB_tree_section_intro} -The AABB tree component offers a data structure and algorithms to perform efficient intersection and projection of 3D queries against a large set of 3D geometric objects. Common examples of intersection queries include a ray or line or segment against a set of triangles, and a plane against a set of segments. A common example of projection query is to find the closest point from a point query to a set of triangles. +The AABB tree component offers a data structure and algorithms to perform efficient intersection and projection of 3D queries against a large set of 3D geometric objects. Common examples of intersection queries include a ray or line or segment against a set of triangles, and a plane or triangle against a set of segments. A common example of projection query is to find the closest point from a point query to a set of triangles. More generally, the set of geometric objects stored in the data structure may be queried for intersection detection, intersection computation and projection with any type of query type, provided that the corresponding intersection predicates and constructors are implemented in the traits class. diff --git a/AABB_tree/examples/AABB_tree/AABB_segment_3_example.cpp b/AABB_tree/examples/AABB_tree/AABB_segment_3_example.cpp index e91c8d5622b..5cb985e2138 100644 --- a/AABB_tree/examples/AABB_tree/AABB_segment_3_example.cpp +++ b/AABB_tree/examples/AABB_tree/AABB_segment_3_example.cpp @@ -35,7 +35,7 @@ typedef K::FT FT; typedef K::Point_3 Point; typedef K::Plane_3 Plane; typedef K::Segment_3 Segment; - +typedef K::Triangle_3 Triangle; typedef std::list::iterator Iterator; typedef CGAL::AABB_segment_primitive Primitive; @@ -55,8 +55,21 @@ int main(void) segments.push_back(Segment(c,d)); Tree tree(segments.begin(),segments.end()); + Plane plane(a,b,d); std::cout << tree.number_of_intersections(plane) << " intersections(s) with plane" << std::endl; + + Triangle triangle(a,b,c); + std::cout << tree.number_of_intersections(triangle) + << " intersections(s) with triangle" << std::endl; + + // TOFIX: following does not compile due to intersection(const Sphere& sphere, + // const P& pr,Projection&...function in AABB_traits.h + + //Point hint(a); + //Point query(2.0, 2.0, 2.0); + //Point closest = tree.closest_point(query,hint); + return 0; } \ No newline at end of file diff --git a/AABB_tree/package_info/AABB_tree/description.txt b/AABB_tree/package_info/AABB_tree/description.txt index b76d801a628..f2cf03e570a 100644 --- a/AABB_tree/package_info/AABB_tree/description.txt +++ b/AABB_tree/package_info/AABB_tree/description.txt @@ -1 +1 @@ -Static collision model for triangle soups. +Data structure for efficient intersection and projection. diff --git a/AABB_tree/package_info/AABB_tree/long_description.txt b/AABB_tree/package_info/AABB_tree/long_description.txt index a2cf4f322f3..bce38d1e5cd 100644 --- a/AABB_tree/package_info/AABB_tree/long_description.txt +++ b/AABB_tree/package_info/AABB_tree/long_description.txt @@ -1,16 +1 @@ -This package implements a collision detection algorithm, using so called AABB trees, -along the lines of - -@article{terdiman2003ooc, - title={{Opcode: Optimized collision detection}}, - author={Terdiman, P.}, - year={2003} -} - -This package will not be documented for CGAL-3.4. It is a stripped down version -of a generic tool (generic in terms of inputs and queries), which is still under -development. It is already added to the trunk because it is used by the Polyhedron -Demo to efficiently remesh polyhedral surfaces. - -For CGAL-3.5, we hope to integrate the fully generic version, for triangle soups and -polylines, with more queries (intersection, projection), parallelism, etc. +This package implements a hierarchy of axi-aligned bounding boxes (AABBs) for efficient intersection and projection of 3D queries against a set of geometric objects. diff --git a/AABB_tree/package_info/AABB_tree/maintainer b/AABB_tree/package_info/AABB_tree/maintainer index ad8500295b1..07cd86a93c9 100644 --- a/AABB_tree/package_info/AABB_tree/maintainer +++ b/AABB_tree/package_info/AABB_tree/maintainer @@ -1,3 +1,2 @@ Camille Wormser Pierre Alliez -Jane Tournois