Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] AABBTree primitives or objects problem

Subject: CGAL users discussion list

List archive

[cgal-discuss] AABBTree primitives or objects problem


Chronological Thread 
  • From: <>
  • To:
  • Subject: [cgal-discuss] AABBTree primitives or objects problem
  • Date: Thu, 3 Dec 2009 17:03:33 +0100 (CET)

Hi,
I am working with a polyhedron_3, searching in it with an AABBTree. The
polyhedron is 2-Manifold and pure triangular mesh. My question is if I try to
use a Segment_3 that I know, in advanced, intersects in one vertice (with 5
facets around it) the tree.number_of_intersected_primitives(Segment) gives me
5
intersections. But if I use the code to test what type of objects are. only 3
are Point_3. What are the other 2?

This is is the code that I am using:
S is Segment_3
tree is AABBTree

std::cout << tree.number_of_intersected_primitives(S)
<< " intersection(s)" << std::endl;

std::list<Object_and_primitive_id> intersections;
tree.all_intersections(S, std::back_inserter(intersections));

std::list<Object_and_primitive_id>::iterator it;
std::cout << "intersections contains:\n";
for ( it=intersections.begin() ; it != intersections.end(); it++ ){
Object_and_primitive_id op = *it;
CGAL::Object object = op.first;
Point_3 point;
if(CGAL::assign(point,object))
std::cout << "intersection object is a point : " << point <<
std::endl;

Segment segment;
if(CGAL::assign(segment,object))
std::cout << "intersection object is a segment : " << segment <<
std::endl;

}



Archive powered by MHonArc 2.6.16.

Top of Page