Passing all children to a sub module

classic Classic list List threaded Threaded
2 messages Options
Ivo
Reply | Threaded
Open this post in threaded view
|

Passing all children to a sub module

Ivo
I'm trying to find a way to pass all children to a sub module. Any hints or tips ?

in pseudocode :

module Thing(parameter,two,three) {
   dothis()
      child(0);
   dothat()
      child(1);
   for(i [2:$children-1]) {
     domore(child(i));
  }
}

module ModifiedThing(modifier,parameter,two,three) {
   transform(modifier)
   Thing(parameter,two,three) {
      allchildren();
   }
}

ModifiedThing([1,2,3],4,5) {
sphere();
  cube();
  sphere();
  cube();
  sphere();
  cube();
  sphere();
  cube();
}

I have a couple of modules that i'd like to split up and simplify.. making wrappers to modules would help.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Passing all children to a sub module

kintel
Administrator
On 2013-05-16, at 07:12 , Ivo wrote:

> I'm trying to find a way to pass all children to a sub module. Any hints or tips ?
>
The child() functionality is limited to sending one child.
This is a good issue to follow which discusses architecture changes to open for better child handling:
https://github.com/openscad/openscad/issues/350

My plan is to prioritize that issue once the upcoming release is out the door.

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566