AABB trees with faces from several surface meshes

classic Classic list List threaded Threaded
5 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

andreas.fabri

Hello,

Please have a look at

https://doc.cgal.org/latest/AABB_tree/classCGAL_1_1AABB__face__graph__triangle__primitive.html

OneFaceGraphPerTreeis either CGAL::Tag_true or CGAL::Tag_false. In the former case, we guarantee that all the primitives will be from a common FaceGraph and some data will be factorized so that the size of the primitive is reduced. In the latter case, the primitives can be from different graphs and extra storage is required in the primitives. The default is CGAL::Tag_true.


Best,

Andreas

On 12/19/2018 2:00 PM, Lucio Santi wrote:
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
-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri
Reply | Threaded
Open this post in threaded view
|

Re: AABB trees with faces from several surface meshes

lsanti
Thank you, Andreas.

I've already read that page and in fact my code is using OneFaceGraphPerTree set to CGAL::Tag_false. However, the primitive ID is still a plain face index. The class CGAL::SM_Face_index does not seem to have a way of referencing the surface mesh where that face comes from. Am I missing something?

On Wed, Dec 19, 2018 at 10:05 AM Andreas Fabri <[hidden email]> wrote:

Hello,

Please have a look at

https://doc.cgal.org/latest/AABB_tree/classCGAL_1_1AABB__face__graph__triangle__primitive.html

OneFaceGraphPerTreeis either CGAL::Tag_true or CGAL::Tag_false. In the former case, we guarantee that all the primitives will be from a common FaceGraph and some data will be factorized so that the size of the primitive is reduced. In the latter case, the primitives can be from different graphs and extra storage is required in the primitives. The default is CGAL::Tag_true.


Best,

Andreas

On 12/19/2018 2:00 PM, Lucio Santi wrote:
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
-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri
Reply | Threaded
Open this post in threaded view
|

Re: AABB trees with faces from several surface meshes

Sebastien Loriot (GeometryFactory)
Indeed, we did change that in the master branch because it was a bit
restrictive. It will be included in CGAL-4.14 and is available in the
master branch.

See the master documentation here:
https://cgal.geometryfactory.com/CGAL/doc/master/AABB_tree/classCGAL_1_1AABB__face__graph__triangle__primitive.html#a0d5df69b8c98da3befcbf7df511f9a97

The minimal patch is:
https://github.com/CGAL/cgal/pull/3370

Sebastien.



On 12/19/2018 02:25 PM, Lucio Santi wrote:

> Thank you, Andreas.
>
> I've already read that page and in fact my code is using
> OneFaceGraphPerTree set to CGAL::Tag_false. However, the primitive ID is
> still a plain face index. The class CGAL::SM_Face_index does not seem to
> have a way of referencing the surface mesh where that face comes from.
> Am I missing something?
>
> On Wed, Dec 19, 2018 at 10:05 AM Andreas Fabri
> <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hello,
>
>     Please have a look at
>
>     https://doc.cgal.org/latest/AABB_tree/classCGAL_1_1AABB__face__graph__triangle__primitive.html
>
>     OneFaceGraphPerTreeis either |CGAL::Tag_true| or |CGAL::Tag_false|.
>     In the former case, we guarantee that all the primitives will be
>     from a common |FaceGraph
>     <https://doc.cgal.org/latest/BGL/classFaceGraph.html>| and some data
>     will be factorized so that the size of the primitive is reduced. In
>     the latter case, the primitives can be from different graphs and
>     extra storage is required in the primitives. The default is
>     |CGAL::Tag_true|.
>
>
>     Best,
>
>     Andreas
>
>     On 12/19/2018 2:00 PM, Lucio Santi wrote:
>>     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
>
>     --
>     Andreas Fabri, PhD
>     Chief Officer, GeometryFactory
>     Editor, The CGAL Project
>
>     phone: +33.492.954.912    skype: andreas.fabri
>

--
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

lsanti
I've been trying out the patch and so far everything goes as expected. Thank
you!



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

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