AABB trees with faces from several surface meshes

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

AABB trees with faces from several surface meshes

lsanti
Hello,

I have an AABB tree storing triangular faces coming from different surface mesh instances. I'm using that data structure to compute intersections with rays, but currently the primitive ID that I obtain for each intersection query is just a face index (i.e., an instance of CGAL::Surface_mesh<Point_3>::Face_index). I would like to know which surface mesh this face belongs to. Is there a clean way to do this? I was thinking of providing my own AABB primitive somehow, but I'm not sure if this is the proper way to do it (and in fact I'm not even sure how this can be done).

Thanks in advance for your help,

Lucio
Reply | Threaded
Open this post in threaded view
|

Re: AABB trees with faces from several surface meshes

Pierre Alliez-2
hi Lucio,

you could build a property map, that maps a face ID to each instance.
or you can also provide your own primitive, which would store the
instance ID.

did you try this ?

pierre

Le 19/12/2018 à 06:44, Lucio Santi a écrit :

> Hello,
>
> I have an AABB tree storing triangular faces coming from different
> surface mesh instances. I'm using that data structure to compute
> intersections with rays, but currently the primitive ID that I obtain
> for each intersection query is just a face index (i.e., an instance of
> CGAL::Surface_mesh<Point_3>::Face_index). I would like to know which
> surface mesh this face belongs to. Is there a clean way to do this? I
> was thinking of providing my own AABB primitive somehow, but I'm not
> sure if this is the proper way to do it (and in fact I'm not even sure
> how this can be done).
>
> Thanks in advance for your help,
>
> Lucio


--
Pierre Alliez
Délégué scientifique (head of science)
Inria Project-team TITANE
Inria Sophia Antipolis - Mediterranee
http://www-sop.inria.fr/members/Pierre.Alliez/


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


Reply | Threaded
Open this post in threaded view
|

Re: AABB trees with faces from several surface meshes

Sebastien Loriot (GeometryFactory)
@Pierre, this won't work as here Surface_mesh is used and 2 identical
ids might be associated with 2 different meshes.

The solution is to use set the AABB_tree template parameter
OneFaceGraphPerTree to false.

Sebastien.

On 12/26/2018 05:07 PM, Pierre Alliez wrote:

> hi Lucio,
>
> you could build a property map, that maps a face ID to each instance.
> or you can also provide your own primitive, which would store the
> instance ID.
>
> did you try this ?
>
> pierre
>
> Le 19/12/2018 à 06:44, Lucio Santi a écrit :
>> Hello,
>>
>> I have an AABB tree storing triangular faces coming from different
>> surface mesh instances. I'm using that data structure to compute
>> intersections with rays, but currently the primitive ID that I obtain
>> for each intersection query is just a face index (i.e., an instance of
>> CGAL::Surface_mesh<Point_3>::Face_index). I would like to know which
>> surface mesh this face belongs to. Is there a clean way to do this? I
>> was thinking of providing my own AABB primitive somehow, but I'm not
>> sure if this is the proper way to do it (and in fact I'm not even sure
>> how this can be done).
>>
>> Thanks in advance for your help,
>>
>> Lucio
>
>

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