discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Lazy Unions?

AM
Adrian Mariano
Wed, Sep 27, 2023 11:09 AM

What would extrude_for() do?

On Wed, Sep 27, 2023 at 7:08 AM Martin Axelsen kharar@gmail.com wrote:

Speaking of which...
To me creating an extrude_for() seems quite impossible.

Or is this a totally different thing?

Martin

On Wed, Sep 27, 2023, 11:24 nop head nop.head@gmail.com wrote:

There is intersection_for, so it isn't impossible.

On Wed, 27 Sept 2023, 10:21 Chun Kit LAM, john.lck40@gmail.com wrote:

On 9/26/2023 2:17 PM, Adrian Mariano wrote:

In the case of hull, you write hull(){x;y;z} and the union is
unnecessarily computed and then passed to hull(). This is bad because
hull() is fast whereas union can be very slow, so your code can be 10x
faster with lazy union.  If I recall correctly, the common strategy of
making a rounded cube by doing the hull of 8 spheres is dramatically
faster if you have lazy unions.

I think the semantics change with lazy union is much more important than
performance associated to lazy union. Performance with this is just an
implementation issue.

  1. With manifold backend enabled, hull + union of 8 intersecting
    spheres (i.e. cannot skip union on manifold side) with $fn=256
    took 1.7s, while hull without union took 1s, which is not dramatically
    faster...

  2. We can always optimize hull + union without affecting semantics. We
    already have a bunch of CSG tree rewriting rules for optimization in
    manifold, it is quite trivial to extend them to hull.

I think the name for lazy-union is simply wrong. Laziness will not
change the semantics of a pure functional programming language.
Lazy-union should be renamed into implicit union, which is the real
breaking change. The ability to use for expression to generate a bunch
of stuff and intersect them together is an important usecase, and is
currently impossible to do without 'lazy-union'.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

What would extrude_for() do? On Wed, Sep 27, 2023 at 7:08 AM Martin Axelsen <kharar@gmail.com> wrote: > Speaking of which... > To me creating an extrude_for() seems quite impossible. > > Or is this a totally different thing? > > Martin > > On Wed, Sep 27, 2023, 11:24 nop head <nop.head@gmail.com> wrote: > >> There is intersection_for, so it isn't impossible. >> >> On Wed, 27 Sept 2023, 10:21 Chun Kit LAM, <john.lck40@gmail.com> wrote: >> >>> On 9/26/2023 2:17 PM, Adrian Mariano wrote: >>> > In the case of hull, you write hull(){x;y;z} and the union is >>> > unnecessarily computed and then passed to hull(). This is bad because >>> > hull() is fast whereas union can be very slow, so your code can be 10x >>> > faster with lazy union. If I recall correctly, the common strategy of >>> > making a rounded cube by doing the hull of 8 spheres is dramatically >>> > faster if you have lazy unions. >>> >>> I think the semantics change with lazy union is much more important than >>> performance associated to lazy union. Performance with this is just an >>> implementation issue. >>> >>> 1. With manifold backend enabled, hull + union of 8 *intersecting* >>> spheres (i.e. cannot skip union on manifold side) with $fn=256 >>> took 1.7s, while hull without union took 1s, which is not dramatically >>> faster... >>> >>> 2. We can always optimize hull + union *without affecting semantics*. We >>> already have a bunch of CSG tree rewriting rules for optimization in >>> manifold, it is quite trivial to extend them to hull. >>> >>> I think the name for lazy-union is simply wrong. Laziness will not >>> change the semantics of a pure functional programming language. >>> Lazy-union should be renamed into implicit union, which is the real >>> breaking change. The ability to use for expression to generate a bunch >>> of stuff and intersect them together is an important usecase, and is >>> currently impossible to do without 'lazy-union'. >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
P
pca006132
Wed, Sep 27, 2023 11:22 AM

On Wed, Sep 27, 2023, 7:08 PM Adrian Mariano avm4@cornell.edu wrote:

