RFE: Transformation to make repositioning easy

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

RFE: Transformation to make repositioning easy

Len Trigg
I find myself often wanting to reposition objects around the origin,
either to center the object, or position it so that one side of it
lines up with the axis line.  For example, import an stl, position it
so that it is centered on X and Y, and so that the bottom of the
object is at Z=0.

Is this somehow possible?  If not, I suggest the following new transformation:

align([x, y, z]) { ... }

Where the value for an axis is 0 (align the left of the object
bounding box with the axis), 0.5 (align the center of the object
bounding box with the axis), 1.0 (align the right of the object
bounding box with the axis). Thus you could simply use align([0.5,
0.5, 0]) to reposition the object ready for typical printing. (or
alternatively, use the range -1 to 1 if that fits better)

>From the command-line documentation, it should then be possible to use
openscad in batch mode to automatically load / reposition / export an
STL as in the above example, ready for printing.

Relatedly, is it also possible from the command line to save a preview
image (I'm thinking of making a gnome nautilus thumbnailer for STL
previews)?

Cheers,
Len.

Reply | Threaded
Open this post in threaded view
|

Re: RFE: Transformation to make repositioning easy

tbuser
On Tue, Aug 10, 2010 at 3:55 AM, Len Trigg <[hidden email]> wrote:
Relatedly, is it also possible from the command line to save a preview
image (I'm thinking of making a gnome nautilus thumbnailer for STL
previews)?

I'd also really like to have a way to set camera position and save an animation frame (and/or several frames) from the command line.  I've been posting designs to the RepRap wiki and it gets kind of tedious to manually create an image.  Sites like thingiverse could use it for thumbnails then as well.  I was also looking into ways to let me create a webpage that allowed you to rotate and view objects from different angles and this would be pretty convenient instead of some of the java applets I was looking at.

Reply | Threaded
Open this post in threaded view
|

Re: RFE: Transformation to make repositioning easy

Steve Klabnik
I was looking into this a few months back and didn't get around to
finishing it; it shouldn't be that bad, as there is already the whole
set of 'animation' functions that exports a series of PNGs.

Until WebGL comes around (which I hear should be the end of the year),
I think the 'here's 6 or 8 views' is the best way to go.

Reply | Threaded
Open this post in threaded view
|

Re: RFE: Transformation to make repositioning easy

tbuser
On Tue, Aug 10, 2010 at 12:44 PM, Steve Klabnik <[hidden email]> wrote:
I was looking into this a few months back and didn't get around to
finishing it; it shouldn't be that bad, as there is already the whole
set of 'animation' functions that exports a series of PNGs.

Until WebGL comes around (which I hear should be the end of the year),
I think the 'here's 6 or 8 views' is the best way to go.

Yeah, I was looking at the CopperLicht webgl engine that says it supports STL files... but turns out you need to use their comercial program to convert the STL file first which is totally misleading.  Then I thought maybe it would be cool to convert STL -> VRML... but then you have to deal with plugins.  I was also thinking of using like Blender or Meshlab to convert STL -> OBJ and then using Papervision3D to view them... but then it's flash which kind of sucks.  I tried a few Java applets that view STL... but they were all buggy.  In the end I think just using Javascript to cycle through a few images at different angles would be the best thing to try next.