doug-moen / openscad2

better abstraction mechanisms for OpenSCAD
Boost Software License 1.0
25 stars 3 forks source link

Objects #5

Closed gwadej closed 9 years ago

gwadej commented 9 years ago

In the section Scripts denote Objects, I understand and like the design. But the example got me thinking. What about this?


// lollipop.scad radius = 10; // candy diameter = 3; // stick height = 50; // stick

body = translate([0,0,height]) sphere(r=radius);

staff = cylinder(d=diameter,h=height);

I would probably always want to access the shapes by name, rather than by position in the list. How would be a good way to make this script render correctly. Do I just add:

body; staff;

to the end?

doug-moen commented 9 years ago

Yes.

On 4 June 2015 at 16:27, G. Wade Johnson notifications@github.com wrote:

In the section Scripts denote Objects, I understand and like the design.

But the example got me thinking. What about this?

// lollipop.scad radius = 10; // candy diameter = 3; // stick height = 50; // stick

body = translate([0,0,height]) sphere(r=radius); staff = cylinder(d=diameter,h=height);

I would probably always want to access the shapes by name, rather than by position in the list. How would be a good way to make this script render correctly. Do I just add:

body; staff;

to the end?

— Reply to this email directly or view it on GitHub https://github.com/doug-moen/openscad2/issues/5.

gwadej commented 9 years ago

Cool.