BREP

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

A feature-based modeling playground experimenting with BREP-style workflows on top of triangle meshes. It combines robust manifold CSG (via the Manifold library) with a simple face and edge representation, a history pipeline, and Three.js visualization. Import meshes (STL), repair and group them into faces, then perform boolean operations, fillets, chamfers, sweeps, lofts, and more.

This project is actively evolving; expect rough edges while APIs settle. Modeling Mode Sketch Mode PMI Mode Image to Face 2D Trace Image to Face 3D Result

Documentation Map

Dialog Screenshots

See Dialog Screenshots for the capture helpers, output locations, and configuration options.

Run Local Dev Environment

# clone repo and cd to the folder
pnpm install
pnpm dev

Produce Static build

# clone repo and cd to the folder
pnpm install
pnpm build
Generating a static build will create a
dist
folder containing a static build suitable for hosting on a CDN or just being copied to a web server.

Application Mode Guides

Modeling Features

Assembly Constraints

Assemblies can be constrained with the iterative solver described in Assembly Constraint Solver. Each constraint instance stores clear selections plus persistent solve data so runs resume quickly after edits. The constraint registry currently ships with:

  • Coincident – mates two datum points or implicit origins.
  • Distance – fixes an offset between reference points along a chosen axis or free space.
  • Angle – enforces a target angle between two axes or faces.
  • Parallel – locks component axes or normals into parallel alignment.
  • Touch Align – slides surfaces until they touch and optionally shares tangency.
  • Fixed – anchors a component so downstream constraints treat it as immobile.

Adding, removing, or editing any of these entries queues an automatic background solve, and the UI exposes constraint status plus debugging messages pulled from each persistentData record.

PMI annotations

PMI mode focuses on downstream manufacturing communication. Annotating the model augments the saved .brep history and the embedded 3MF metadata. The PMI tools mirror the dialog capture pages in docs/pmi-annotations:

  • Linear Dimension – measures distances between vertices with alignment, offsets, and extension controls.
  • Radial Dimension – reports diameter/radius for arcs, circles, and cylinders.
  • Angle Dimension – dimension angular relationships across edges or faces.
  • Leader – callouts with free-form text, arrowhead placement, and captured drag offsets.
  • Note – rich-text style annotations tied to PMI views without leader geometry.
  • Explode Body – stores exploded-view offsets per component for presentation layouts.
  • Hole Callout – leader-style callout that reports hole feature parameters (diameters, depths, countersink/counterbore).

Each annotation stores associative references and view metadata so reloading a part restores the PMI viewport, label placement, and formatting settings.

Using as an npm package (not completed yet. Will change and is not currently working)

  • Install:
  • - pnpm add brep-io-kernel

  • Import options:

- import { BREP, PartHistory } from 'brep-io-kernel'; - import { BREP } from 'brep-io-kernel/BREP'; - import { PartHistory } from 'brep-io-kernel/PartHistory'; - import { AssemblyConstraintHistory, AssemblyConstraintRegistry } from 'brep-io-kernel';

License

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

Contributing

See CONTRIBUTING.md for guidelines on submitting pull requests, reporting issues, and participating in discussions.

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

54 packages • 9 license types

(MIT AND Zlib) 1 package

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

(MPL-2.0 OR Apache-2.0) 1 package

dompurify 1 version
DOMPurify is a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. It's written in JavaScript and works in all modern browsers (Safari, Opera (15+), Internet Explorer (10+), Firefox and Chrome - as well as almost anything else using Blink or WebKit). DOMPurify is written by security people who have vast background in web attacks and XSS. Fear not.
Author: Dr.-Ing. Mario Heiderich, Cure53

Apache-2.0 5 packages

@img/sharp-linux-x64 1 version
Prebuilt sharp for use with Linux (glibc) x64
Author: Lovell Fuller
@img/sharp-linuxmusl-x64 1 version
Prebuilt sharp for use with Linux (musl) x64
Author: Lovell Fuller
detect-libc 1 version
Node.js module to detect the C standard library (libc) implementation family and version
Author: Lovell Fuller
manifold-3d 1 version
Geometry library for topological robustness
sharp 1 version
High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images
Author: Lovell Fuller

