cadhub
cadhub copied to clipboard
Convert openscad renders to jpeg or webp
Images are being sent as png which is not the best web format. jpg should be much smaller, and if we can detect if they're browser supports webp that would be even better. https://stackoverflow.com/questions/5573096/detecting-webp-support#27232658
We'll need to figure a good way of doing this in node.
There's a possibility that compressing the image then sending will take longer than just sending, but I doubt it 🤷
I noticed that it has to re-render each time you rotate the camera - why are the renders being sent as an image? Couldn't they be sent as a 3D model so that you can play around with them in the browser directly via web.gl? e.g. https://threejs.org/examples/webgl_loader_stl.html
This is why.
https://learn.cadhub.xyz/docs/general-cadhub/openscad-previews
It comes up often enough which is why the link has been added to the viewer
Could the explanation be better?
With the backend changes, we'll store artifacts which get around the time it take to make the stl by doing it out of band, so that when viewing other's project it will download the 3d artifact and only go back to images when the code starts being edited again as a live preview.