[OpenSCAD] feature request: resize

Andrew Plumb andrew at plumb.org
Thu Aug 4 14:56:38 CEST 2011


Something I've been holding off requesting is a "bounding cube" calculating function.  I haven't brought it up because it would likely need the more general ability to assign objects to variables (aka pointers to objects) for efficiency and re-use purposes.

Hypothetical example:

--snip--

module some_object() {
  sphere(r=2, center=true);
  rotate([10,15,34]) cube(size=[1,2,3], center=false);
}

my_object = some_object();
bcube=bounds() my_object;
lower_left_bottom=bcube[0];
upper_right_top=bcube[1];
translate([
	-(upper_right_top[0]+lower_left_bottom[0])/2
	,-(upper_right_top[1]+lower_left_bottom[1])/2
	,-(upper_right_top[2]+lower_left_bottom[2])/2
	]) render() my_object;

--end-snip--

More complex examples would include generating a complex "masking" object once to use repetitively across arrays of dissimilar objects.

On 2011-08-03, at 1:27 PM, Tony Buser wrote:

> Yeah, that's what I usually use actually.  That or replicatorg.
> 
> However, since I do a lot of crazy mashups, in some cases I want to take only a portion of a model and resize it.  A portion that might not be a neat cut along a plane, otherwise I'd use netfabb studio, but I really want to do it all in openscad and save some steps.  Because I'm lazy.
> 
> On Wed, Aug 3, 2011 at 1:22 PM, Whosawhatsis <whosawhatsis at gmail.com> wrote:
> You're on OS X, right? I usually use Pleasant3D to do that type of
> scaling before importing into OpenSCAD.
> 
> On Wed, Aug 3, 2011 at 10:20 AM, Tony Buser <tbuser at gmail.com> wrote:
> > It would make my life a lot easier if you could resize a model to a specific
> > dimension instead of having to figure out the right scale vector.
> > Especially when I import an stl file and want to make it the right size to
> > fit into my design.
> >
> > I'm not sure what the best syntax would be, since most of the time I'd just
> > like to make one axis a specific size and let the other 2 axis resize
> > keeping the same proportions.  However, it might also be nice to be able to
> > stretch each axis independently like you can do with scale().
> >
> >
> > _______________________________________________
> > OpenSCAD mailing list
> > OpenSCAD at rocklinux.org
> > http://rocklinux.net/mailman/listinfo/openscad
> >
> >
> _______________________________________________
> OpenSCAD mailing list
> OpenSCAD at rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
> 
> _______________________________________________
> OpenSCAD mailing list
> OpenSCAD at rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad

--

"The future is already here.  It's just not very evenly distributed" -- William Gibson

Me: http://clothbot.com/wiki/




More information about the OpenSCAD mailing list