BREP.io

Source https://github.com/mmiscool/BREP

BREP.io is a browser-based CAD application and JavaScript kernel for feature-based solid modeling. At its core is a BREP-style modeler with explicit geometry/topology objects such as Solid, Face, Edge, and Vertex, paired with an editable feature-history pipeline. It also includes sketch workflows powered by a standalone 2D constraint solver, plus robust manifold booleans (manifold-3d), mesh repair/import tooling, assembly constraints, PMI annotations, and embeddable CAD/sketcher APIs.

This project is in active development and APIs may continue to evolve.

Workbenches

Screenshots

Home Modeling Mode Sketch Mode PMI Mode 2D Sheets Mode Image to Face 2D Image to Face 3D

Documentation Index

General:

Mode guides:

Modeling Feature Docs

Feature index:

Primitives and setup:

Solid operations:

Pattern, import, and generation:

Assembly and sheet metal:

Additional implemented features in the codebase include collapse edge, edge smooth, offset face, overlap cleanup, sheet metal hem, and sheet metal cutout.

Assembly Constraints

PMI Annotation Docs

Quick Start

Prerequisites:

  • Node.js 18+
  • pnpm
  • git submodule update --init --recursive
  • Emscripten SDK (emcmake/emcc on PATH, or EMSDK installed at $HOME/emsdk)

Install and run locally:

bash
git submodule update --init --recursive
pnpm install
pnpm dev

Then open the Vite URL shown in your terminal.

  • Main app shell: /index.html
  • Direct CAD workspace: /cad.html

Build, Test, and Utility Commands

CommandPurpose
pnpm devPrepares fonts, builds the kernel bundle, then runs the Vite dev server.
pnpm buildProduction build of the app into dist/ (includes kernel build step).
pnpm build:manifoldPlusBuilds the local manifold wasm/js bundle from the vendor/manifold3d submodule plus local custom bindings.
pnpm build:kernelBuilds the ESM kernel bundle into dist-kernel/ and syncs assets.
pnpm use:manifold:npmSwitches runtime/builds to the published manifold-3d npm package.
pnpm use:manifold:localSwitches runtime/builds to the locally compiled manifold bundle.
pnpm which:manifoldPrints the currently selected manifold source.
pnpm testRuns the Node test suite (src/tests/tests.js), writing artifacts to tests/results/.
pnpm liveTestingWatches src/ and tests/ and reruns tests on change.
pnpm captureCaptures docs/dialog screenshots.
pnpm generateLicensesRegenerates dependency and bundled-font license summaries.

Build outputs:

  • dist/: static web app (ready for CDN/web hosting)
  • dist-kernel/: published kernel bundle artifacts

CI and Pages Deployments

The kernel build compiles a custom wasm bundle from the vendor/manifold3d git submodule. CI environments must:

  • fetch submodules
  • install Emscripten/EMSDK before running pnpm build

This repo includes GitHub Actions workflows for:

  • npm publishing with submodules + EMSDK
  • Cloudflare Pages deployment via Wrangler Direct Upload

For Cloudflare Pages, use the GitHub Actions deploy workflow instead of relying on Cloudflare's Git build container to compile the wasm bundle. Configure these repository settings before enabling the workflow:

  • secret CLOUDFLARE_ACCOUNT_ID
  • secret CLOUDFLARE_API_TOKEN
  • variable CLOUDFLARE_PAGES_PROJECT_NAME

Use as an NPM Package

Package name: brep-io-kernel (ESM-only).

Install:

bash
pnpm add brep-io-kernel

Main imports:

javascript
import {
  BREP,
  PartHistory,
  AssemblyConstraintHistory,
  AssemblyConstraintRegistry,
  CadEmbed,
  Sketcher2DEmbed
} from "brep-io-kernel";

Subpath imports:

javascript
import { BREP } from "brep-io-kernel/BREP";
import { PartHistory } from "brep-io-kernel/PartHistory";
import { CadEmbed } from "brep-io-kernel/CAD";
import { Sketcher2DEmbed } from "brep-io-kernel/Sketcher2D";
import { ConstraintSolver, ConstraintEngine, constraints } from "brep-io-kernel/SketchSolver2D";

Node examples:

CLI helper:

bash
npx brep-io-kernel
npx brep-io-kernel --host 127.0.0.1 --port 4173
npx brep-io-kernel --help

License helper APIs:

javascript
import { getPackageLicenseInfoString, getAllLicensesInfoString } from "brep-io-kernel";

console.log(getPackageLicenseInfoString()); // package license info
console.log(getAllLicensesInfoString());    // package + production dependencies

CommonJS note:

javascript
const { BREP } = await import("brep-io-kernel");

Repository Layout

  • src/BREP: core solid/kernel implementation
  • src/features: feature implementations and dialogs
  • src/assemblyConstraints: assembly solver and constraints
  • src/UI: CAD/sketcher UI and embedding bridges
  • docs/: markdown docs and screenshots
  • apiExamples/: standalone browser API demos
  • tests/ and src/tests/: test assets and test runner

