[OpenSCAD] No bounding box test for union() before entering CGAL?

Parkinbot rudolf at parkinbot.com
Thu Jun 2 17:38:17 EDT 2016

There has been a lot of discussion going on about F6 rendering time. I never
had to fight with a design with many non-intersecting clones, so I didn't do
any testing on it. Now I did - with astonishing results. 

Have a look at this simple code, which F5-displays immediately but
F6-renders several minutes on my machine. It clearly shows that there is not
even a simple boundingbox test done before CGAL invoke.

> for (i = [1:30])
>   for (j = [1:30])
>     translate([i*20, j*20, 0])
>       cylinder(r = 5, h = 10); 

And I'd say from its O(n²) behavior, that also CGAL doesn't seem to make any
effort to use boundingbox tests itself. Maybe this because of the way, how
it is invoked ... 

Wouldn't it speed up things a lot if 
1. boundingbox intersection checks of chached elements were introduced to be
able to call CGAL separately - and multithreaded - for obviously
non-intersecting chunks.
2. to invoke CGAL only once for non-intersecting chached elements occurring
multiple times (= apply last affine mapping after CGAL)

It could also make sense, to introduce a directive (or a switch) for
indicating multiple elements with non intersecting bounding boxes to
OpenSCAD. (conditional analysis) 
Also have a look here:

View this message in context: http://forum.openscad.org/No-bounding-box-test-for-union-before-entering-CGAL-tp17538.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

More information about the Discuss mailing list