Hi all,
Being new to openScad I'm exploring its methods with a view to replacing
another CAD program I have.
I have wriiten this:-
----------------------------------------------------
$fn = 50;
module RadialCopy( numCopies, radius)
{
dtr = PI/180;
angStep = 360/numCopies;
for(i=[0:angStep:360])
{
x = radius*cos(i);
y = radius*sin(i);
translate([x,y,0])cylinder(5,1,true);
}
}
// Call the RadialCopy module
RadialCopy( 6, 10);
--------------------------------------------------
which copies a cylinder <numCopies> times around a centre point.
but what if I wanted to copy another object like a sphere or a cube ? I
would have to change the RadialCopy module each time, instead I want to
keep the generality of the module, and pass the object I want to copy as
a parameter.
Can I do this ? I've read a bit about using children but didn't really
understand it or get it to work the way I wanted.
Any advice appreciated.
thanks,
Steve.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org