[OpenSCAD] allowing center= parameter to be a vector of booleans

Chow Loong Jin hyperair at debian.org
Sun May 3 22:02:46 EDT 2015


On Sun, May 03, 2015 at 05:33:53PM -0700, Drew Rogge wrote:
> I often find that I want a cube to be centered about the z axis but sitting on
> the z = 0 xy plane. What do people think of allowing the center= parameter of 2D
> and 3D primitives to be a vector of booleans. That way one could center a
> primitive on whatever axes are desired instead of all or nothing. In my cube
> example I could use:
> 
> cube([10, 20, 5], center=[true, true, false]);
> 
> instead of translate([-5, -10, 0]) cube([10, 20, 5]); or translate([0, 0,
> 2.5]) cube([10, 20, 5]);
> 
> Although not clean it would also be handy if booleans could also be
> represented by zero/non-zero numeric values instead of the verbose "true" and
> "false".
> 
> I'm open to other ways of doing the above if anyone has any suggestions.

This is something that has crossed my mind recently as well, and I quite like
the idea. But the zero/non-zero numeric values should probably not be used, as
that tends to imply a coordinate rather than a bitfield.

-- 
Kind regards,
Loong Jin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20150504/09af15b9/attachment.asc>


More information about the Discuss mailing list