cadhub icon indicating copy to clipboard operation
cadhub copied to clipboard

Convert openscad renders to jpeg or webp

Open Irev-Dev opened this issue 3 years ago • 2 comments

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 🤷

Irev-Dev avatar Mar 12 '21 20:03 Irev-Dev

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

toddmedema avatar Jan 13 '22 23:01 toddmedema

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 image

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.

Irev-Dev avatar Jan 14 '22 00:01 Irev-Dev