BREP.js Export Map and Usage
src/BREP/BREP.js aggregates the modeling API under a single BREP namespace. Import it once and destructure what you need:
javascript
import { BREP } from '../src/BREP/BREP.js';
const { Solid, Cube, Sweep, filletSolid, applyBooleanOperation } = BREP;Live Demos
- Examples hub: https://BREP.io/apiExamples/index.html
- BREP Booleans: https://BREP.io/apiExamples/BREP_Booleans.html
- BREP Primitives: https://BREP.io/apiExamples/BREP_Primitives.html
- BREP Transforms: https://BREP.io/apiExamples/BREP_Transforms.html
- BREP Export: https://BREP.io/apiExamples/BREP_Export.html
Core classes
THREE— Re-export of the project's bundled three.js.Solid— Authoring + CSG wrapper (seedocs/solid-methods.mdfor full API).Face,Edge,Vertex— Visualization/selection helpers attached duringvisualize().
Primitive solids
Cube,Pyramid,Sphere,Cylinder,Cone,Torus— Parameterized primitives that extendSolid.Tube— Alias ofTubeSolidfor swept tubes along a polyline.
Feature solids
Sweep— Sweep a face along a path/axis; one side wall per input edge.Revolve— Revolve a face around an axis for a closed or partial solid.ExtrudeSolid— Translate a face with optional back distance; names caps and side walls.ChamferSolid— Builds bevel geometry along an edge for inset/outset chamfers.
Fillet helpers
filletSolid(options)— Builds wedge/tube/final fillet solids for an edge; supportsinflate,resolution, andshowTangentOverlaysfor debugging.computeFilletCenterline(edgeObj, radius, sideMode)— Returns centerline/tangent/edge polylines plus aclosedLoopflag.attachFilletCenterlineAuxEdge(solid, edgeObj, radius, sideMode, name, options)— Adds the centerline as an aux edge on a solid.
Boolean and conversion utilities
applyBooleanOperation({ op, targets, tools, simplify })— High-level boolean runner for feature code.MeshToBrep— Wrap an imported mesh as aSolidwith face labels.MeshRepairer— Tools to detect and fix mesh issues before conversion/CSG.
Assembly helper
AssemblyComponent— Groups one or more solids for the assembly constraint system.
Quick example
javascript
import { BREP } from '../src/BREP/BREP.js';
const box = new BREP.Cube({ x: 10, y: 10, z: 10, name: 'Box' });
const cyl = new BREP.Cylinder({ radius: 3, height: 10, name: 'Hole' });
// Center the cylinder through the box
cyl.position.set(5, 5, 0);
cyl.bakeTransform(cyl.matrixWorld);
// Subtract to make a through-hole
const result = box.subtract(cyl);
result.name = 'BoxWithHole';
result.visualize();Related docs
- Embeddable 2D sketcher API:
docs/sketcher2d-embed.md