Skip to content

mmiscool/BREP

Repository files navigation

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

Using as an npm package

  • 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';

Dialog Screenshots

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

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.

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

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.

About

An attempt at making a BREP kernel from scratch

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages