discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Any thoughts on a new command "children_for()"

R
royasutton
Fri, Apr 7, 2017 9:17 PM

I often find myself generating objects using for() and later wanting to
perform additional operations on individual child-objects of the result.

For example consider:

This does not work as expected since the loop returns a single child...

How difficult would it be to allow children generated inside the loop to be
returned as a group of children rather than a single child? Either by adding
a option to the for() command or introducing a new command
"children_for()"...

Any thoughts?
Roy

--
View this message in context: http://forum.openscad.org/Any-thoughts-on-a-new-command-children-for-tp21116.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I often find myself generating objects using for() and later wanting to perform additional operations on individual child-objects of the result. For example consider: This does not work as expected since the loop returns a single child... How difficult would it be to allow children generated inside the loop to be returned as a group of children rather than a single child? Either by adding a option to the for() command or introducing a new command "children_for()"... Any thoughts? Roy -- View this message in context: http://forum.openscad.org/Any-thoughts-on-a-new-command-children-for-tp21116.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Fri, Apr 7, 2017 9:55 PM

That's not a simple change, but certainly one from the "most
wanted" list.

See https://github.com/openscad/openscad/issues/350 for some
discussion about that...

ciao,
Torsten.

That's not a simple change, but certainly one from the "most wanted" list. See https://github.com/openscad/openscad/issues/350 for some discussion about that... ciao, Torsten.
MC
Mr C Camacho
Fri, Apr 7, 2017 10:33 PM

Which is why I assume that each iteration is actually independent

On 07/04/17 22:17, royasutton wrote:

I often find myself generating objects using for() and later wanting to
perform additional operations on individual child-objects of the result.

For example consider:

This does not work as expected since the loop returns a single child...

How difficult would it be to allow children generated inside the loop to be
returned as a group of children rather than a single child? Either by adding
a option to the for() command or introducing a new command
"children_for()"...

Any thoughts?
Roy

--
View this message in context: http://forum.openscad.org/Any-thoughts-on-a-new-command-children-for-tp21116.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Which is why I assume that each iteration is actually independent On 07/04/17 22:17, royasutton wrote: > I often find myself generating objects using for() and later wanting to > perform additional operations on individual child-objects of the result. > > For example consider: > > > > This does not work as expected since the loop returns a single child... > > How difficult would it be to allow children generated inside the loop to be > returned as a group of children rather than a single child? Either by adding > a option to the for() command or introducing a new command > "children_for()"... > > Any thoughts? > Roy > > > > -- > View this message in context: http://forum.openscad.org/Any-thoughts-on-a-new-command-children-for-tp21116.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
MC
Mr C Camacho
Fri, Apr 7, 2017 10:37 PM

ah right so that does blow it out of the water, if unions are applied
each loop then each iteration isn't a truly independent event as I
thought it might be...

On 07/04/17 22:55, Torsten Paul wrote:

That's not a simple change, but certainly one from the "most
wanted" list.

See https://github.com/openscad/openscad/issues/350 for some
discussion about that...

ciao,
Torsten.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

ah right so that does blow it out of the water, if unions are applied each loop then each iteration isn't a truly independent event as I thought it might be... On 07/04/17 22:55, Torsten Paul wrote: > That's not a simple change, but certainly one from the "most > wanted" list. > > See https://github.com/openscad/openscad/issues/350 for some > discussion about that... > > ciao, > Torsten. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
TP
Torsten Paul
Fri, Apr 7, 2017 11:05 PM

On 04/08/2017 12:37 AM, Mr C Camacho wrote:

ah right so that does blow it out of the water, if unions are
applied each loop then each iteration isn't a truly independent
event as I thought it might be...

Not sure, but I don't think that's the case. One big challenge
is to get this working without breaking lots of existing
scripts. In general both parallel calculation and returning
the object list instead of the implicit union should be
possible, but needs quite some work.

ciao,
Torsten.

On 04/08/2017 12:37 AM, Mr C Camacho wrote: > ah right so that does blow it out of the water, if unions are > applied each loop then each iteration isn't a truly independent > event as I thought it might be... > Not sure, but I don't think that's the case. One big challenge is to get this working without breaking lots of existing scripts. In general both parallel calculation and returning the object list instead of the implicit union should be possible, but needs quite some work. ciao, Torsten.
MC
Mr C Camacho
Fri, Apr 7, 2017 11:17 PM

