I’ve got more half-finished openscad projects than lost left socks and I’ve found it pretty hard to locate specific projects after some time. Opening each individual scad-file just to check feels cumbersome, and writing notes and readmes ain’t exactly my thing unless working on something serious.
I put together a very simple script to generate thumbnail images recursively from .scad files. Very basic, very simple but helps me alot.
Windows and Linux/Unix/etc versions in the comments.
set binfile=“C:\Program Files\OpenSCAD\openscad.exe”
set viewporttranslate=0.00,0.00,0.00
set viewportrotation=55.00,0.00,25.00
set viewdist=400
set options=–imgsize=1024,768 --projection=ortho
echo %~dp0
for /R %%i in (*.scad) do (
if not exist “%%i_out.png” (
echo %%i
%binfile% -o “%%i_out.png” “%%i”
%binfile% -o “%%i_out.png” %options% --camera=%viewporttranslate%,%viewportrotation%,%viewdist% “%%i”
)
)
pause
exit
for i in find . -name "*.scad"
do
if [ ! -f “${i}_out.png” ]
then
echo $i
“${binfile}” -o “${i}_out.png” $options --camera=${viewporttranslate},${viewportrotation},${viewdist} “$i”
fi
done
Place the script at the top of the folder tree you wish to generate thumbnails for. Note that to speed up the run it will not regenerate/overwrite previously generated thumbnails. Delete the thumbs you wish to regenerate before running the script.
@Daniel_ShadowDrakken nope, but I’m sure it can be improved upon by anyone who want more from it. I threw it together last night and it solved my immediate problem on both platforms I work on (Win 8.1 and Ubuntu 12.04).
By changing view to Icons or Thumbnails in pretty much any standard file manager which support png files I find it works well enough for the effort invested
This solves one of my problems (for Win7 and Ubuntu 12.04). Thank you!
I’m waiting for someone with a big brain to solve my other problem: A visual explorer for STL files. I have a large collection of STLs, and many have similar or no-descriptive names. I would love a way to visually sort through them all!
@Daniel_ShadowDrakken Had to run to my other computer and try that. Even upgraded Netfabb Basic. Still no preview icons.
Thanks for the links. I’ll keep looking.
@Carlton_Dodd know it doesn’t help a whole loss but I store my sw files with the same names and you can view the part via icons for sw and they’ll be side by side.
@D_Rob
Yeah, I assume you’re talking about thumbnail images (not familiar with ‘saw’ files). That would work. I was just looking for a more ‘elegant’ solution.
@Carlton_Dodd@Daniel_ShadowDrakken
I had the same question. In interactive mode you can import .stl into OpenScad (and output to whatever), but this doesn’t help for a directory full of .stl’s. Doesn’t look like CLI can handle .stl as input file.