CSG to glTF Converter
The .gltf file this page produces today is missing its binary buffer files, so Three.js, Babylon.js and other viewers cannot load its geometry. Until that is fixed, convert your OpenSCAD CSG to GLB, which packs the same mesh into a single file that glTF 2.0 loaders such as Three.js and Babylon.js read.
Download Started!
How would you rate your experience with MiConvert?
What happens when you convert CSG to glTF today
OpenSCAD's .csg export stores a design as a readable list of primitives combined by unions, differences and intersections. Web 3D libraries cannot evaluate that list; they need triangles, and glTF is the format they load. A glTF model comes in two packagings: a .gltf JSON file with separate .bin buffer files beside it, or a single binary .glb that holds everything.
The conversion works up to the last step. FreeCAD 1.1 rebuilds the CSG tree as exact solids on our servers and triangulates them, and the glTF writer stores the geometry in two buffer files named gltf_buffer_0.bin and gltf_buffer_1.bin. Our packaging step only bundles files that share the output's name, so those buffers are left behind. What you download is a .gltf pointing at binary data you never receive. This is a known issue with no fix date yet, and this page will be updated when it is fixed.
The working route is our CSG to GLB converter. It uses the same reader and the same mesh, written as one binary file, so nothing can go missing in packaging. glTF 2.0 loaders, including Three.js's GLTFLoader and the Babylon.js loader, open .glb directly. If you specifically need a text .gltf, import the GLB into Blender and export it with the glTF Separate format, which writes the .gltf and its .bin side by side.
Know what the GLB contains before relying on it. It holds one mesh node with no materials, named after a temporary file rather than your design, so OpenSCAD color() values and part separation are gone. Triangles follow a fixed 0.1 mm and 0.5 radian tolerance with no user setting. Spheres are exact before meshing, and cylinders with $fn from 3 to 16 keep their flat sides. The coordinates are OpenSCAD's millimeters with Z up, written into a format that assumes meters and Y up, so the model opens 1000 times too large and tipped onto its back.
If you want an OpenSCAD part in a product configurator, an online preview or a documentation page, GLB covers that today, with a short scale and rotation correction in your viewer code. CSG here means OpenSCAD's constructive solid geometry export, not Counter-Strike (CS:GO) files.
How to get a working glTF model from a CSG file
- Export your design from OpenSCAD with File > Export > Export as CSG; the .scad file itself cannot be uploaded.
- Open MiConvert's CSG to GLB converter instead of this page, which still delivers a .gltf without its buffers.
- Upload the .csg. Designs that call hull(), minkowski(), text(), import(), surface() or projection() are refused, so remove those or export a mesh from OpenSCAD first.
- Download the .glb within about 4 hours, after which it is deleted.
- Load the GLB as it is, or turn it into .gltf plus .bin in Blender with the glTF Separate export format.
- Scale the model by 0.001 and rotate it -90 degrees around X so it stands upright at its modeled size.
What works and what does not on this route
- Working: FreeCAD 1.1 reads OpenSCAD CSG exports without the OpenSCAD program, rebuilding spheres exactly and cylinders as true round surfaces, except those with $fn from 3 to 16, which stay prisms.
- Working: triangulation at a fixed 0.1 mm chord tolerance and 0.5 radians, identical for small and large parts.
- Not working: the .gltf download omits gltf_buffer_0.bin and gltf_buffer_1.bin, so it cannot be displayed.
- Alternative: the CSG to GLB page writes the same mesh as one self-contained binary file.
- Not converted: units and up axis, so a millimeter part reads as meters and lies on its back in Y-up viewers.
- Refused with a named message: hull(), minkowski(), text(), import(), surface(), projection(), glide() and subdiv().
Video Tutorial
Detailed guide on how to convert CSG files to GLTF quickly, for free, and without losing original quality. Perfect if you need to process file formats, reduce size, or upload files to systems that onl
CSG to glTF questions
Why does the .gltf from this page show nothing or report missing files?
The buffer files that hold its vertices and triangles are not included in the download. A .gltf is only the JSON description; ours references gltf_buffer_0.bin and gltf_buffer_1.bin, which our packaging step currently drops. Convert to GLB instead.
Can I recover the buffers for a file I already downloaded?
No. They were never sent, and the server copy is deleted about 4 hours after conversion. Run the original .csg through the CSG to GLB converter instead.
Is GLB a real substitute for glTF?
Yes. GLB is the binary container defined by the glTF 2.0 specification: the same scene structure, with the geometry stored inside one file instead of beside it. Loaders that read .gltf read .glb as well, and a single file is easier to host on a web page.
Why is the model huge and lying down in Three.js?
No unit or axis conversion is applied. OpenSCAD's millimeters are read as meters, and its Z-up height ends up along the viewer's depth axis. After loading, set the object's scale to 0.001 and its rotation.x to -Math.PI / 2, or apply the same correction once in Blender and export again.
Do OpenSCAD colors come through?
No. The output has no materials, so color() is lost and the whole design arrives as one uncolored mesh. Add materials in your viewer code or in Blender.
My upload failed with a message about hull(), minkowski() or text(). What now?
hull(), minkowski(), text() and projection() need OpenSCAD's own geometry engine, which our importer does not have, and import(), surface(), glide() and subdiv() are refused as well. Render the design in OpenSCAD with F6, export STL or 3MF, and bring that into Blender to export GLB or glTF.
Is my CSG file stored or shared?
Conversion happens on our servers after an HTTPS upload through Cloudflare. Your upload is deleted as soon as the job finishes, and the result is downloadable for about 4 hours, then deleted automatically. Anyone holding the random download link can use it, more than once, until it expires. We log file names, sizes and outcomes, but files are never listed in a gallery or public index.