[OpenSCAD] feature request: resize

Whosawhatsis whosawhatsis at gmail.com
Thu Aug 4 15:16:16 CEST 2011


I use a similar method for preparing large objects to be printed in
multiple parts, or to arrange objects and check the size to make sure
it will fit the build area. An example from my portal turret design:

intersection() {	//printable feet
	#linear_extrude(height = 125, convexity = 5) square(100, center = true);
	union() {
		for(side = [1, -1]) rotate([180, 0, side * 135]) translate([0, -12,
0]) front_foot();
		rotate([180, 0, 0]) translate([0, -2, 0]) back_foot();
	}
}

The extruded square with the debug modifier represents the build
volume, and allows me to easily see where my objects fall within it. I
find that extruding a square is the simplest way to make a cube
resting on the center of the x/y plane. I have several blocks like
this in the file for the various plates, and I disable all of them
except the one I want to export using the disable modifier.

On Thu, Aug 4, 2011 at 5:56 AM, Andrew Plumb <andrew at plumb.org> wrote:
> 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/
>
>
> _______________________________________________
> OpenSCAD mailing list
> OpenSCAD at rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>


More information about the OpenSCAD mailing list