opengeometry
v2.0.9
Published
CAD kernel for the web built with Rust, WebAssembly, and Three.js for browser CAD, AEC/BIM, and geometry-heavy tools.
Maintainers
Readme
Actively maintained and growing. We're building OpenGeometry in the open. APIs, examples, and package structure are evolving, we are actively improving and expanding the project. Star the repo to follow along. If you have questions or want to get involved, join the Discord or check out the issues
What is OpenGeometry?
OpenGeometry is an open-source, browser-native CAD kernel. The geometry engine is written in Rust, compiled to WebAssembly, and paired with a Three.js-friendly TypeScript layer so you can build real CAD tools that run in the browser.
OpenGeometry is best suited for browser-based CAD, AEC/BIM, configurators, and geometry-heavy web tools. Whether you're building a parametric modeler, a wall/opening workflow, a BIM viewer, or a custom Three.js modeling tool, OpenGeometry gives you deterministic, kernel-backed primitives and operations without leaving JavaScript.
It is the geometry engine layer, not a full CAD application. OpenPlans is a downstream application/toolkit built on top of OpenGeometry for AEC workflows. In this repository, OpenGeometry is the primary SDK and engine.
When to use OpenGeometry
Use OpenGeometry when you need:
- browser-based parametric modeling with Rust + WebAssembly performance
- wall/opening subtraction and other solid boolean workflows
- polygon extrusion into solids for CAD or AEC modeling
- IFC, STEP, STL, and PDF-style export/projection in web apps
- a Three.js-friendly CAD kernel instead of ad hoc mesh math
- a deterministic geometry engine behind AI-assisted CAD or design workflows
Why it works well for AI-powered CAD apps
OpenGeometry is a good fit for AI-assisted CAD apps because the kernel layer stays explicit and deterministic. An AI copilot or agent can suggest modeling steps, generate profiles, or orchestrate edits, while OpenGeometry executes the actual geometry operations, booleans, projections, and exports in a predictable browser runtime.
Good examples include:
- AI copilots that translate user intent into concrete modeling operations
- prompt-to-geometry or agent-driven editing flows inside browser CAD tools
- AI-assisted design interfaces that still need reliable extrusion, boolean, projection, and export workflows
Good fit / Not the right fit
Good fit
- browser CAD, AEC/BIM, and geometry-heavy web applications
- Three.js-based modeling tools that need a real kernel behind them
- AI-assisted CAD frontends that need deterministic geometry execution in the browser
Not the default fit
- desktop-native CAD products instead of an embeddable web SDK
- non-browser runtimes with no WebAssembly or browser delivery story
- pure visualization-only apps where raw Three.js is enough and kernel-backed modeling is unnecessary
AI and Coding Agent Entrypoints
If you are using ChatGPT, Claude, Gemini, Copilot, or other coding agents on this repository, start here:
- AGENTS.md - single source of truth for all coding agents (architecture, commands, gotchas, behavioral rules)
- README.md - product overview, positioning, and quick start
- Quickstart
- Three.js integration
- Boolean operations
- Extrude
What you can do today
| Category | Capabilities | | --- | --- | | Primitives | Lines, arcs, curves, polylines, rectangles | | Shapes | Polygons, solids, cuboids, cylinders, spheres, wedges, sweeps, openings | | Operations | Triangulation, extrusion, sweep, offset, boolean operations | | Exports | STL, STEP, IFC, PDF projection (PDF is currently native/Node-only — browser PDF is on the roadmap) | | Integration | Three.js scene management, WebAssembly-powered performance |
Demos
See OpenGeometry in action — interactive, browser-based demos showcasing the kernel's capabilities:
Demos include primitives rendering, shape generation, sweep operations, boolean operations, file exports, and more. All running client-side via WebAssembly.
Quick Start
Install from npm:
npm install opengeometryA practical browser deployment looks like this: install opengeometry from npm, serve opengeometry_bg.wasm from your app, then initialize the runtime once with OpenGeometry.create({ wasmURL }) before creating Vector3 values or kernel-backed wrappers.
import { Cuboid, OpenGeometry, Vector3 } from "opengeometry";
await OpenGeometry.create({
wasmURL: new URL(
"node_modules/opengeometry/opengeometry_bg.wasm",
import.meta.url
).href,
});
// Initialize once before constructing Vector3 or any wrapper.
const cuboid = new Cuboid({
center: new Vector3(0, 0, 0),
width: 2,
height: 1,
depth: 1,
color: 0x33aa66,
});
// Placement is strict: scale must be positive + uniform.
cuboid.setPlacement({
translation: new Vector3(1, 0, 0),
rotation: new Vector3(0, 0.25, 0),
scale: new Vector3(1.25, 1.25, 1.25),
});Scenegraph behavior is snapshot-based: add*ToScene captures geometry at insert time. If you change placement/config later, push updates explicitly via replaceBrepEntityInScene or refreshBrepEntityInScene.
For a complete walkthrough, see the Quick Start guide or clone the quickstart-js repo.
Documentation
Full API reference, guides, and concepts are available at:
Key pages:
Repository Structure
main/opengeometry Rust core → WebAssembly
main/opengeometry-three Three.js integration layer
main/opengeometry-webgl WebGL-oriented package (WIP)
main/opengeometry-babylon Babylon.js-oriented package (WIP)
docs/ Documentation source (Mintlify)Building from Source
Prerequisites: Node.js, npm, Rust toolchain, wasm-pack
# Install dependencies
npm install
# Build Rust core → WebAssembly
npm run build-core
# Build everything (core + Three.js + WASM copy)
npm run build
# Run the Three.js example app locally
npm --prefix main/opengeometry-three run dev-example-three
# Run tests
npm testWho is this for?
- Teams building browser-based CAD/BIM/geometry tools
- Developers evaluating WebAssembly-powered 3D for the web
- Contributors interested in the Rust → WASM geometry pipeline
- Anyone exploring open-source CAD kernel internals
If you just want a quick look, start with the hosted demos or the quickstart repo.
Community
We'd love to have you involved — whether you're using OpenGeometry, building on it, or just curious.
- Discord — Chat with the team and community
- Twitter / X — Updates and announcements
- LinkedIn — Company updates
- GitHub Issues — Bug reports and feature requests
- Blog — Deep dives and release notes
Contributing
OpenGeometry is open source under the MPL-2.0 license. Contributions are welcome — check the issues for good starting points or open a discussion on Discord.
AI Agent Docs Policy
- All AI coding agent instructions live in a single file: AGENTS.md.
CLAUDE.mdand.github/copilot-instructions.mdare thin redirects to it. - Stable architecture and domain notes are tracked in
knowledge/. - User-facing docs live in
docs/(Mintlify source). - Agents should not create planning, handoff, or runbook files during a task. The conversation, the diff, and the commit message are the handoff.
