IRONSTREAM

A from-scratch, OpenCascade-style CAD geometry kernel in pure Rust. Linear algebra, topology, a BSP-tree CSG boolean engine, tessellation and STL/STEP writers — with zero third-party dependencies.

pure rust zero deps OCCT-shaped API 100% OCCT class parity 26,638 tests green MIT
// forged by ironstream

Every model here was computed by IronStream itself

Booleans from the BSP CSG engine, lathes, lofts, sweeps and sheet-metal flanges — tessellated by the kernel and written out by its own binary-STL writer. Compiled from CADbuildr foundation designs via castiron. Drag to orbit, scroll to zoom.

0
third-party dependencies
7,084
OCCT classes mirrored (100%)
B-rep
analytic STEP — a hole is a cylinder, not facets
26,638
ported OpenCascade unit tests, all green
// the api

OpenCascade-shaped, Rust-natured

If you know BRepPrimAPI and BRepAlgoAPI, you already know your way around. The same surface is exposed to Python through the ironstream bindings.

drilled_block.rsrust
use ironstream::prelude::*;

fn main() {
    let block = make_box(Pnt::new(0.0, 0.0, 0.0), 20.0, 20.0, 20.0);
    let drill = make_cylinder(5.0, 20.0, MeshParams::default());
    let part  = cut(&block, &drill);   // BSP CSG boolean

    println!("volume = {:.1}", part.volume());
    std::fs::write("part.stl", write_binary_stl(part.mesh())).unwrap();
}
drilled_block.pypython
import ironstream as ist

block = ist.make_box(ist.Pnt(0, 0, 0), 20, 20, 20)
drill = ist.make_cylinder(5, 20)
part  = ist.cut(block, drill)   # same kernel, same CSG

print(part.volume())
with open("part.stl", "wb") as f:
    f.write(ist.write_binary_stl(part.mesh()))
// live, in your browser

The kernel, running in this page

This is not a video and not a server: the button below loads Pyodide and a 145 KB WebAssembly build of the IronStream Python bindings, then runs real Python against the real kernel — booleans, volumes and STL bytes computed right here. Edit the code and re-run it.

playground.pypython · pyodide
// standing on the shoulders

A tribute to OpenCascade

IronStream exists because OpenCascade showed the way. For more than three decades, Open CASCADE Technology has been the open-source backbone of serious CAD — the geometry kernel beneath FreeCAD, CadQuery, build123d, KiCad's 3D viewer and countless engineering tools. Its architecture is one of the great unsung designs of open-source software.

IronStream is not a fork and shares no code with OCCT. It is an original, from-scratch re-implementation in pure Rust — but it deliberately keeps OCCT's shape: the same package boundaries, the same class names, the same way of thinking about points, topology and boolean operations. Where behaviour matters, IronStream is checked against 26,638 unit tests ported from the OCCT test suite, and a parity tracker audits all 7,084 OCCT classes at 100%, one // occt: marker at a time.

The highest compliment you can pay an architecture is to rebuild it from nothing, in a new language, and find that its boundaries were right all along.
OCCT toolkitIronStream modulecoverage
gp — points, axes, transformsgp.rs100%
Geom — curves & surfacesgeom.rs100%
TopoDS — topologytopods.rs100%
BRepPrimAPI — primitives & sweepsbrep_prim_api.rs100%
BRepAlgoAPI — booleansbrep_algo_api.rsBSP CSG
BRepMesh — tessellationbrep_mesh.rs100%
A triangulated iron tower with a molten core — a structure built from simple, honest elements.
simple elements, honest structure — the OCCT way
// beyond rust

Python bindings & the CADbuildr toolchain

Molten iron flowing through a triangulated mesh — geometry being forged.

The whole kernel is exposed to Python via PyO3 as import ironstream — same prelude, pyOCCT-style namespaces (ironstream.gp, .prim, .algo, .io). On top of it, castiron compiles CADbuildr foundation designs (Python CAD-as-code) straight to STL/STEP, fully offline — no server, no broker.