-
Notifications
You must be signed in to change notification settings - Fork 167
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
Size of intermediate png files (4096x4096) too large? #158
Comments
Yes it is for anti aliasing taking into account that OpenScad's I don't think it will affect the speed much at all. The time to actually draw the pixels is normally a small fraction of a second as the GUI does it every time you interact with the mouse. Do you see any difference in build times? |
Regarding speed, have you tried the new stl() / dxf() child method that allows views.py to use the STL and DXFs instead of drawing them with CSG. That gives a big speed up for my projects. |
I hadn't noticed the addition of the child handling by As for build time differences using 2048 rather than 4096, I haven't actually done any measurements. I'll try and make time for that at some point. |
I've now done some benchmarks on this. There seems to be about a 10% speed improvement using 2048x2048. I don't think this is from the rendering, I actually think it is from the image comparison. But an improvement is an improvement. If you are concerned about the image quality, have a look at my MaybeCube and BabyCube images - they were all produced at 2048x2048.
|
How can it affect the image comparison when it is the downsized images that are compared, not the larger ones output by OpenSCAD |
Agreed, the second threads in the second image are noticeably worse. I think you can close this issue. (And yes, I'd overlooked that it was the downsized images that were compared.) |
The first pass of image magick that crops and downsizes probably takes a little longer but is only around a second anyway. None of the magick time is included in the times reported. They are just the OpenSCAD times. I just noticed the edge of the ring nuts isn't anti-aliased in the second image and still locks jagged but it is is smooth in the first image. That is a better illustration. Worst case, with 2048 the resampling will be about 1:1 because a lot gets cropped because OpenSCAD's Viewall fits the diagonal of the bounding cube to the vertical size of the viewport to cope with the worst case orientation of the object. So a cube orientated with its diagonal vertical will fill the view but assemblies that are wider than they are tall orientated normally don't.
|
The build system generates intermediate png files with dimensions of 4096x4096. These are then resized down to an image with a maximum dimension of 1024 (plus a tiny image). This is presumably to anti-alias the image.
As an experiment I've changed this to 2048x2048 and have not noticed any deterioration in the quality of the final assembly files.
The motivation for this was primarily for a faster build, but it might also help with issue #137.
The text was updated successfully, but these errors were encountered: