[OpenSCAD] When modules are cached?

nop head nop.head at gmail.com
Fri Nov 1 16:33:34 EDT 2019


Even if bbox was cached you are calling projection many times and it is the
odd one out as it is a very slow CGAL operation but it produces a 2D
results, so perhaps not cached.

On Fri, 1 Nov 2019 at 20:10, Ronaldo Persiano <rcmpersiano at gmail.com> wrote:

> I think it needs an answer from one of the developers but my guess is that
>> 2D objects are not cached at all. They live in a world of their own with 64
>> bit fixed point numbers. Most 2D operations are blindingly fast compared to
>> the very slow 3D CGAL stuff, so it would normally not give much speed
>> increase to cache them.
>>
>
> If so, I would expect that bbox0() children() in the following version would
> be cached but my tests show the opposite. T() as before.
>
> module complexbbx(p)
>   intersection(){
>     render() projection() bbox0() children();
>     projection() bbox0() children();
>     projection() bbox0() children();
>     projection() bbox0() children();
>     projection() bbox0() children();
>     projection() bbox0() children();
>     projection() bbox0() children();
>     projection() bbox0() children();
>     projection() bbox0() children();
>   }
>
> module bbox0()
>   linear_extrude()
>   intersection() {
>     ext = pow(2,16);
>     hull() {
>       translate([ ext,    0]) children();
>       translate([-ext,    0]) children();
>     }
>     hull() {
>       translate([    0, ext]) children();
>       translate([    0,-ext]) children();
>     }
>   }
>
> projection() bbox0() T();
> complexbbx([1,1]) T();
>
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss at lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20191101/102649e5/attachment.html>


More information about the Discuss mailing list