Converting colour OpenSCAD render to gLTF

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Converting colour OpenSCAD render to gLTF

Hi everyone. We have been working on creating our assembly instruction for the OpenFlexure microscope in OpenSCAD. Something that I know others do using NopSCADlib. I was thinking it would be fantastic if we could export the assemblies as full colour gLTF files that are easy to render in a browser.

Turns out using a similar method to the "colorscad" script I found on GitHub, I have made a python program that should create a binary gLTF file (.glb) which can then be embedded into a website and viewed using one of the many Threejs gLTF viewers.

pip install scad2gltf
scad2gltf myfile.scad
The repository for the code is: Here is screenshot of a gLTF generated from a .scad file: