CSG to STL Converter for OpenSCAD CSG Files - MiConvert

Convert OpenSCAD CSG to STL

Upload a .csg file exported from OpenSCAD and get an STL of the finished model, rebuilt by FreeCAD as exact solids and then meshed. Models that use hull(), minkowski(), text() or projection() cannot be converted here; export STL from OpenSCAD for those.

📁

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 → STL

Printing a photo instead?

Turn a picture into a lithophane or relief STL that glows when light shines through it. It is built in your browser, and the photo is never uploaded. Lithophane maker →

Why Convert CSG to STL, and How the Model Is Rebuilt

A .csg file is OpenSCAD's flattened model: your .scad script after variables, loops and modules have been evaluated, written out as a plain tree of primitives (cube, sphere, cylinder, polyhedron), transforms (multmatrix) and booleans (union, difference, intersection). It describes how to build the shape rather than the shape's surface, so a slicer has nothing to slice. FreeCAD's OpenSCAD workbench can write the same format.

The converter parses the tree on our server with the CSG importer from FreeCAD 1.1's OpenSCAD workbench, builds each primitive as an exact solid, and performs the booleans with OpenCASCADE. Only the top-level results are kept, so leftover operands never end up in the print. The finished solids are tessellated within 0.1 mm of their exact surfaces and written as binary STL, using the numbers from your OpenSCAD model, which slicers read as millimeters.

Because the shapes are rebuilt rather than copied from OpenSCAD's own mesh, the triangles will not match an STL exported by OpenSCAD. Spheres always become true spheres, whatever $fn says. Cylinders with $fn between 3 and 16 stay polygonal prisms as written, while unset or higher $fn values become true cylinders. The tessellation, not $fn, then sets how many facets a curved surface gets.

Some operations need the OpenSCAD program itself to evaluate them, and it is not installed on our servers: hull(), minkowski(), text(), projection() and a few rarer ones. A file that uses import() or surface() refers to other files on your disk, which one upload cannot include. In each case the conversion stops with a message naming the operation, rather than delivering a different model. Files with syntax errors or cut-off text fail as unreadable.

This suits anyone with a .csg from a model download, a project archive or FreeCAD's OpenSCAD workbench who has no OpenSCAD install at hand, or who wants exact solid geometry meshed at a known tolerance.

How to Convert CSG to STL

  1. In OpenSCAD, open the .scad file and use File > Export > Export as CSG. If OpenSCAD is already open and you only need a printable file, Export as STL there works just as well.
  2. Check that the model does not use hull(), minkowski(), text(), import() or surface(). If it does, export STL, OFF or 3MF from OpenSCAD instead.
  3. Drop the .csg file on this page (STL is preset) and click Convert.
  4. Download the STL and check it in your slicer; sizes match the numbers in your OpenSCAD code, read as millimeters.

Key Conversion Features

  • Reads OpenSCAD CSG: cube, sphere, cylinder, polyhedron, 2D shapes with linear and rotate extrusion, multmatrix and the three booleans
  • Booleans evaluated on exact solids by OpenCASCADE, not as mesh operations
  • Exports only the final result, never the leftover operands
  • Unsupported operations are named in the error instead of being silently skipped
  • Fixed 0.1 mm tessellation, binary STL output

Video Tutorial

Detailed guide on how to convert CSG files to STL quickly, for free, and without losing original quality. Perfect if you need to process file formats, reduce size, or upload files to systems that only

Frequently Asked Questions

What is a CSG file?

Here it means OpenSCAD's Constructive Solid Geometry export: a text file listing primitives, transforms and boolean operations after the .scad script has been evaluated. Other programs use the .csg extension for unrelated formats; only OpenSCAD-style CSG text can be read.

Can I upload my .scad file instead?

No. A .scad file is the source script with variables and modules, and evaluating it needs OpenSCAD. Export it as CSG first, or export STL directly from OpenSCAD.

Why does my file fail when it uses hull() or minkowski()?

FreeCAD passes those operations to the OpenSCAD program, which our servers do not have. The converter stops rather than produce a model with the hull or Minkowski sum missing. Export STL from OpenSCAD for these models.

Why was my CSG file reported as unreadable?

The text is not valid OpenSCAD CSG, or it is cut off. Export the file again from OpenSCAD, and make sure it is not some other format that happens to use the .csg extension.

Will the STL match the one OpenSCAD exports?

The shape and dimensions will, the triangles will not. Spheres and fine cylinders are rebuilt as true curved surfaces and meshed to a 0.1 mm tolerance, so facet counts differ from what OpenSCAD's $fn, $fa and $fs settings give.

Can CSG be converted to other formats?

Yes. OBJ, 3MF, PLY, GLB, OFF, AMF and DXF go through the same reader. STEP is not offered for CSG.

Is my CSG file kept on your servers?

Only while it converts. The upload is deleted once the STL is written, and the STL is purged automatically around four hours later.