Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] using box_intersection_d for more than one query

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] using box_intersection_d for more than one query


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] using box_intersection_d for more than one query
  • Date: Wed, 14 Sep 2011 08:15:44 +0200

If you are simply doing B1 vs {b1,..,bn} then it might be interesting to
build an AABB_tree with {b1,..,bn} and then use
all_intersected_primitives with B1,B2.

There is no primitive class handling BBox but defining one is not hard
(copy-paste the one for triangle and adapt it to bbox).

The primitive concept is here:
http://www.cgal.org/Manual/beta/doc_html/cgal_manual/AABB_tree_ref/Concept_AABBPrimitive.html
The AABB_tree doc is here:
http://www.cgal.org/Manual/beta/doc_html/cgal_manual/AABB_tree_ref/Class_AABB_tree.html

Sebastien.


Bruno Chareyre wrote:
Something comes to mind... would it work to define B2 within the callback function, or would it fool the sorting algorithm?
void callback(...) { define (*B2); }
box_intersection_d(B1,B2,b1,bN,callback);


On 13/09/11 18:56, Bruno Chareyre wrote:
Hello,

I was wondering if there was a smart way to use box_intersection_d() in this sort of task:
Say, I want to find intersections between box B1 and a set {b1,... bN}, then depending on the result I will define a new box B2 to check again.

The trivial way would be:

box_intersection_d(B1,B1,b1,bN);
Box B2(some result of the callback mechanism)
box_intersection_d(B2,B2,b1,bN);

However, if I understand the algorithm correctly, this will trigger the sorting of {b1,... bN} twice. Correct?
Is there a way to avoid?

Thanks in advance.

Bruno
//
//


--
_______________
Bruno Chareyre
Associate Professor
ENSE³ - Grenoble INP
Lab. 3SR
BP 53 - 38041, Grenoble cedex 9 - France
Tél : +33 4 56 52 86 21
Fax : +33 4 76 82 70 43
________________





Archive powered by MHonArc 2.6.16.

Top of Page