Wow, manifold really makes a huge difference here.  I am not sure what you
are intending to demonstrate with your timing example.  If union is always
required then lazy union won't be much help.  My findings are below: lazy
union makes disjoint hull 6x faster in this case.  That's significant, but
not nearly as big of an improvement as the situation with manifold turned
off.  But I'd like to have my model preview 1 minute instead of 6 minutes,
so performance remains an issue.

What I want to say is that we can make hull + union as fast as hull without
union, so we should focus on semantics but not performance.

The optimization is not implemented for now (in manifold) because at the
time when I implemented tree rewriting support for manifold, we did not
have hull, but I can do it if you want.

In fact there is a tracking issue for manifold about improving csg_tree
performance, but it requires refactoring the csg_tree and I am currently
working on other stuff (fast 3D offsetting). csg_tree optimization is of
low priority now because users seem to be pretty satisfied with the
performance right now, so I would rather focus on implementing other things
which can provide larger gains. 3D offsetting seems to be the main usecase
for minkowski, and minkowski is terribly slow...

On Wed, Sep 27, 2023, 7:08 PM Adrian Mariano <avm4@cornell.edu> wrote: > Wow, manifold really makes a huge difference here. I am not sure what you > are intending to demonstrate with your timing example. If union is always > required then lazy union won't be much help. My findings are below: lazy > union makes disjoint hull 6x faster in this case. That's significant, but > not nearly as big of an improvement as the situation with manifold turned > off. But I'd like to have my model preview 1 minute instead of 6 minutes, > so performance remains an issue. > What I want to say is that we can make hull + union as fast as hull without union, so we should focus on semantics but not performance. The optimization is not implemented for now (in manifold) because at the time when I implemented tree rewriting support for manifold, we did not have hull, but I can do it if you want. In fact there is a tracking issue for manifold about improving csg_tree performance, but it requires refactoring the csg_tree and I am currently working on other stuff (fast 3D offsetting). csg_tree optimization is of low priority now because users seem to be pretty satisfied with the performance right now, so I would rather focus on implementing other things which can provide larger gains. 3D offsetting seems to be the main usecase for minkowski, and minkowski is terribly slow...
JB
Jordan Brown
Wed, Sep 27, 2023 3:45 PM

On 9/27/2023 2:57 AM, nop head wrote:

Lazy union enables a for loop to generate multiple children so if you
pass the result to a module that uses children() it can index them
individually. Similarly it lets a module return multiple children so
they can be indexed. It is a semantic change, but not just for
performance.

