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: Manu Kaul <>
  • To:
  • Subject: Re: [cgal-discuss] AABB Primitve_id field
  • Date: Wed, 31 Oct 2012 09:08:59 +0100

Hi,
So the problem I seem to be having is that I would like to do a polygonal query to
my AABB tree which contains 3D triangles. But picking 3 points form the polygon
and setting up a plane to query is having the side-effect that it intersects with too
many triangles that I don't actually need. So what I actually want is a polygonal
face/plane in 3D that I can use as my query object to check what triangles intersect
with it. Can someone please assist me with some sample code on this one?

Cheers,
Manu

On Wed, Oct 31, 2012 at 8:30 AM, Manu Kaul <> wrote:
I have stored 3D triangles in the AABB tree (typedef K::Triangle_3 Triangle) .
And then I do an intersection query with a plane (typedef K::Plane_3 Plane) using
tree.all_intersected_primitives(plane_query, std::back_inserter(primitives));
Are the intersections computed in 3D? I know that in postgis 2.0, they compute
this intersection by projecting to the x-y plane and then computing intersections.
I need exactly all the 3D triangles that are intersecting with my plane, and not the
ones that are above or below this query plane that might project on the same plane.

Thanks,
Manu

 

On Tue, Oct 30, 2012 at 6:23 PM, Sebastien Loriot (GeometryFactory) <> wrote:
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


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss





--

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



--

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