brepjs 12.4.0 → 12.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -259
- package/package.json +2 -4
package/README.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# brepjs
|
|
2
2
|
|
|
3
|
-
CAD modeling for JavaScript.
|
|
3
|
+
CAD modeling for JavaScript.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/brepjs)
|
|
6
6
|
[](https://github.com/andymai/brepjs/actions/workflows/ci.yml)
|
|
7
7
|
[](./LICENSE)
|
|
8
8
|
|
|
9
|
-
**[Docs](https://andymai.github.io/brepjs/)** · **[
|
|
9
|
+
**[Docs](https://andymai.github.io/brepjs/)** · **[Cheat Sheet](./docs/cheat-sheet.md)** · **[Getting Started](./docs/getting-started.md)**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
|
+
// Drill a hole, fillet the vertical edges, export to STEP
|
|
12
13
|
import { box, cut, cylinder, fillet, edgeFinder, exportSTEP, unwrap } from 'brepjs/quick';
|
|
13
14
|
|
|
14
15
|
const b = box(30, 20, 10);
|
|
@@ -21,297 +22,117 @@ const part = unwrap(fillet(drilled, edges, 1.5));
|
|
|
21
22
|
const step = unwrap(exportSTEP(part));
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
## Why
|
|
25
|
+
## Why?
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
brepjs grew out of the love and care I put into [gridfinitylayouttool.com](https://gridfinitylayouttool.com). I needed parametric CAD in the browser and I'm not a 3D modeler, but I know TypeScript. [OpenSCAD](https://openscad.org/) nailed code-first CAD but lives outside the JS ecosystem. [replicad](https://replicad.xyz/) proved OpenCascade works in JS but I kept hitting performance walls and fighting the API.
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npm install brepjs brepjs-opencascade
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
`brepjs/quick` auto-initializes the WASM kernel via top-level await (ESM only). For CJS or manual control:
|
|
35
|
-
|
|
36
|
-
```typescript
|
|
37
|
-
import opencascade from 'brepjs-opencascade';
|
|
38
|
-
import { initFromOC } from 'brepjs';
|
|
39
|
-
|
|
40
|
-
const oc = await opencascade();
|
|
41
|
-
initFromOC(oc);
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## Features
|
|
45
|
-
|
|
46
|
-
**Modeling** — `box`, `cylinder`, `sphere`, `cone`, `torus`, `ellipsoid`, `polyhedron` plus `extrude`, `revolve`, `loft`, `sweep` from 2D sketches
|
|
47
|
-
|
|
48
|
-
**Booleans** — `fuse`, `cut`, `intersect`, `section`, `split`, `slice` with batch variants `fuseAll`, `cutAll`
|
|
49
|
-
|
|
50
|
-
**Modifiers** — `fillet`, `chamfer`, `shell`, `offset`, `thicken`, `resize`. Accepts `ShapeFinder` directly
|
|
51
|
-
|
|
52
|
-
**Transforms** — `translate`, `rotate`, `mirror`, `scale`, `applyMatrix`, `composeTransforms`, `transformCopy`
|
|
29
|
+
Neither had the type safety I wanted, so brepjs leans hard on it: branded types, `Result<T,E>`, phantom types that prove invariants at compile time. If it compiles, the geometry is valid.
|
|
53
30
|
|
|
54
|
-
|
|
31
|
+
## Status
|
|
55
32
|
|
|
56
|
-
|
|
33
|
+
Production-ready with the OpenCascade kernel. [brepkit](https://github.com/andymai/brepkit), a Rust-based kernel, is in active development as a faster replacement but not yet production-ready. The kernel abstraction layer means switching is a one-line change.
|
|
57
34
|
|
|
58
|
-
|
|
35
|
+
## Benchmarks
|
|
59
36
|
|
|
60
|
-
|
|
37
|
+
Median times, 5 iterations, Node.js on Linux x86_64. Full results in [`benchmarks/results/latest.md`](./benchmarks/results/latest.md).
|
|
61
38
|
|
|
62
|
-
|
|
39
|
+
### WASM bundle size
|
|
63
40
|
|
|
64
|
-
|
|
41
|
+
| Kernel | Size |
|
|
42
|
+
| ---------------------------------------------------------------------- | ------ |
|
|
43
|
+
| [brepjs-opencascade](https://www.npmjs.com/package/brepjs-opencascade) | 11 MB |
|
|
44
|
+
| [brepkit](https://github.com/andymai/brepkit) (Rust, in development) | 1.8 MB |
|
|
65
45
|
|
|
66
|
-
|
|
46
|
+
brepjs-opencascade is a heavily optimized custom build of OpenCascade: trimmed to only the classes brepjs needs, with custom C++ bulk-extraction classes (mesh, booleans, topology) that bypass the JS-WASM bridge for hot paths. It's already about as fast as OCCT gets in the browser.
|
|
67
47
|
|
|
68
|
-
|
|
48
|
+
### Boolean operations
|
|
69
49
|
|
|
70
|
-
|
|
50
|
+
| Operation | brepjs-opencascade | brepkit | Speedup |
|
|
51
|
+
| ---------------------- | ------------------ | ------- | ------- |
|
|
52
|
+
| fuse(box, box) | 83.7 ms | 5.7 ms | 15x |
|
|
53
|
+
| cut(box, cylinder) | 123.8 ms | 4.2 ms | 29x |
|
|
54
|
+
| intersect(box, sphere) | 107.1 ms | 31.9 ms | 3.4x |
|
|
71
55
|
|
|
72
|
-
|
|
56
|
+
### Primitives
|
|
73
57
|
|
|
74
|
-
|
|
58
|
+
| Operation | brepjs-opencascade | brepkit | Speedup |
|
|
59
|
+
| ------------ | ------------------ | ------- | ------- |
|
|
60
|
+
| makeBox | 5.9 ms | 0.2 ms | 25x |
|
|
61
|
+
| makeCylinder | 2.3 ms | 0.1 ms | 16x |
|
|
62
|
+
| makeSphere | 1.4 ms | 0.5 ms | 3x |
|
|
75
63
|
|
|
76
|
-
|
|
64
|
+
### End-to-end
|
|
77
65
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
```typescript
|
|
87
|
-
import {
|
|
88
|
-
cylinder,
|
|
89
|
-
fuse,
|
|
90
|
-
cut,
|
|
91
|
-
shell,
|
|
92
|
-
fillet,
|
|
93
|
-
rotate,
|
|
94
|
-
faceFinder,
|
|
95
|
-
edgeFinder,
|
|
96
|
-
measureVolume,
|
|
97
|
-
unwrap,
|
|
98
|
-
} from 'brepjs/quick';
|
|
99
|
-
|
|
100
|
-
// Tube + flanges
|
|
101
|
-
const tube = cylinder(15, 100);
|
|
102
|
-
const body = unwrap(fuse(unwrap(fuse(tube, cylinder(30, 5))), cylinder(30, 5, { at: [0, 0, 95] })));
|
|
103
|
-
|
|
104
|
-
// Hollow out — find top face, shell to 2mm walls
|
|
105
|
-
const topFaces = faceFinder().parallelTo('XY').atDistance(100, [0, 0, 0]).findAll(body);
|
|
106
|
-
const hollowed = unwrap(shell(body, topFaces, 2));
|
|
107
|
-
|
|
108
|
-
// Fillet the tube-to-flange transitions
|
|
109
|
-
const filletEdges = edgeFinder()
|
|
110
|
-
.ofCurveType('CIRCLE')
|
|
111
|
-
.ofLength(2 * Math.PI * 15)
|
|
112
|
-
.findAll(hollowed);
|
|
113
|
-
let result = unwrap(fillet(hollowed, filletEdges, 3));
|
|
114
|
-
|
|
115
|
-
// Bolt holes around each flange
|
|
116
|
-
for (let i = 0; i < 6; i++) {
|
|
117
|
-
const angle = 60 * i;
|
|
118
|
-
const hole = rotate(cylinder(3, 10, { at: [22, 0, -2] }), angle, { axis: [0, 0, 1] });
|
|
119
|
-
result = unwrap(cut(result, hole));
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
console.log('Volume:', measureVolume(result), 'mm³');
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## Common Patterns
|
|
126
|
-
|
|
127
|
-
### Memory cleanup
|
|
128
|
-
|
|
129
|
-
WASM objects aren't garbage-collected. Use `using` (TS 5.9+) or `DisposalScope` for deterministic cleanup:
|
|
130
|
-
|
|
131
|
-
```typescript
|
|
132
|
-
import { box, cylinder, cut, unwrap, DisposalScope } from 'brepjs/quick';
|
|
133
|
-
|
|
134
|
-
// Option 1: using keyword — auto-disposed at block end
|
|
135
|
-
{
|
|
136
|
-
using temp = box(10, 10, 10);
|
|
137
|
-
using hole = cylinder(3, 15);
|
|
138
|
-
const result = unwrap(cut(temp, hole));
|
|
139
|
-
// temp and hole freed here; result survives
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Option 2: DisposalScope — deterministic cleanup
|
|
143
|
-
function buildPart() {
|
|
144
|
-
using scope = new DisposalScope();
|
|
145
|
-
const b = scope.register(box(10, 10, 10));
|
|
146
|
-
const hole = scope.register(cylinder(3, 15));
|
|
147
|
-
return unwrap(cut(b, hole)); // b and hole freed when scope exits
|
|
148
|
-
}
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Immutability
|
|
152
|
-
|
|
153
|
-
All operations return new shapes — the original is never modified:
|
|
154
|
-
|
|
155
|
-
```typescript
|
|
156
|
-
import { box, translate, rotate, measureVolume } from 'brepjs/quick';
|
|
157
|
-
|
|
158
|
-
const original = box(30, 20, 10);
|
|
159
|
-
const moved = translate(original, [100, 0, 0]);
|
|
160
|
-
const rotated = rotate(moved, 45, { axis: [0, 0, 1] });
|
|
161
|
-
|
|
162
|
-
// original is unchanged
|
|
163
|
-
console.log(measureVolume(original) === measureVolume(moved)); // true — same geometry, different position
|
|
164
|
-
```
|
|
66
|
+
| Operation | brepjs-opencascade | brepkit | Speedup |
|
|
67
|
+
| ---------------------- | ------------------ | ------- | ------- |
|
|
68
|
+
| box + chamfer | 7.8 ms | 0.1 ms | 70x |
|
|
69
|
+
| box + fillet | 8.1 ms | 0.3 ms | 28x |
|
|
70
|
+
| multi-boolean model | 52.0 ms | 1.7 ms | 31x |
|
|
71
|
+
| mesh sphere (tol=0.01) | 61.3 ms | 20.0 ms | 3x |
|
|
72
|
+
| exportSTEP x10 | 19.2 ms | 0.9 ms | 21x |
|
|
165
73
|
|
|
166
|
-
|
|
74
|
+
## What you can build
|
|
167
75
|
|
|
168
|
-
|
|
76
|
+
Code-as-CAD is great for parts defined by parameters - enclosures, brackets, fixtures, gridfinity bins. Less suited for organic sculpting. Think parametric part generators, browser-based CAD tools, automated manufacturing pipelines, 3D printing workflows.
|
|
169
77
|
|
|
170
|
-
|
|
171
|
-
import { box, translate, rotate, shape } from 'brepjs/quick';
|
|
172
|
-
|
|
173
|
-
// Functional — each call returns a new shape
|
|
174
|
-
const b = box(30, 20, 10);
|
|
175
|
-
const moved = translate(b, [50, 0, 0]);
|
|
176
|
-
const result = rotate(moved, 45, { axis: [0, 0, 1] });
|
|
177
|
-
|
|
178
|
-
// Wrapper — fluent chaining
|
|
179
|
-
const same = shape(box(30, 20, 10))
|
|
180
|
-
.translate([50, 0, 0])
|
|
181
|
-
.rotate(45, { axis: [0, 0, 1] }).val;
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### 2D sketch to 3D extrusion
|
|
185
|
-
|
|
186
|
-
Draw a 2D profile, then extrude it to create a solid:
|
|
187
|
-
|
|
188
|
-
```typescript
|
|
189
|
-
import { drawRectangle, drawCircle, drawingCut, drawingToSketchOnPlane, shape } from 'brepjs/quick';
|
|
190
|
-
|
|
191
|
-
// Draw 2D rectangle with a hole
|
|
192
|
-
const profile = drawingCut(drawRectangle(50, 30), drawCircle(8).translate([25, 15]));
|
|
193
|
-
|
|
194
|
-
// Convert to sketch on XY plane, extrude 20mm
|
|
195
|
-
const sketch = drawingToSketchOnPlane(profile, 'XY');
|
|
196
|
-
const solid = shape(sketch.face()).extrude(20).val;
|
|
78
|
+
## Install
|
|
197
79
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
const quickBox = sketchRectangle(50, 30).extrude(20);
|
|
80
|
+
```bash
|
|
81
|
+
npm install brepjs brepjs-opencascade
|
|
201
82
|
```
|
|
202
83
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
Load a STEP file, modify it, and re-export:
|
|
84
|
+
`brepjs/quick` handles WASM init automatically via top-level await (ESM only). Manual setup:
|
|
206
85
|
|
|
207
86
|
```typescript
|
|
208
|
-
import
|
|
209
|
-
|
|
210
|
-
// Import from Blob (e.g., from file input or fs.readFileSync)
|
|
211
|
-
const imported = unwrap(await importSTEP(stepBlob));
|
|
212
|
-
|
|
213
|
-
// Modify the imported shape
|
|
214
|
-
const modified = shape(imported).fillet(2).translate([0, 0, 10]).val;
|
|
215
|
-
|
|
216
|
-
// Export back to STEP
|
|
217
|
-
const outputBlob = unwrap(exportSTEP(modified));
|
|
87
|
+
import opencascade from 'brepjs-opencascade';
|
|
88
|
+
import { initFromOC } from 'brepjs';
|
|
218
89
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
writeFileSync('output.step', Buffer.from(await outputBlob.arrayBuffer()));
|
|
90
|
+
const oc = await opencascade();
|
|
91
|
+
initFromOC(oc);
|
|
222
92
|
```
|
|
223
93
|
|
|
224
|
-
|
|
94
|
+
## Features
|
|
225
95
|
|
|
226
|
-
|
|
96
|
+
**Modeling** - `box`, `cylinder`, `sphere`, `cone`, `torus`, `ellipsoid`, `polyhedron` plus `extrude`, `revolve`, `loft`, `sweep` from 2D sketches
|
|
227
97
|
|
|
228
|
-
|
|
229
|
-
import { registerKernel, withKernel, box } from 'brepjs';
|
|
98
|
+
**Booleans** - `fuse`, `cut`, `intersect`, `section`, `split`, `slice` with batch variants `fuseAll`, `cutAll`
|
|
230
99
|
|
|
231
|
-
|
|
232
|
-
const result = box(10, 10, 10); // uses your kernel
|
|
233
|
-
```
|
|
100
|
+
**Modifiers** - `fillet`, `chamfer`, `shell`, `offset`, `thicken`, `resize`
|
|
234
101
|
|
|
235
|
-
|
|
102
|
+
**Transforms** - `translate`, `rotate`, `mirror`, `scale`, `applyMatrix`, `composeTransforms`, `transformCopy`
|
|
236
103
|
|
|
237
|
-
|
|
104
|
+
**Sketching** - `draw`, `drawRectangle`, `drawCircle`, `Sketcher`, `sketchCircle`, `sketchHelix` for 2D profiles and paths
|
|
238
105
|
|
|
239
|
-
|
|
106
|
+
**Queries** - `edgeFinder`, `faceFinder`, `wireFinder`, `vertexFinder` with composable filters like `.inDirection('Z')`, `.ofCurveType('CIRCLE')`, `.ofLength(10)`
|
|
240
107
|
|
|
241
|
-
|
|
242
|
-
import { box, cylinder, cut, fillet, edgeFinder, unwrap, exportSTEP } from 'brepjs/quick';
|
|
243
|
-
|
|
244
|
-
function makeBracket(width: number, holeRadius: number) {
|
|
245
|
-
const base = box(width, 20, 10);
|
|
246
|
-
const hole = cylinder(holeRadius, 15, { at: [width / 2, 10, -2] });
|
|
247
|
-
const drilled = unwrap(cut(base, hole));
|
|
248
|
-
const edges = edgeFinder().inDirection('Z').findAll(drilled);
|
|
249
|
-
return unwrap(fillet(drilled, edges, 1.5));
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// Generate variants
|
|
253
|
-
for (const width of [30, 40, 50, 60]) {
|
|
254
|
-
const part = makeBracket(width, width / 10);
|
|
255
|
-
const step = unwrap(exportSTEP(part));
|
|
256
|
-
console.log(`${width}mm bracket: ${step.size} bytes`);
|
|
257
|
-
}
|
|
258
|
-
```
|
|
108
|
+
**Measurement** - `measureVolume`, `measureArea`, `measureLength`, `measureDistance`, `checkInterference`
|
|
259
109
|
|
|
260
|
-
|
|
110
|
+
**Import/Export** - STEP, STL, glTF/GLB, DXF (import + export), 3MF, OBJ, SVG (import). Assembly export with colors and names via `exportAssemblySTEP`
|
|
261
111
|
|
|
262
|
-
|
|
263
|
-
npm run example examples/mounting-block.ts
|
|
264
|
-
```
|
|
112
|
+
**Advanced Geometry** - `hull`, `minkowski`, `fill`, `roof`, `surfaceFromGrid`
|
|
265
113
|
|
|
266
|
-
|
|
267
|
-
| ----------------------------------------------------- | ------------ | -------------------------------------------------------------- |
|
|
268
|
-
| [mounting-block.ts](./examples/mounting-block.ts) | Beginner | Game die with filleted edges and `cutAll` dot indentations |
|
|
269
|
-
| [shelf-bracket.ts](./examples/shelf-bracket.ts) | Intermediate | Spur gear with `rotate` patterning and `fuseAll` teeth |
|
|
270
|
-
| [pen-cup.ts](./examples/pen-cup.ts) | Intermediate | Hollowed container using `shell` and `faceFinder` |
|
|
271
|
-
| [lofted-vase.ts](./examples/lofted-vase.ts) | Advanced | Multi-section `loft` through circular profiles, then shelled |
|
|
272
|
-
| [compartment-tray.ts](./examples/compartment-tray.ts) | Advanced | Storage tray with dividers: `fuseAll` → `intersect` → `cutAll` |
|
|
114
|
+
**Colors** - Per-shape colors that propagate through booleans and modifiers
|
|
273
115
|
|
|
274
|
-
|
|
116
|
+
**Rendering** - `mesh` and `toBufferGeometryData` for Three.js / WebGL integration
|
|
275
117
|
|
|
276
|
-
|
|
118
|
+
**Text** - `loadFont`, `drawText`, `sketchText`, `textMetrics`
|
|
277
119
|
|
|
278
|
-
|
|
279
|
-
import { box, translate, fuse, exportSTEP } from 'brepjs';
|
|
280
|
-
```
|
|
120
|
+
**Healing** - `autoHeal`, `healSolid`, `healFace`, `isValid` for fixing imported geometry
|
|
281
121
|
|
|
282
|
-
|
|
122
|
+
**Patterns** - `linearPattern`, `circularPattern` for arraying shapes
|
|
283
123
|
|
|
284
|
-
|
|
285
|
-
import { box, fuse, fillet } from 'brepjs/topology';
|
|
286
|
-
import { importSTEP, exportSTEP } from 'brepjs/io';
|
|
287
|
-
import { measureVolume } from 'brepjs/measurement';
|
|
288
|
-
import { edgeFinder, faceFinder } from 'brepjs/query';
|
|
289
|
-
import { sketchCircle, draw, drawRectangle, drawCircle } from 'brepjs/sketching';
|
|
290
|
-
import { createAssemblyNode } from 'brepjs/operations';
|
|
291
|
-
import { createWorkerClient } from 'brepjs/worker';
|
|
292
|
-
import { Result, isOk, unwrap } from 'brepjs/result';
|
|
293
|
-
import { toVec3, vecAdd, vecNormalize } from 'brepjs/vectors';
|
|
294
|
-
```
|
|
124
|
+
**Assemblies** - `createAssemblyNode`, `addChild`, `addMate`, `walkAssembly`, `collectShapes`
|
|
295
125
|
|
|
296
|
-
|
|
126
|
+
**Face Tracking** - Face origin tracking and face tags across boolean operations
|
|
297
127
|
|
|
298
|
-
|
|
128
|
+
**Workers** - `createWorkerClient`, `createWorkerHandler` for off-main-thread operations
|
|
299
129
|
|
|
300
|
-
|
|
301
|
-
const result = fuse(a, b);
|
|
130
|
+
**History** - `createHistory`, `addStep`, `undoLast`, `replayHistory` for parametric undo/replay
|
|
302
131
|
|
|
303
|
-
|
|
304
|
-
const fused = result.value;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
// Or throw on failure
|
|
308
|
-
const fused = unwrap(fuse(a, b));
|
|
309
|
-
```
|
|
132
|
+
**Error Handling** - `Result<T,E>` instead of exceptions. `isOk()`, `unwrap()`, `match()`
|
|
310
133
|
|
|
311
134
|
## Architecture
|
|
312
135
|
|
|
313
|
-
Four layers with enforced import boundaries (imports flow downward only):
|
|
314
|
-
|
|
315
136
|
```
|
|
316
137
|
Layer 3 sketching/, text/, projection/ High-level API
|
|
317
138
|
Layer 2 topology/, operations/, 2d/ ... Domain logic
|
|
@@ -319,21 +140,23 @@ Layer 1 core/ Types, memory, errors
|
|
|
319
140
|
Layer 0 kernel/, utils/ WASM bindings
|
|
320
141
|
```
|
|
321
142
|
|
|
143
|
+
Imports flow downward only. Boundaries are enforced in CI.
|
|
144
|
+
|
|
322
145
|
## Documentation
|
|
323
146
|
|
|
324
|
-
- [API Reference](https://andymai.github.io/brepjs/)
|
|
325
|
-
- [Zero to Shape](./docs/zero-to-shape.md)
|
|
326
|
-
- [Getting Started](./docs/getting-started.md)
|
|
327
|
-
- [B-Rep Concepts](./docs/concepts.md)
|
|
328
|
-
- [Cheat Sheet](./docs/cheat-sheet.md)
|
|
329
|
-
- [Cookbook](./docs/cookbook.md)
|
|
330
|
-
- [Which API?](./docs/which-api.md)
|
|
331
|
-
- [Function Lookup](./docs/function-lookup.md)
|
|
332
|
-
- [Memory Management](./docs/memory-management.md)
|
|
333
|
-
- [Error Reference](./docs/errors.md)
|
|
334
|
-
- [Architecture](./docs/architecture.md)
|
|
335
|
-
- [Performance](./docs/performance.md)
|
|
336
|
-
- [Compatibility](./docs/compatibility.md)
|
|
147
|
+
- [API Reference](https://andymai.github.io/brepjs/): Searchable TypeDoc reference
|
|
148
|
+
- [Zero to Shape](./docs/zero-to-shape.md): First shape in 60 seconds
|
|
149
|
+
- [Getting Started](./docs/getting-started.md): From install to first shape
|
|
150
|
+
- [B-Rep Concepts](./docs/concepts.md): Vertices, edges, faces, solids
|
|
151
|
+
- [Cheat Sheet](./docs/cheat-sheet.md): Single-page reference for common operations
|
|
152
|
+
- [Cookbook](./docs/cookbook.md): Practical recipes for common CAD workflows
|
|
153
|
+
- [Which API?](./docs/which-api.md): Sketcher vs functional vs Drawing
|
|
154
|
+
- [Function Lookup](./docs/function-lookup.md): Alphabetical index of every export
|
|
155
|
+
- [Memory Management](./docs/memory-management.md): Resource cleanup patterns
|
|
156
|
+
- [Error Reference](./docs/errors.md): Error codes and recovery
|
|
157
|
+
- [Architecture](./docs/architecture.md): Layer diagram and module overview
|
|
158
|
+
- [Performance](./docs/performance.md): Optimization tips
|
|
159
|
+
- [Compatibility](./docs/compatibility.md): Tested environments
|
|
337
160
|
|
|
338
161
|
## Packages
|
|
339
162
|
|
|
@@ -344,7 +167,7 @@ Layer 0 kernel/, utils/ WASM bindings
|
|
|
344
167
|
|
|
345
168
|
## Projects Using brepjs
|
|
346
169
|
|
|
347
|
-
- [Gridfinity Layout Tool](https://github.com/andymai/gridfinity-layout-tool)
|
|
170
|
+
- [Gridfinity Layout Tool](https://github.com/andymai/gridfinity-layout-tool): Web-based layout generator for Gridfinity storage systems
|
|
348
171
|
|
|
349
172
|
## Development
|
|
350
173
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brepjs",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.5.0",
|
|
4
4
|
"description": "Web CAD library with pluggable geometry kernel",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cad",
|
|
@@ -182,13 +182,11 @@
|
|
|
182
182
|
"bench:json": "BENCH_KERNELS=both BENCH_OUTPUT_JSON=1 vitest run --config vitest.bench.config.ts",
|
|
183
183
|
"check:boundaries:staged": "bash scripts/check-layer-boundaries.sh --staged",
|
|
184
184
|
"check:readme-reminders": "bash scripts/check-readme-reminders.sh",
|
|
185
|
-
"example": "npx tsx",
|
|
186
185
|
"knip": "knip",
|
|
187
186
|
"validate": "bash scripts/validate-change.sh",
|
|
188
187
|
"size": "size-limit",
|
|
189
188
|
"docs:api": "typedoc",
|
|
190
189
|
"docs:generate-lookup": "npx tsx scripts/generate-function-lookup.ts",
|
|
191
|
-
"docs:generate-previews": "npx tsx scripts/generate-example-previews.ts",
|
|
192
190
|
"prepare": "husky && bash scripts/ensure-wasm.sh"
|
|
193
191
|
},
|
|
194
192
|
"devDependencies": {
|
|
@@ -214,7 +212,7 @@
|
|
|
214
212
|
"vitest": "4.0.18"
|
|
215
213
|
},
|
|
216
214
|
"peerDependencies": {
|
|
217
|
-
"brepjs-opencascade": "^0.5.1 || ^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0",
|
|
215
|
+
"brepjs-opencascade": "^0.5.1 || ^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.0",
|
|
218
216
|
"brepkit-wasm": "^0.10.1 || ^1.0.0"
|
|
219
217
|
},
|
|
220
218
|
"peerDependenciesMeta": {
|