Maybe I just don't understand, but I don't think it does.  (And it
really can't, without huge changes in semantics.)

With 2023.09.25, with lazy-union on, manifold on or off:

module c() {
    echo($children);
    children(0);
    children(1);
}

c() {
    for(i=[1:9]) cube(i);
}

yields

ECHO: 1
WARNING: Children index (1) out of bounds (1 children) in file , line 4

... which it kind of has to, because child modules aren't executed until
you call children().  For for() and other modules to be able to return
individually accessible children would require that the child modules
all be executed before the parent is executed.

On 9/27/2023 2:57 AM, nop head wrote: > Lazy union enables a for loop to generate multiple children so if you > pass the result to a module that uses children() it can index them > individually. Similarly it lets a module return multiple children so > they can be indexed. It is a semantic change, but not just for > performance. Maybe I just don't understand, but I don't think it does.  (And it really can't, without huge changes in semantics.) With 2023.09.25, with lazy-union on, manifold on or off: module c() { echo($children); children(0); children(1); } c() { for(i=[1:9]) cube(i); } yields ECHO: 1 WARNING: Children index (1) out of bounds (1 children) in file , line 4 ... which it kind of has to, because child modules aren't executed until you call children().  For for() and other modules to be able to return individually accessible children would require that the child modules all be executed before the parent is executed.
P
pca006132
Wed, Sep 27, 2023 4:14 PM

On Wed, Sep 27, 2023, 11:45 PM Jordan Brown openscad@jordan.maileater.net
wrote:

Maybe I just don't understand, but I don't think it does.  (And it really
can't, without huge changes in semantics.)

With 2023.09.25, with lazy-union on, manifold on or off:

module c() {
echo($children);
children(0);
children(1);
}

c() {
for(i=[1:9]) cube(i);
}

yields

ECHO: 1
WARNING: Children index (1) out of bounds (1 children) in file , line 4

... which it kind of has to, because child modules aren't executed until
you call children().  For for() and other modules to be able to return
individually accessible children would require that the child modules all
be executed before the parent is executed.

I wonder what semantics changes we need to make it work? I think openscad
is purely functional with no side effects (except echo?), so different
evaluation order should not affect the result?

On Wed, Sep 27, 2023, 11:45 PM Jordan Brown <openscad@jordan.maileater.net> wrote: > Maybe I just don't understand, but I don't think it does. (And it really > can't, without huge changes in semantics.) > > With 2023.09.25, with lazy-union on, manifold on or off: > > module c() { > echo($children); > children(0); > children(1); > } > > c() { > for(i=[1:9]) cube(i); > } > > yields > > ECHO: 1 > WARNING: Children index (1) out of bounds (1 children) in file , line 4 > > ... which it kind of has to, because child modules aren't executed until > you call children(). For for() and other modules to be able to return > individually accessible children would require that the child modules all > be executed before the parent is executed. > I wonder what semantics changes we need to make it work? I think openscad is purely functional with no side effects (except echo?), so different evaluation order should not affect the result? >
NH
nop head
Wed, Sep 27, 2023 4:26 PM

You can pass $ variables to the child so you could change the number of
iterations of the for loop which would be circular if you based it on
$children!

On Wed, 27 Sept 2023 at 17:14, pca006132 john.lck40@gmail.com wrote:

On Wed, Sep 27, 2023, 11:45 PM Jordan Brown openscad@jordan.maileater.net
wrote:

Maybe I just don't understand, but I don't think it does.  (And it really
can't, without huge changes in semantics.)

With 2023.09.25, with lazy-union on, manifold on or off:

module c() {
echo($children);
children(0);
children(1);
}

c() {
for(i=[1:9]) cube(i);
}

yields

ECHO: 1
WARNING: Children index (1) out of bounds (1 children) in file , line 4

... which it kind of has to, because child modules aren't executed until
you call children().  For for() and other modules to be able to return
individually accessible children would require that the child modules all
be executed before the parent is executed.

I wonder what semantics changes we need to make it work? I think openscad
is purely functional with no side effects (except echo?), so different
evaluation order should not affect the result?


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

You can pass $ variables to the child so you could change the number of iterations of the for loop which would be circular if you based it on $children! On Wed, 27 Sept 2023 at 17:14, pca006132 <john.lck40@gmail.com> wrote: > On Wed, Sep 27, 2023, 11:45 PM Jordan Brown <openscad@jordan.maileater.net> > wrote: > >> Maybe I just don't understand, but I don't think it does. (And it really >> can't, without huge changes in semantics.) >> >> With 2023.09.25, with lazy-union on, manifold on or off: >> >> module c() { >> echo($children); >> children(0); >> children(1); >> } >> >> c() { >> for(i=[1:9]) cube(i); >> } >> >> yields >> >> ECHO: 1 >> WARNING: Children index (1) out of bounds (1 children) in file , line 4 >> >> ... which it kind of has to, because child modules aren't executed until >> you call children(). For for() and other modules to be able to return >> individually accessible children would require that the child modules all >> be executed before the parent is executed. >> > > I wonder what semantics changes we need to make it work? I think openscad > is purely functional with no side effects (except echo?), so different > evaluation order should not affect the result? > >> _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
P
pca006132
Wed, Sep 27, 2023 4:41 PM

On Thu, Sep 28, 2023, 12:27 AM nop head nop.head@gmail.com wrote:

You can pass $ variables to the child so you could change the number of
iterations of the for loop which would be circular if you based it on
$children!

Thanks! I guess I should read more about the semantics of OpenSCAD before
discussing such semantics issue... This is too non-standard that my
experience in other languages does not help.

Maybe this will make me sound like a jerk, but from a programming language
point of view I think it would be much better to create something like a
OpenSCAD2, put the old behavior in a compatibility mode, and redesign the
language (if users still think it is desirable to have a domain specific
language for 3D modelling, instead of using general purpose languages). It
seems to me that there are so many design issues and limitations that we
cannot fix without breaking some existing code.

On Thu, Sep 28, 2023, 12:27 AM nop head <nop.head@gmail.com> wrote: > You can pass $ variables to the child so you could change the number of > iterations of the for loop which would be circular if you based it on > $children! > Thanks! I guess I should read more about the semantics of OpenSCAD before discussing such semantics issue... This is too non-standard that my experience in other languages does not help. Maybe this will make me sound like a jerk, but from a programming language point of view I think it would be much better to create something like a OpenSCAD2, put the old behavior in a compatibility mode, and redesign the language (if users still think it is desirable to have a domain specific language for 3D modelling, instead of using general purpose languages). It seems to me that there are so many design issues and limitations that we cannot fix without breaking some existing code. >
FH
Father Horton
Wed, Sep 27, 2023 4:57 PM

There is a project afoot to make a Python version.

On Wed, Sep 27, 2023 at 11:42 AM pca006132 john.lck40@gmail.com wrote:

On Thu, Sep 28, 2023, 12:27 AM nop head nop.head@gmail.com wrote:

You can pass $ variables to the child so you could change the number of
iterations of the for loop which would be circular if you based it on
$children!

Thanks! I guess I should read more about the semantics of OpenSCAD before
discussing such semantics issue... This is too non-standard that my
experience in other languages does not help.

Maybe this will make me sound like a jerk, but from a programming language
point of view I think it would be much better to create something like a
OpenSCAD2, put the old behavior in a compatibility mode, and redesign the
language (if users still think it is desirable to have a domain specific
language for 3D modelling, instead of using general purpose languages). It
seems to me that there are so many design issues and limitations that we
cannot fix without breaking some existing code.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

There is a project afoot to make a Python version. On Wed, Sep 27, 2023 at 11:42 AM pca006132 <john.lck40@gmail.com> wrote: > On Thu, Sep 28, 2023, 12:27 AM nop head <nop.head@gmail.com> wrote: > >> You can pass $ variables to the child so you could change the number of >> iterations of the for loop which would be circular if you based it on >> $children! >> > > Thanks! I guess I should read more about the semantics of OpenSCAD before > discussing such semantics issue... This is too non-standard that my > experience in other languages does not help. > > Maybe this will make me sound like a jerk, but from a programming language > point of view I think it would be much better to create something like a > OpenSCAD2, put the old behavior in a compatibility mode, and redesign the > language (if users still think it is desirable to have a domain specific > language for 3D modelling, instead of using general purpose languages). It > seems to me that there are so many design issues and limitations that we > cannot fix without breaking some existing code. > >> _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
AM
Adrian Mariano
Wed, Sep 27, 2023 8:20 PM

Jordan, my understanding, which I haven't tried to verify, is that the lazy
union option isn't fully implemented, and in particular, that it doesn't
work for passing children into user-defined modules.  That's why your test
fails.  But if it were fully implemented then your test would work and it
could simplify the xor() call.

On Wed, Sep 27, 2023 at 11:46 AM Jordan Brown openscad@jordan.maileater.net
wrote:

On 9/27/2023 2:57 AM, nop head wrote:

Lazy union enables a for loop to generate multiple children so if you pass
the result to a module that uses children() it can index them individually.
Similarly it lets a module return multiple children so they can be indexed.
It is a semantic change, but not just for performance.

Maybe I just don't understand, but I don't think it does.  (And it really
can't, without huge changes in semantics.)

With 2023.09.25, with lazy-union on, manifold on or off:

module c() {
echo($children);
children(0);
children(1);
}

c() {
for(i=[1:9]) cube(i);
}

yields

ECHO: 1
WARNING: Children index (1) out of bounds (1 children) in file , line 4

... which it kind of has to, because child modules aren't executed until
you call children().  For for() and other modules to be able to return
individually accessible children would require that the child modules all
be executed before the parent is executed.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Jordan, my understanding, which I haven't tried to verify, is that the lazy union option isn't fully implemented, and in particular, that it doesn't work for passing children into user-defined modules. That's why your test fails. But if it were fully implemented then your test would work and it could simplify the xor() call. On Wed, Sep 27, 2023 at 11:46 AM Jordan Brown <openscad@jordan.maileater.net> wrote: > On 9/27/2023 2:57 AM, nop head wrote: > > Lazy union enables a for loop to generate multiple children so if you pass > the result to a module that uses children() it can index them individually. > Similarly it lets a module return multiple children so they can be indexed. > It is a semantic change, but not just for performance. > > > Maybe I just don't understand, but I don't think it does. (And it really > can't, without huge changes in semantics.) > > With 2023.09.25, with lazy-union on, manifold on or off: > > module c() { > echo($children); > children(0); > children(1); > } > > c() { > for(i=[1:9]) cube(i); > } > > yields > > ECHO: 1 > WARNING: Children index (1) out of bounds (1 children) in file , line 4 > > ... which it kind of has to, because child modules aren't executed until > you call children(). For for() and other modules to be able to return > individually accessible children would require that the child modules all > be executed before the parent is executed. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
BC
Bob Carlson
Wed, Sep 27, 2023 9:08 PM

I’m still not up to speed apparently. lazy-union is a feature that can be enabled or disabled? What precisely is the semantics of this feature? And the semantics of its absence?

-Bob
Tucson AZ

On Sep 27, 2023, at 08:45, Jordan Brown openscad@jordan.maileater.net wrote:

On 9/27/2023 2:57 AM, nop head wrote:

Lazy union enables a for loop to generate multiple children so if you pass the result to a module that uses children() it can index them individually. Similarly it lets a module return multiple children so they can be indexed. It is a semantic change, but not just for performance.

Maybe I just don't understand, but I don't think it does.  (And it really can't, without huge changes in semantics.)

With 2023.09.25, with lazy-union on, manifold on or off:
module c() {
echo($children);
children(0);
children(1);
}

c() {
for(i=[1:9]) cube(i);
}
yields

ECHO: 1
WARNING: Children index (1) out of bounds (1 children) in file , line 4

... which it kind of has to, because child modules aren't executed until you call children().  For for() and other modules to be able to return individually accessible children would require that the child modules all be executed before the parent is executed.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I’m still not up to speed apparently. lazy-union is a feature that can be enabled or disabled? What precisely is the semantics of this feature? And the semantics of its absence? -Bob Tucson AZ On Sep 27, 2023, at 08:45, Jordan Brown <openscad@jordan.maileater.net> wrote: On 9/27/2023 2:57 AM, nop head wrote: > Lazy union enables a for loop to generate multiple children so if you pass the result to a module that uses children() it can index them individually. Similarly it lets a module return multiple children so they can be indexed. It is a semantic change, but not just for performance. Maybe I just don't understand, but I don't think it does. (And it really can't, without huge changes in semantics.) With 2023.09.25, with lazy-union on, manifold on or off: module c() { echo($children); children(0); children(1); } c() { for(i=[1:9]) cube(i); } yields ECHO: 1 WARNING: Children index (1) out of bounds (1 children) in file , line 4 ... which it kind of has to, because child modules aren't executed until you call children(). For for() and other modules to be able to return individually accessible children would require that the child modules all be executed before the parent is executed. _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org
AM
Adrian Mariano
Wed, Sep 27, 2023 11:00 PM

Lazy union is a feature you can enable in the nightly build dev versions.
It's actually been available for a year or two.

As noted earlier, it should be called no-implicit-union.  When you write a
for() you get an implicit union of the objects generated in each iteration
of the loop.  So code like:

parent() for(i=[0:9]) {mything(i)};

will pass a single object to parent, the union of ten copies of mything.
The parent was hoping to see ten children and do something different with
them you're out of luck.

If we get rid of implicit unions by turning "lazy union" on then the same
code should pass ten separate instances of mything to the parent.  The
parent will have ten children.  It can union them if it wants to, but could
also do something else.

My understanding, as noted earlier, is that "lazy union" isn't actually
fully implemented, so even with it on, you still get implicit unions for
children passed to user-written modules.  But in the case of hull you can
avoid the union, which, before the "manifold" option was available, meant
your code could run 100x faster.  Now it's just 6x faster.

One thing that does happen with the current implementation is that at the
top level there is an implicit union normally so the output STL file
contains one, single object.  If you enable lazy union then the output can
contain multiple, possibly intersecting, objects.

On Wed, Sep 27, 2023 at 5:08 PM Bob Carlson bob@rjcarlson.com wrote:

I’m still not up to speed apparently. lazy-union is a feature that can be
enabled or disabled? What precisely is the semantics of this feature? And
the semantics of its absence?

-Bob
Tucson AZ

On Sep 27, 2023, at 08:45, Jordan Brown openscad@jordan.maileater.net
wrote:

On 9/27/2023 2:57 AM, nop head wrote:

Lazy union enables a for loop to generate multiple children so if you pass
the result to a module that uses children() it can index them individually.
Similarly it lets a module return multiple children so they can be indexed.
It is a semantic change, but not just for performance.

Maybe I just don't understand, but I don't think it does.  (And it really
can't, without huge changes in semantics.)

With 2023.09.25, with lazy-union on, manifold on or off:

module c() {
echo($children);
children(0);
children(1);
}

c() {
for(i=[1:9]) cube(i);
}

yields

ECHO: 1
WARNING: Children index (1) out of bounds (1 children) in file , line 4

... which it kind of has to, because child modules aren't executed until
you call children().  For for() and other modules to be able to return
individually accessible children would require that the child modules all
be executed before the parent is executed.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Lazy union is a feature you can enable in the nightly build dev versions. It's actually been available for a year or two. As noted earlier, it should be called no-implicit-union. When you write a for() you get an implicit union of the objects generated in each iteration of the loop. So code like: parent() for(i=[0:9]) {mything(i)}; will pass a single object to parent, the union of ten copies of mything. The parent was hoping to see ten children and do something different with them you're out of luck. If we get rid of implicit unions by turning "lazy union" on then the same code should pass ten separate instances of mything to the parent. The parent will have ten children. It can union them if it wants to, but could also do something else. My understanding, as noted earlier, is that "lazy union" isn't actually fully implemented, so even with it on, you still get implicit unions for children passed to user-written modules. But in the case of hull you can avoid the union, which, before the "manifold" option was available, meant your code could run 100x faster. Now it's just 6x faster. One thing that does happen with the current implementation is that at the top level there is an implicit union normally so the output STL file contains one, single object. If you enable lazy union then the output can contain multiple, possibly intersecting, objects. On Wed, Sep 27, 2023 at 5:08 PM Bob Carlson <bob@rjcarlson.com> wrote: > I’m still not up to speed apparently. lazy-union is a feature that can be > enabled or disabled? What precisely is the semantics of this feature? And > the semantics of its absence? > > -Bob > Tucson AZ > > > > On Sep 27, 2023, at 08:45, Jordan Brown <openscad@jordan.maileater.net> > wrote: > > On 9/27/2023 2:57 AM, nop head wrote: > > Lazy union enables a for loop to generate multiple children so if you pass > the result to a module that uses children() it can index them individually. > Similarly it lets a module return multiple children so they can be indexed. > It is a semantic change, but not just for performance. > > > Maybe I just don't understand, but I don't think it does. (And it really > can't, without huge changes in semantics.) > > With 2023.09.25, with lazy-union on, manifold on or off: > > module c() { > echo($children); > children(0); > children(1); > } > > c() { > for(i=[1:9]) cube(i); > } > > yields > > ECHO: 1 > WARNING: Children index (1) out of bounds (1 children) in file , line 4 > > ... which it kind of has to, because child modules aren't executed until > you call children(). For for() and other modules to be able to return > individually accessible children would require that the child modules all > be executed before the parent is executed. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >