-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenSCAD thumbnails, please #7
Comments
The .scad file thumbnail generation is a complicated task because of some scad files are very high computation and memory demanding. Therefore calculation of the thumbnail image could easily waste out all system resources. |
I will have to admit that I have made one or two that would not "render" on my older machines. The "preview" on those works just fine, but can you get an image from the "preview" instead of the "render"? |
It looks like you can export a PNG file from a "preview". That would work great. I don't think anyone would expect the thumbnails of any file to be made out of a high resolution render when there is a cheap (processing-wise) and easy method available. |
cmd = "openscad -o %s.png --preview --imgsize=%s,%s %s 2> /dev/null; mv %s.png %s" % (fout, size, size, ff, fout, fout) The --preview forces it to generate the image in preview mode. My test file was admittedly a simple one. I do not know if the default behavior is --render or --preview or if it varies based on output dimensions. I do know that the command generated a PNG of my SCAD file. |
It looks like --preview is the default mode. Something with 781 CSG tree elements gets a thumbnail in 21-48 seconds on a Intel(R) Celeron(R) CPU 900 @ 2.20GHz (single core) when I run the command by hand. That is crappy, but it is a complex file on an old machine with 6GB of RAM too. |
https://github.com/nathanielstenzel/stl-thumbnailer I am not sure if I actually had to adjust the STL thumbnail stuff. I had trouble getting it to work. The magic number thing seemed to get it to work for me. It may be my imagination though since I tried a number of things. |
It was easier to just have OpenSCAD called directly for the OpenSCAD thumbnail generation so I switched to that. |
It looks like the Debian version in Linux Mint does not like --preview and expect a specific option to go with --preview. I have not made this thumbnailer work on Linux Mint but I have on Fedora Linux. |
made some fork of the fork, which is made for Fedora 34, supporting stl and scad. dirty but works: https://github.com/vmario89/stl-thumbnailer |
I had trouble with the current version in Ubuntu and found that the code for using openscad was complicated because it had to generate additional temp files. I created a fork that uses stl-thumb and opened #11. Feel free to decline it if you feel like openscad is better. |
If you do not do it already, could you please add OpenSCAD file thumbnail generation?
I know this is meant to be an STL thumbnail generator but if it uses OpenSCAD to make them then it should not be a big hassle. At least I hope not.
The text was updated successfully, but these errors were encountered: