Welcome! Log In Create A New Profile

Advanced

STL file -> image file?

Posted by captchinland 
STL file -> image file?
December 30, 2011 03:41AM
Hi all,

I'm new to the RepRap community (just got my Prusa Mendel printing), and wasn't able to find anywhere else to ask a question on STL files. I have several hundred STL files I've downloaded/created, and wanted to quickly create images for all of them (in either JPG, GIF, PNG, etc) . Are there any programs that can convert these to images at the command line?

I know I can manually open up each file in a number of programs to take a screenshot, but that seems too time consuming.

Thanks in advance for any help!
Re: STL file -> image file?
December 30, 2011 05:05AM
[thingiverse.com] does that, their website automagically generate preview images from uploaded STLs.

Search in their blog/faq how they do it or ask them.
Re: STL file -> image file?
December 30, 2011 06:35AM
It was Tony Buser who made thingiview while he was working on cloudscad. You can find the source code on github: [github.com] I guess you could hack it, or add a php script or something to cycle through a lot of files, don't have an idea for how to take pictures though.

You might be able to do it in openscad as well. Compile a list of all the stl files, cycle through them with the openscad animation variable and dump pictures along the way? Just an idea, don't know if it'd work.


--
-Nudel
Blog with RepRap Comic
Re: STL file -> image file?
December 30, 2011 08:19AM
try openscad
[www.openscad.org]

you can script it from command line.

...eric
Re: STL file -> image file?
December 30, 2011 10:27AM
or try this:

[www.guitar-list.com]

it works fine for me.
Re: STL file -> image file?
December 30, 2011 04:07PM
Thanks everyone!

Eric1000,

What are the mechanics of the 'output to image' in SCAD at the command line?

I can write a simple script to open an STL: import_stl( 'samplefile.stl');
I just don't know how to write it out to JPG/PNG in OpenSCAD script or at command line (on the other hand, batch output to STL or DXF is much easier). There is a thread on OpenSCAD about how this is difficult to do at command line with a solution for Mac, but this doesn't work on other OSes - see: [github.com]

The one approach I did come up with is to use the Thingiview browser plugin ( [github.com] ) and screenshot the populated canvas element with the 'toDataURL' method of javascript, which produces a PNG or JPG. The pics are great, but this requires running a browser engine at the command line, as you need to access the DOM.
Re: STL file -> image file?
December 31, 2011 01:01AM
eDrawings viewer is free from Solidworks and can open stl files and then save as jpg


__________________________________________________________________________
Experimenting in 3D in New Zealand
Re: STL file -> image file?
January 03, 2012 05:44PM
Thingiview is for the in-browser webgl preview. Thingiverse currently uses stl2pov for the static image files: [github.com] You should be able to use that to convert all your stls to images.


--
Tony Buser http://tonybuser.com * http://reprap.org/wiki/User:Tbuser#Projects
Re: STL file -> image file?
April 28, 2013 06:50PM
Stumbled upon this web based STL to Image converter that does the job.
[stlfoo.lazywasp.net]

It lets you select a local STL file, instantly convert it to a PNG image and save it to your server... Sort of a an automatic thumbnail generator for STL files. It uses Javascript/Html5/PHP for the job.

So if you are looking for a web based solution to convert STL file to image this seems to be the thing available out there.

Cheers!
Re: STL file -> image file?
May 17, 2013 05:01AM
A friend told me to download the free trial of the image SDK.
I t is said to enpower users to re-explore the plugin according to our own requirements.
Dose anyone have any idea about it?
Any suggestion will be appreciated.
Thanks in advance.

Best regards,
Arron
Re: STL file -> image file?
May 17, 2013 08:48AM
eDrawings may work.

If you associate STL files with eDrawings, it may make a snapshot icon for each model.

That way you could have preview of each model like you do picture files.
Re: STL file -> image file?
May 17, 2013 03:15PM
Been writing a fancy script(its just bash, that part sucks a little... but it ends up working fine) to represent designs, where you basically just provide some files and it generates a page. I will probably publish it on github at some point.(It should support thingtracker)

So i too want images from .stls, finding this using povray, i have a little experience in povray too was handy. Kindah cute thing about it is that they also 'slice' with it, well it doesnt generate gcode, but it does generate images of any cross section. (I suppose that writing a slicer from those images is easier than from slicer files but i wouldnt do it. I think decent functions to figure stuff out about the model would be nicer) However, i suppose if you use SLS/that optochemical thing generating those crossection images will be nice!

About websites, it isnt an 'image' per-see but thingiview.js is very nice too. The script uses it with the .stl data 'cached', as in one of the examples. The attached files are an hackish way to use the .php files to generate the list. FTR they're just hackish because I didnt bother figuring out how to get commandline parameters into php.
Attachments:
open | download - json_cli.php_ (585 bytes)
open | download - json_file.sh (250 bytes)
Sorry, only registered users may post in this forum.

Click here to login