Contributing

See CONTRIBUTING.md.

License

See LICENSE.md. This project uses a dual-licensing strategy managed by Autodrop3d LLC.

Documentation

This project's license

Copyright 2025 Autodrop3d LLC https://autodrop3d.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 1. Any modifications made to the Software must be submitted to Autodrop3d LLC with an irrevocable assignment of the copyright via git pull request. This is intended to allow Autodrop3d LLC to sell commercial licenses of the Software for use in proprietary products under a dual-licensing strategy. Failure to contribute back modifications without a commercial license purchased from Autodrop3d LLC voids all permissions granted by this license. 2. If Autodrop3d LLC is sold, merged, transferred, or otherwise succeeded by any entity or individual, all rights and obligations described in this license shall transfer automatically to that successor entity or individual. 3. If Autodrop3d LLC ceases operations or dissolves, and no successor entity or individual continues to publicly host the Software in a manner that allows the public to obtain the source code and submit contributions for a period of at least eighteen (18) consecutive months, then Clauses 1 and 2 of this license shall be automatically and irrevocably canceled. The above copyright notice and these permission notices shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Licenses Report of libraries used in this package

35 packages • 7 license types

(MIT AND Zlib) 2 packages

pako 1 version
zlib port to javascript - fast, modularized, with browser support
pako 1 version
zlib port to javascript - fast, modularized, with browser support

(MIT OR GPL-3.0-or-later) 1 package

jszip 1 version
Create, read and edit .zip files with JavaScript http://stuartk.com/jszip
Author: Stuart Knightley <stuart@stuartk.com>

Apache-2.0 2 packages

@dimforge/rapier3d 1 version
3-dimensional physics engine in Rust - official JS bindings.
manifold-3d 1 version
Geometry library for topological robustness

BSD-3-Clause 1 package

vhacd-js 1 version
Voxelized hierarchical approximate convex mesh decomposition
Author: Paul Connelly

ISC 1 package

inherits 1 version
Browser-friendly inheritance fully compatible with standard node.js inherits()

MIT 27 packages

@babel/runtime 1 version
babel's modular runtime helpers
Author: The Babel Team (https://babel.dev/team)
@tarikjabiri/dxf 1 version
A JavaScript interface to Dxf written in TypeScript.
Author: Tarik EL JABIRI
@types/pako 1 version
TypeScript definitions for pako
base64-arraybuffer 1 version
Encode/decode base64 data into ArrayBuffers
Author: Niklas von Hertzen <niklasvh@gmail.com>
core-js 1 version
Standard library
Author: Denis Pushkarev <zloirock@zloirock.ru>
core-util-is 1 version
The `util.is*` functions introduced in Node v0.12.
Author: Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)
css-line-break 1 version
Author: Niklas von Hertzen <niklasvh@gmail.com>
fast-png 1 version
PNG image decoder and encoder written entirely in JavaScript
Author: Michaël Zasso
html2canvas 1 version
Screenshots with JavaScript
Author: Niklas von Hertzen <niklasvh@gmail.com>
immediate 1 version
A cross browser microtask library
iobuffer 1 version
Read and write binary data on ArrayBuffers
Author: Michaël Zasso
isarray 1 version
Array#isArray for older browsers
Author: Julian Gruber <mail@juliangruber.com>
jspdf 1 version
PDF Document creation from JavaScript
lie 1 version
A basic but performant promise implementation
marked 1 version
A markdown parser built for speed
Author: Christopher Jeffrey
monaco-editor 1 version
A browser based code editor
Author: Microsoft Corporation
pngjs 1 version
PNG encoder/decoder in pure JS, supporting any bit size & interlace, async & sync with full test suite.
process-nextick-args 1 version
process.nextTick but always with args
readable-stream 1 version
Streams3, a user-land copy of the stream library from Node.js
safe-buffer 1 version
Safer Node.js Buffer API
Author: Feross Aboukhadijeh <feross@feross.org>
setimmediate 1 version
A shim for the setImmediate efficient script yielding API
Author: YuzuJS
string_decoder 1 version
The string_decoder module from Node core
text-segmentation 1 version
Author: Niklas von Hertzen <niklasvh@gmail.com>
three 1 version
JavaScript 3D library
Author: mrdoob
three-mesh-bvh 1 version
A BVH implementation to speed up raycasting against three.js meshes.
Author: Garrett Johnson <garrett.kjohnson@gmail.com>
util-deprecate 1 version
The Node.js `util.deprecate()` function with browser support
Author: Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)
utrie 1 version
Unicode Trie
Author: Niklas von Hertzen <niklasvh@gmail.com>

SGI-B-2.0 1 package

tess2 1 version
GLU tesselator ported to Javascript, performs polygon boolean operations and triangulation
Author: Matt DesLauriers <dave.des@gmail.com>

Font Licenses

Bundled fonts are licensed separately from npm packages.