[OpenSCAD] When modules are cached?

Ronaldo Persiano rcmpersiano at gmail.com
Fri Nov 1 16:09:58 EDT 2019


>
> 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();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20191101/2e9a6c12/attachment.html>


More information about the Discuss mailing list