Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] AABB Primitve_id field

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] AABB Primitve_id field


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] AABB Primitve_id field
  • Date: Tue, 30 Oct 2012 18:23:43 +0100
  • Organization: GeometryFactory

The Primitive_id type depends on the primitive you are using.
It can be an iterator, a pointer or even an integer for example.
It's something that is cheap to keep in the AABB-tree.

Sebastien.

On 10/30/2012 04:00 PM, Manu Kaul wrote:
Hi All,
I am trying out the AABB examples, and was wondering what the
"Primitive_id" was and how I can print out the list of triangle IDs?
Trying out a plane intersection test, and now I want to know the
triangles (their IDs) that have intersected successfully with my query
plane.

Point a(147.8, -90, 700 );
Point b(-90, 28.9, 700 );
Point c(-59.8, 150, 927 );
// counts #intersections with a plane query
Plane plane_query(a,b,c);


std::list<Primitive_id> primitives;
tree.all_intersected_primitives(plane_query,
std::back_inserter(primitives));
for (std::list<Primitive_id>::const_iterator i = primitives.begin();
i != primitives.end(); ++i)
std::cout <<"Test triangle intersects with triangle " << *i <<
std::endl;

std::cout <<"------------------------------" <<std::endl;
std::cout << tree.number_of_intersected_primitives(plane_query)
<< " intersection(s) found." << std::endl;


Cheers,
Manu

--

The greater danger for most of us lies not in setting our aim too high
and falling short; but in setting our aim too low, and achieving our mark.
- Michelangelo




Archive powered by MHonArc 2.6.18.

Top of Page