you can go too far with backwards compatibility - especially if to
update an old script needs only minimal changes.

I'm not saying this is they way to go, but equally it maybe shouldn't be
discarded out of hand...

On 08/04/17 00:05, Torsten Paul wrote:

On 04/08/2017 12:37 AM, Mr C Camacho wrote:

ah right so that does blow it out of the water, if unions are
applied each loop then each iteration isn't a truly independent
event as I thought it might be...

Not sure, but I don't think that's the case. One big challenge
is to get this working without breaking lots of existing
scripts. In general both parallel calculation and returning
the object list instead of the implicit union should be
possible, but needs quite some work.

ciao,
Torsten.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

you can go too far with backwards compatibility - especially if to update an old script needs only minimal changes. I'm not saying this is they way to go, but equally it maybe shouldn't be discarded out of hand... On 08/04/17 00:05, Torsten Paul wrote: > On 04/08/2017 12:37 AM, Mr C Camacho wrote: >> ah right so that does blow it out of the water, if unions are >> applied each loop then each iteration isn't a truly independent >> event as I thought it might be... >> > Not sure, but I don't think that's the case. One big challenge > is to get this working without breaking lots of existing > scripts. In general both parallel calculation and returning > the object list instead of the implicit union should be > possible, but needs quite some work. > > ciao, > Torsten. > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
R
royasutton
Fri, Apr 7, 2017 11:30 PM

Just reading through the list at the wiki... Details... details... Thank you.

--
View this message in context: http://forum.openscad.org/Any-thoughts-on-a-new-command-children-for-tp21116p21122.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Just reading through the list at the wiki... Details... details... Thank you. -- View this message in context: http://forum.openscad.org/Any-thoughts-on-a-new-command-children-for-tp21116p21122.html Sent from the OpenSCAD mailing list archive at Nabble.com.
MV
Mihail Vasiliev
Sat, Apr 8, 2017 8:41 PM

If you introduce a new grammar unit in some new major release, e.g. "every"
which is equal to "for" but returns a list - you will break only the
scripts, which already use this very word.

8 апр. 2017 г. 2:31 пользователь "royasutton" roy_sutton@hotmail.com
написал:

Just reading through the list at the wiki... Details... details... Thank
you.

--
View this message in context: http://forum.openscad.org/Any-
thoughts-on-a-new-command-children-for-tp21116p21122.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

If you introduce a new grammar unit in some new major release, e.g. "every" which is equal to "for" but returns a list - you will break only the scripts, which already use this very word. 8 апр. 2017 г. 2:31 пользователь "royasutton" <roy_sutton@hotmail.com> написал: > Just reading through the list at the wiki... Details... details... Thank > you. > > > > -- > View this message in context: http://forum.openscad.org/Any- > thoughts-on-a-new-command-children-for-tp21116p21122.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
NH
nop head
Sun, Apr 9, 2017 9:16 AM

I can't imagine many, if any, scripts relying on for to make one child and
it would be very easy to fix by adding union and that would still work with
older versions.

On 8 April 2017 at 21:41, Mihail Vasiliev mickvav@gmail.com wrote:

If you introduce a new grammar unit in some new major release, e.g.
"every" which is equal to "for" but returns a list - you will break only
the scripts, which already use this very word.

8 апр. 2017 г. 2:31 пользователь "royasutton" roy_sutton@hotmail.com
написал:

Just reading through the list at the wiki... Details... details... Thank

you.

--
View this message in context: http://forum.openscad.org/Any-
thoughts-on-a-new-command-children-for-tp21116p21122.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I can't imagine many, if any, scripts relying on for to make one child and it would be very easy to fix by adding union and that would still work with older versions. On 8 April 2017 at 21:41, Mihail Vasiliev <mickvav@gmail.com> wrote: > If you introduce a new grammar unit in some new major release, e.g. > "every" which is equal to "for" but returns a list - you will break only > the scripts, which already use this very word. > > 8 апр. 2017 г. 2:31 пользователь "royasutton" <roy_sutton@hotmail.com> > написал: > > Just reading through the list at the wiki... Details... details... Thank >> you. >> >> >> >> -- >> View this message in context: http://forum.openscad.org/Any- >> thoughts-on-a-new-command-children-for-tp21116p21122.html >> Sent from the OpenSCAD mailing list archive at Nabble.com. >> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >