Python bindings for the IronStream CAD geometry kernel
Project description
ironstream (Python bindings)
PyO3 bindings for the IronStream CAD geometry kernel — a from-scratch, zero-dependency Rust port of OpenCascade.
This is one of three consumption paths off the IronStream kernel (the other two — native Rust and a WASM/TypeScript export — live elsewhere). It mirrors the kernel's OCCT-shaped prelude, in the spirit of pyOCCT: symbols are available both flat and under OCCT-style submodules.
import ironstream as ist
box = ist.make_box(ist.Pnt(0, 0, 0), 20, 20, 20)
hole = ist.make_cylinder(5, 20)
part = ist.cut(box, hole)
print(part.volume())
with open("part.stl", "wb") as f:
f.write(ist.write_binary_stl(part.mesh()))
pyOCCT-style namespaces are also available:
from ironstream.gp import Pnt
from ironstream.prim import make_box
from ironstream.algo import cut
Layout
| Namespace | Contents |
|---|---|
ironstream.gp |
Pnt (Vec3, Point3), Ax1, Trsf |
ironstream.topods |
Vertex, Wire, Face, Solid, Compound |
ironstream.mesh |
TriMesh, BBox |
ironstream.prim |
make_box/cylinder/cone/sphere/torus/prism/revol, MeshParams |
ironstream.builder |
make_polygon, make_face, make_face_with_holes, transform |
ironstream.algo |
fuse, cut, common, fuse_all |
ironstream.io |
write_binary_stl, write_ascii_stl, write_step |
Development
Requires a Rust toolchain and maturin. The kernel is
pulled in as a local path dependency (../ironstream), so clone both repos as
siblings.
uv venv
maturin develop # builds the kernel + binding, installs into the venv
python -c "import ironstream; print(ironstream.make_box(ironstream.Pnt(0,0,0),1,1,1).volume())"
Build a distributable wheel with maturin build --release.
Pyodide / WebAssembly
The binding also builds as a Pyodide wheel (~140 KB) that runs the whole kernel in the browser — this powers the live demo on the IronStream project page:
chmod +x scripts/build_pyodide_wheel.sh
./scripts/build_pyodide_wheel.sh # -> dist/cadbuildr_ironstream-*-emscripten_*_wasm32.whl
The script pins the full toolchain (pyodide xbuildenv 0.29.4, emscripten 4.0.9, rust nightly-2025-02-01 + pyodide's wasm-eh sysroot) and documents why each pin exists. Load it in a page with:
const { loadPyodide } = await import("https://cdn.jsdelivr.net/pyodide/v0.29.4/full/pyodide.mjs");
const py = await loadPyodide({ indexURL: "https://cdn.jsdelivr.net/pyodide/v0.29.4/full/" });
await py.loadPackage("<url of the .whl>");
py.runPython(`import ironstream as ist; print(ist.make_sphere(10).volume())`);
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cadbuildr_ironstream-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: cadbuildr_ironstream-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 441.0 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91508cf03081def5388dc2e5e2e5cb593f292f15d6d85b7ab284c50a52f2b0b8
|
|
| MD5 |
41c2e4c07400dab3271f4ad6542a57c4
|
|
| BLAKE2b-256 |
71542c1408d90341a3373de1890e9b2c7d0cd104539299c2037d30ddd058081e
|
Provenance
The following attestation bundles were made for cadbuildr_ironstream-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish-pypi.yml on cadbuildr/ironstream-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cadbuildr_ironstream-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
91508cf03081def5388dc2e5e2e5cb593f292f15d6d85b7ab284c50a52f2b0b8 - Sigstore transparency entry: 2071260425
- Sigstore integration time:
-
Permalink:
cadbuildr/ironstream-python@c767fa2b2ef0446e50cfae169c8d70bdb287a26f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/cadbuildr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c767fa2b2ef0446e50cfae169c8d70bdb287a26f -
Trigger Event:
push
-
Statement type:
File details
Details for the file cadbuildr_ironstream-0.1.0-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: cadbuildr_ironstream-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 346.6 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
734ad3ff4b2a97cdfd1f0f4342bd3e515cc5a91f58b44d7cbe5a8f314e65d026
|
|
| MD5 |
6ab1d291d1bd337f93eb4c4206f73b5c
|
|
| BLAKE2b-256 |
ac032e8ffabd5821ed55c21d09418f49d410c8c599460c918910d5e79f9c4b01
|
Provenance
The following attestation bundles were made for cadbuildr_ironstream-0.1.0-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
publish-pypi.yml on cadbuildr/ironstream-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cadbuildr_ironstream-0.1.0-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
734ad3ff4b2a97cdfd1f0f4342bd3e515cc5a91f58b44d7cbe5a8f314e65d026 - Sigstore transparency entry: 2071260417
- Sigstore integration time:
-
Permalink:
cadbuildr/ironstream-python@c767fa2b2ef0446e50cfae169c8d70bdb287a26f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/cadbuildr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c767fa2b2ef0446e50cfae169c8d70bdb287a26f -
Trigger Event:
push
-
Statement type: