Performance of intersection of sphere with cuboid #5276
-
Hello CGAL developers, I have a psuedo-code posted below that seems to perform okay to detect whether a sphere intersects one of two axis-aligned cuboids. In my case, I have many spheres and one only two cuboids. The balls are circumballs of a 3d Delaunay triangulation. I need to repeat this calculation many times and it becomes performance critical for me to get it as fast possible. I'd like to know and would be quite grateful if someone could comment on whether the below psuedo-code is the most performant way of accomplishing this task? Should I rely on some other component of the CGAL library instead? Is there perhaps some better way to take advantage of the kernels/arithmetic type available in CGAL? My coordinates are Cartesian in double precision format. Thank you in advance for any advice or feedback you can provide,
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
if you have many spheres vs only 2 cubes, I would simply add a filter test using bboxes of the cubes + the sphere before doing the test. |
Beta Was this translation helpful? Give feedback.
if you have many spheres vs only 2 cubes, I would simply add a filter test using bboxes of the cubes + the sphere before doing the test.
Something like
CGAL::do_overlap(sphere.bbox(), cube1.bbox())
(storing the bboxes into local object to avoid rebuiding them again and again of course).