bsd-2-clause 1 package

esbuild-plugin-text-replace 1 version
Replace Text with Regex in files before bundling.
Author: Andreas Heissenberger

ISC 2 packages

inherits 1 version
Browser-friendly inheritance fully compatible with standard node.js inherits()
semver 1 version
The semantic version parser used by npm.
Author: GitHub Inc.

LGPL-3.0-or-later 2 packages

@img/sharp-libvips-linux-x64 1 version
Prebuilt libvips and dependencies for use with sharp on Linux (glibc) x64
Author: Lovell Fuller
@img/sharp-libvips-linuxmusl-x64 1 version
Prebuilt libvips and dependencies for use with sharp on Linux (musl) x64
Author: Lovell Fuller

MIT 40 packages

@gltf-transform/core 1 version
glTF 2.0 SDK for JavaScript and TypeScript, on Web and Node.js.
Author: Don McCurdy
@gltf-transform/extensions 1 version
Adds extension support to @gltf-transform/core
Author: Don McCurdy
@gltf-transform/functions 1 version
Functions for common glTF modifications, written using the core API
Author: Don McCurdy
@img/colour 1 version
The ESM-only 'color' package made compatible for use with CommonJS runtimes
@jridgewell/resolve-uri 1 version
Resolve a URI relative to an optional base URI
Author: Justin Ridgewell
@jridgewell/sourcemap-codec 1 version
Encode/decode sourcemap mappings
Author: Justin Ridgewell
@jridgewell/trace-mapping 1 version
Trace the original position through a source map
Author: Justin Ridgewell
@jscadui/3mf-export 1 version
3mf export
@types/ndarray 1 version
TypeScript definitions for ndarray
@types/trusted-types 1 version
TypeScript definitions for trusted-types
commander 1 version
the complete solution for node.js command-line programs
Author: TJ Holowaychuk
convert-source-map 1 version
Converts a source-map from/to different formats and allows adding/changing properties.
Author: Thorsten Lorenz
core-js 1 version
Standard library
Author: Denis Pushkarev
core-util-is 1 version
The `util.is*` functions introduced in Node v0.12.
Author: Isaac Z. Schlueter
cwise-compiler 1 version
cwise's internal compiler
Author: Mikola Lysenko
esbuild-wasm 1 version
The cross-platform WebAssembly binary for esbuild, a JavaScript bundler.
fflate 1 version
High performance (de)compression in an 8kB package
Author: Arjun Barrett
immediate 1 version
A cross browser microtask library
iota-array 1 version
Generates an array of consecutive integers starting at 0
Author: Mikola Lysenko
is-buffer 1 version
Determine if an object is a Buffer
Author: Feross Aboukhadijeh
isarray 1 version
Array#isArray for older browsers
Author: Julian Gruber
ktx-parse 1 version
KTX 2.0 (.ktx2) parser and serializer.
Author: Don McCurdy
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
ndarray 1 version
Multidimensional Arrays
Author: Mikola Lysenko
ndarray-lanczos 1 version
Resize an ndarray with Lanczos resampling
Author: Don McCurdy
ndarray-ops 1 version
Common operations for ndarray arrays
Author: Mikola Lysenko
ndarray-pixels 1 version
ndarray-pixels
Author: Don McCurdy
process-nextick-args 1 version
process.nextTick but always with args
property-graph 1 version
Base for creating objects that behave like a Property Graph.
Author: Don McCurdy
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
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
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
ts-replace-all 1 version
uniq 1 version
Removes duplicates from a sorted array in place
Author: Mikola Lysenko
util-deprecate 1 version
The Node.js `util.deprecate()` function with browser support
Author: Nathan Rajlich

SGI-B-2.0 1 package

tess2 1 version
GLU tesselator ported to Javascript, performs polygon boolean operations and triangulation
Author: Matt DesLauriers