CSG to GLB Converter for OpenSCAD .csg Files | MiConvert

CSG to GLB Converter for OpenSCAD Models

Upload the .csg file OpenSCAD exports and download a GLB mesh of its solids. In most glTF viewers the model opens lying on its back, and a design made in millimeters appears 1000 times too large. Models that use hull(), minkowski() or text() cannot be converted here.

📁

Drop your file here

or click to browse

Select File

Max 10 files, 50MB each

SSL Encrypted Auto-deleted No Sign Up 100% Free
CSG → GLB

From an OpenSCAD tree to a GLB mesh

A .csg file is OpenSCAD's export of a model's evaluated tree. It lists the cubes, spheres and cylinders, the transforms, and the unions, differences and intersections your .scad script produced, as plain text with the variables already resolved. Web viewers, three.js scenes and AR previews cannot use that tree. They expect triangles, and triangles are what a GLB carries.

On our servers, FreeCAD 1.1 rebuilds the tree with its OpenSCAD importer, without running OpenSCAD itself. Each primitive becomes an exact solid, and the booleans are computed by FreeCAD's OpenCASCADE kernel. The top-level result is then triangulated at a fixed 0.1 mm chord tolerance and a 0.5 radian angle, and written as binary glTF by trimesh. CSG reading on this site was broken until an October 2026 fix, so this route is recent.

Shapes, cut-outs and proportions come through. Your $fn settings are partly respected. A cylinder or circle with $fn from 3 to 16 is built as a prism with that many sides. Higher or unset values, and every sphere, become true round surfaces that are then meshed at the 0.1 mm tolerance. Colors set with color() and object names are not carried over. The GLB holds one mesh with no material, and only the top-level result of the tree is exported.

Two things change on the way. OpenSCAD and FreeCAD treat Z as up, glTF treats Y as up, and no axis conversion is applied. FreeCAD also reads OpenSCAD units as millimeters while glTF reads meters, so one unit becomes one meter. In practice the model lies on its back and is 1000 times oversized until you rotate and scale it once.

This conversion suits OpenSCAD users who want to show a design on a web page with model-viewer or three.js, send it to someone without OpenSCAD, or place it in an AR preview after fixing orientation and size.

How to convert an OpenSCAD model to GLB

  1. In OpenSCAD, open the .scad file and choose File > Export > Export as CSG. Upload that .csg, because .scad scripts are not accepted.
  2. Before exporting, check the code for hull(), minkowski(), text(), projection(), import(), surface(), glide() and subdiv(). They cannot be rebuilt here. If your design depends on them, follow the mesh route in the FAQ.
  3. For rounder curves in the GLB, set $fn above 16 or leave it unset. Values from 3 to 16 give faceted prisms on purpose.
  4. Upload the .csg above. GLB is already selected as the output.
  5. Download the .glb, then in your viewer, engine or Blender, turn it 90 degrees about the X axis and scale it by 0.001 if it should appear at real size.

What the CSG to GLB route handles

  • Reads OpenSCAD .csg exports with FreeCAD's OpenSCAD importer; the server does not run OpenSCAD
  • Computes unions, differences and intersections as exact solids before meshing, so subtracted holes come out as clean cut-outs rather than overlapping shells
  • Keeps deliberately low $fn values: 3 to 16 sides give the prism you asked for, while other cylinders and all spheres are meshed as true curves
  • Produces one binary .glb with the geometry inside, so there are no side files to lose (the .gltf option currently ships without its buffer files, so use GLB)
  • Names the blocker when a function is unsupported: the error states that hull(), minkowski(), text() or import() stopped the file
  • Checks the result before delivery, so a GLB without any mesh is never handed to you

Video Tutorial

Learn how to change CSG to GLB online incredibly simply and quickly. This tool maintains 100% of your original file's quality. 🔗 Access MiConvert tool here: https://miconvert.com/en/csg-to-glb?utm_s

CSG to GLB questions

Is this for CS:GO or Counter-Strike files?

No. Most searches for csg are about the game. Here, .csg means Constructive Solid Geometry, the text format OpenSCAD exports. Game skins, configs and Counter-Strike assets are not handled by this converter.

My file failed with This CSG file uses hull()/minkowski()/text()/import(). What now?

Those operations need OpenSCAD's own geometry engine, which the converter does not have, so they always fail here. Render the model in OpenSCAD and export STL, OFF, AMF or 3MF from there, since OpenSCAD evaluates those functions itself. Then import that mesh into Blender and use File > Export > glTF 2.0 with the binary GLB format.

What does Invalid project file ... basic_ios::clear: iostream error mean?

That raw FreeCAD message is what .csg uploads returned while CSG reading was broken, before the October 2026 repair. If you still see it, export the .csg again from OpenSCAD. Then open it in a text editor and check that it is readable text with lines such as multmatrix(...) and cube(...). If you get Could not read this 3D file instead, the file has a syntax error, often from hand editing or a cut-off download.

Why is the model lying on its back and huge in the viewer?

The coordinates are written exactly as FreeCAD has them: Z is up, in millimeters. glTF viewers read the same numbers as Y-up meters. A 20 mm cube therefore shows as a 20 meter cube tipped over. Rotate the model 90 degrees about X and scale it by 0.001 in the viewer, engine or Blender.

Do OpenSCAD colors and separate parts come through?

No. The GLB contains one mesh with no material. Separate top-level objects become disconnected pieces of that mesh, and the node carries a temporary file name. Assign colors and split parts in Blender if you need them.

How smooth is the mesh, and can I change it?

Curved surfaces are meshed to within 0.1 mm, with at most about 29 degrees between neighboring facets, and there is no setting for it. For OpenSCAD's own faceting instead, export STL from OpenSCAD and convert that mesh in Blender.

What are the size and batch limits?

Guests can upload files up to 50 MB, free accounts 100 MB, Plus 200 MB and Pro 1 GB. One batch holds 10 files, or 25 on Plus and 50 on Pro. Guests and free accounts can start 10 conversion jobs per hour.

What happens to my .csg file after conversion?

Conversion happens on our servers. Your .csg is removed once its conversion ends, and the GLB stays available for download for about 4 hours before automatic deletion. The download link is a random token that is not tied to an account, so treat it like the file itself. We log file names, sizes and results, and signed-in users see a conversion history entry.