brepjs 8.7.5 → 8.7.6
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 +27 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,11 +45,13 @@ initFromOC(oc);
|
|
|
45
45
|
|
|
46
46
|
## Features
|
|
47
47
|
|
|
48
|
-
**Modeling** — `box`, `cylinder`, `sphere`, `cone`, `torus`, `ellipsoid` plus `extrude`, `revolve`, `loft`, `sweep` from 2D sketches
|
|
48
|
+
**Modeling** — `box`, `cylinder`, `sphere`, `cone`, `torus`, `ellipsoid`, `polyhedron` plus `extrude`, `revolve`, `loft`, `sweep` from 2D sketches
|
|
49
49
|
|
|
50
50
|
**Booleans** — `fuse`, `cut`, `intersect`, `section`, `split`, `slice` with batch variants `fuseAll`, `cutAll`
|
|
51
51
|
|
|
52
|
-
**Modifiers** — `fillet`, `chamfer`, `shell`, `offset`, `thicken`
|
|
52
|
+
**Modifiers** — `fillet`, `chamfer`, `shell`, `offset`, `thicken`, `resize`. Accepts `ShapeFinder` directly
|
|
53
|
+
|
|
54
|
+
**Transforms** — `translate`, `rotate`, `mirror`, `scale`, `applyMatrix`, `composeTransforms`, `transformCopy`
|
|
53
55
|
|
|
54
56
|
**Sketching** — `draw`, `drawRectangle`, `drawCircle`, `Sketcher`, `sketchCircle`, `sketchHelix` for 2D-to-3D workflows
|
|
55
57
|
|
|
@@ -57,17 +59,23 @@ initFromOC(oc);
|
|
|
57
59
|
|
|
58
60
|
**Measurement** — `measureVolume`, `measureArea`, `measureLength`, `measureDistance`, `checkInterference`
|
|
59
61
|
|
|
60
|
-
**Import/Export** — STEP, STL,
|
|
62
|
+
**Import/Export** — STEP, STL, glTF/GLB, DXF (import + export), 3MF, OBJ, SVG (import). Assembly export with colors and names via `exportAssemblySTEP`
|
|
63
|
+
|
|
64
|
+
**Advanced Geometry** — `hull`, `minkowski`, `fill`, `roof`, `surfaceFromGrid`
|
|
65
|
+
|
|
66
|
+
**Colors** — Per-shape colors that propagate through booleans and modifiers
|
|
61
67
|
|
|
62
68
|
**Rendering** — `mesh` and `toBufferGeometryData` for Three.js / WebGL integration
|
|
63
69
|
|
|
64
|
-
**Text** — `loadFont`, `drawText`, `sketchText`
|
|
70
|
+
**Text** — `loadFont`, `drawText`, `sketchText`, `textMetrics`
|
|
65
71
|
|
|
66
72
|
**Healing** — `autoHeal`, `healSolid`, `healFace`, `isValid` for fixing imported geometry
|
|
67
73
|
|
|
68
74
|
**Patterns** — `linearPattern`, `circularPattern` for arraying shapes
|
|
69
75
|
|
|
70
|
-
**Assemblies** — `createAssemblyNode`, `addChild`, `walkAssembly`, `collectShapes
|
|
76
|
+
**Assemblies** — `createAssemblyNode`, `addChild`, `walkAssembly`, `collectShapes`, assembly mates
|
|
77
|
+
|
|
78
|
+
**Face Tracking** — Face origin tracking and face tags across boolean operations
|
|
71
79
|
|
|
72
80
|
**Workers** — `createWorkerClient`, `createWorkerHandler` for off-main-thread operations
|
|
73
81
|
|
|
@@ -270,20 +278,16 @@ for (const width of [30, 40, 50, 60]) {
|
|
|
270
278
|
## Examples
|
|
271
279
|
|
|
272
280
|
```bash
|
|
273
|
-
npm run example examples/
|
|
281
|
+
npm run example examples/mounting-block.ts
|
|
274
282
|
```
|
|
275
283
|
|
|
276
|
-
| Example
|
|
277
|
-
|
|
|
278
|
-
| [
|
|
279
|
-
| [
|
|
280
|
-
| [
|
|
281
|
-
| [
|
|
282
|
-
| [
|
|
283
|
-
| [threejs-rendering.ts](./examples/threejs-rendering.ts) | Generate mesh data for Three.js |
|
|
284
|
-
| [browser-viewer.ts](./examples/browser-viewer.ts) | Standalone HTML viewer with orbit controls |
|
|
285
|
-
| [import-export.ts](./examples/import-export.ts) | Load, modify, and re-export STEP files |
|
|
286
|
-
| [text-engraving.ts](./examples/text-engraving.ts) | Engrave text on a solid shape |
|
|
284
|
+
| Example | Level | What it does |
|
|
285
|
+
| ----------------------------------------------------- | ------------ | -------------------------------------------------------------- |
|
|
286
|
+
| [mounting-block.ts](./examples/mounting-block.ts) | Beginner | Game die with filleted edges and `cutAll` dot indentations |
|
|
287
|
+
| [shelf-bracket.ts](./examples/shelf-bracket.ts) | Intermediate | Spur gear with `rotate` patterning and `fuseAll` teeth |
|
|
288
|
+
| [pen-cup.ts](./examples/pen-cup.ts) | Intermediate | Hollowed container using `shell` and `faceFinder` |
|
|
289
|
+
| [lofted-vase.ts](./examples/lofted-vase.ts) | Advanced | Multi-section `loft` through circular profiles, then shelled |
|
|
290
|
+
| [compartment-tray.ts](./examples/compartment-tray.ts) | Advanced | Storage tray with dividers: `fuseAll` → `intersect` → `cutAll` |
|
|
287
291
|
|
|
288
292
|
## Imports
|
|
289
293
|
|
|
@@ -300,8 +304,11 @@ import { box, fuse, fillet } from 'brepjs/topology';
|
|
|
300
304
|
import { importSTEP, exportSTEP } from 'brepjs/io';
|
|
301
305
|
import { measureVolume } from 'brepjs/measurement';
|
|
302
306
|
import { edgeFinder, faceFinder } from 'brepjs/query';
|
|
303
|
-
import { sketchCircle, draw } from 'brepjs/sketching';
|
|
307
|
+
import { sketchCircle, draw, drawRectangle, drawCircle } from 'brepjs/sketching';
|
|
304
308
|
import { createAssemblyNode } from 'brepjs/operations';
|
|
309
|
+
import { createWorkerClient } from 'brepjs/worker';
|
|
310
|
+
import { Result, isOk, unwrap } from 'brepjs/result';
|
|
311
|
+
import { toVec3, vecAdd, vecNormalize } from 'brepjs/vectors';
|
|
305
312
|
```
|
|
306
313
|
|
|
307
314
|
## Error Handling
|
|
@@ -333,9 +340,11 @@ Layer 0 kernel/, utils/ WASM bindings
|
|
|
333
340
|
## Documentation
|
|
334
341
|
|
|
335
342
|
- [API Reference](https://andymai.github.io/brepjs/) — Searchable TypeDoc reference
|
|
343
|
+
- [Zero to Shape](./docs/zero-to-shape.md) — First shape in 60 seconds
|
|
336
344
|
- [Getting Started](./docs/getting-started.md) — Install to first part
|
|
337
345
|
- [B-Rep Concepts](./docs/concepts.md) — Vertices, edges, faces, solids
|
|
338
346
|
- [Cheat Sheet](./docs/cheat-sheet.md) — Single-page reference for common operations
|
|
347
|
+
- [Cookbook](./docs/cookbook.md) — Practical recipes for common CAD workflows
|
|
339
348
|
- [Which API?](./docs/which-api.md) — Sketcher vs functional vs Drawing
|
|
340
349
|
- [Function Lookup](./docs/function-lookup.md) — Alphabetical index of every export
|
|
341
350
|
- [Memory Management](./docs/memory-management.md) — Resource cleanup patterns
|