brepjs 8.8.9 → 8.8.10
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 +11 -20
- package/dist/2d/blueprints/Blueprint.d.ts.map +1 -1
- package/dist/2d/blueprints/lib.d.ts +1 -1
- package/dist/2d/curves.d.ts +6 -6
- package/dist/2d/curves.d.ts.map +1 -1
- package/dist/2d/lib/BoundingBox2d.d.ts +4 -4
- package/dist/2d/lib/BoundingBox2d.d.ts.map +1 -1
- package/dist/2d/lib/Curve2D.d.ts +4 -8
- package/dist/2d/lib/Curve2D.d.ts.map +1 -1
- package/dist/2d/lib/approximations.d.ts +7 -7
- package/dist/2d/lib/approximations.d.ts.map +1 -1
- package/dist/2d/lib/index.d.ts +0 -1
- package/dist/2d/lib/index.d.ts.map +1 -1
- package/dist/2d/lib/intersections.d.ts +2 -2
- package/dist/2d/lib/intersections.d.ts.map +1 -1
- package/dist/2d/lib/makeCurves.d.ts +1 -72
- package/dist/2d/lib/makeCurves.d.ts.map +1 -1
- package/dist/2d/lib/offset.d.ts.map +1 -1
- package/dist/2d/lib/svgPath.d.ts +4 -4
- package/dist/2d/lib/svgPath.d.ts.map +1 -1
- package/dist/2d.cjs +2 -3
- package/dist/2d.d.ts +1 -1
- package/dist/2d.d.ts.map +1 -1
- package/dist/2d.js +4 -5
- package/dist/Blueprint-Cg1sY8U_.js +996 -0
- package/dist/Blueprint-Cuwnrcq0.cjs +995 -0
- package/dist/{boolean2D-CypPzZM1.js → boolean2D-B0hb_N_J.js} +100 -162
- package/dist/{boolean2D-KvkerCI-.cjs → boolean2D-DVigykO2.cjs} +106 -168
- package/dist/{booleanFns-DEY86xmR.cjs → booleanFns-BinPUjuE.cjs} +171 -286
- package/dist/{booleanFns-BnLhgDGb.js → booleanFns-McQk_vkU.js} +176 -291
- package/dist/brepjs.cjs +598 -788
- package/dist/brepjs.js +859 -1049
- package/dist/core/constants.d.ts +2 -2
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/definitionMaps.d.ts +1 -1
- package/dist/core/definitionMaps.d.ts.map +1 -1
- package/dist/core/disposal.d.ts +13 -13
- package/dist/core/disposal.d.ts.map +1 -1
- package/dist/core/errors.d.ts +6 -6
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/geometryHelpers.d.ts +5 -5
- package/dist/core/geometryHelpers.d.ts.map +1 -1
- package/dist/core/kernelBoundary.d.ts +28 -0
- package/dist/core/kernelBoundary.d.ts.map +1 -0
- package/dist/core/kernelCall.d.ts +11 -11
- package/dist/core/kernelCall.d.ts.map +1 -1
- package/dist/core/memory.d.ts +1 -1
- package/dist/core/memory.d.ts.map +1 -1
- package/dist/core/planeOps.d.ts +1 -1
- package/dist/core/planeOps.d.ts.map +1 -1
- package/dist/core/shapeTypes.d.ts +24 -24
- package/dist/core/shapeTypes.d.ts.map +1 -1
- package/dist/core.cjs +9 -9
- package/dist/core.d.ts +4 -4
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +8 -8
- package/dist/{cornerFinder-DLHDc022.cjs → cornerFinder-BhVNlOdi.cjs} +1 -1
- package/dist/{cornerFinder-BurQenn5.js → cornerFinder-CAbbu5ey.js} +1 -1
- package/dist/curveFns-DOxGv1Kp.js +114 -0
- package/dist/curveFns-Dkh5ATr7.cjs +113 -0
- package/dist/{drawFns-BY9W9rPP.js → drawFns-CrTzO8Xx.js} +48 -90
- package/dist/{drawFns-ibZFQZkt.cjs → drawFns-RQddWodf.cjs} +54 -96
- package/dist/{errors-CHfaHQSt.js → errors-C_XjfNt5.js} +13 -13
- package/dist/{errors-BYb4tL5h.cjs → errors-HU7EpHt3.cjs} +11 -11
- package/dist/faceFns-De_G2bge.cjs +193 -0
- package/dist/faceFns-QJ1CIpJa.js +194 -0
- package/dist/{helpers-DQGErXAX.cjs → helpers-BSxo9wRD.cjs} +9 -21
- package/dist/{helpers-SajoWDKO.js → helpers-CasFo61E.js} +9 -21
- package/dist/index.d.ts +9 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/io/dxfImportFns.d.ts +1 -1
- package/dist/io/dxfImportFns.d.ts.map +1 -1
- package/dist/io/importFns.d.ts.map +1 -1
- package/dist/io/threemfImportFns.d.ts.map +1 -1
- package/dist/io.cjs +25 -136
- package/dist/io.js +25 -136
- package/dist/kernel/advancedOps.d.ts +139 -0
- package/dist/kernel/advancedOps.d.ts.map +1 -0
- package/dist/kernel/booleanOps.d.ts +10 -10
- package/dist/kernel/booleanOps.d.ts.map +1 -1
- package/dist/kernel/constructorOps.d.ts +16 -11
- package/dist/kernel/constructorOps.d.ts.map +1 -1
- package/dist/kernel/curveOps.d.ts +3 -3
- package/dist/kernel/curveOps.d.ts.map +1 -1
- package/dist/kernel/defaultAdapter.d.ts +393 -0
- package/dist/kernel/defaultAdapter.d.ts.map +1 -0
- package/dist/kernel/evolutionOps.d.ts +28 -0
- package/dist/kernel/evolutionOps.d.ts.map +1 -0
- package/dist/kernel/exportOps.d.ts +10 -0
- package/dist/kernel/exportOps.d.ts.map +1 -0
- package/dist/kernel/extendedConstructorOps.d.ts +57 -0
- package/dist/kernel/extendedConstructorOps.d.ts.map +1 -0
- package/dist/kernel/geometryQueryOps.d.ts +74 -0
- package/dist/kernel/geometryQueryOps.d.ts.map +1 -0
- package/dist/kernel/healingOps.d.ts +4 -4
- package/dist/kernel/healingOps.d.ts.map +1 -1
- package/dist/kernel/historyOps.d.ts +15 -0
- package/dist/kernel/historyOps.d.ts.map +1 -0
- package/dist/kernel/hullOps.d.ts +4 -4
- package/dist/kernel/hullOps.d.ts.map +1 -1
- package/dist/kernel/index.d.ts +32 -7
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/kernel/ioOps.d.ts +7 -7
- package/dist/kernel/ioOps.d.ts.map +1 -1
- package/dist/kernel/kernel2dOps.d.ts +114 -0
- package/dist/kernel/kernel2dOps.d.ts.map +1 -0
- package/dist/kernel/kernel2dTypes.d.ts +135 -0
- package/dist/kernel/kernel2dTypes.d.ts.map +1 -0
- package/dist/kernel/measureOps.d.ts +13 -17
- package/dist/kernel/measureOps.d.ts.map +1 -1
- package/dist/kernel/meshOps.d.ts +7 -7
- package/dist/kernel/meshOps.d.ts.map +1 -1
- package/dist/kernel/modifierOps.d.ts +10 -10
- package/dist/kernel/modifierOps.d.ts.map +1 -1
- package/dist/kernel/sweepOps.d.ts +7 -7
- package/dist/kernel/sweepOps.d.ts.map +1 -1
- package/dist/kernel/topologyOps.d.ts +14 -9
- package/dist/kernel/topologyOps.d.ts.map +1 -1
- package/dist/kernel/transformOps.d.ts +8 -8
- package/dist/kernel/transformOps.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +373 -73
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/loft-Hcw3hHvQ.js +289 -0
- package/dist/loft-KCRAZONS.cjs +288 -0
- package/dist/measurement/measureFns.d.ts +1 -1
- package/dist/measurement/measureFns.d.ts.map +1 -1
- package/dist/measurement-BI0DbJGw.js +130 -0
- package/dist/measurement-DR9n_HOW.cjs +129 -0
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-Diog9oLS.js → meshFns-DWLXaULh.js} +24 -81
- package/dist/{meshFns-CfjNBqS6.cjs → meshFns-DbkySI6N.cjs} +26 -83
- package/dist/operations/exporterFns.d.ts.map +1 -1
- package/dist/operations/exporterUtils.d.ts +1 -40
- package/dist/operations/exporterUtils.d.ts.map +1 -1
- package/dist/operations/exporters.d.ts +3 -3
- package/dist/operations/exporters.d.ts.map +1 -1
- package/dist/operations/extrude.d.ts.map +1 -1
- package/dist/operations/extrudeFns.d.ts +3 -3
- package/dist/operations/extrudeFns.d.ts.map +1 -1
- package/dist/operations/extrudeUtils.d.ts +8 -8
- package/dist/operations/extrudeUtils.d.ts.map +1 -1
- package/dist/operations/guidedSweepFns.d.ts.map +1 -1
- package/dist/operations/loft.d.ts.map +1 -1
- package/dist/operations/loftFns.d.ts +1 -1
- package/dist/operations/loftFns.d.ts.map +1 -1
- package/dist/operations/mateFns.d.ts.map +1 -1
- package/dist/operations/multiSweepFns.d.ts.map +1 -1
- package/dist/operations/patternFns.d.ts.map +1 -1
- package/dist/operations/roofFns.d.ts.map +1 -1
- package/dist/operations/straightSkeleton.d.ts +1 -1
- package/dist/operations-5qDF5CSS.js +493 -0
- package/dist/operations-Co1bLNh8.cjs +492 -0
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/projection/makeProjectedEdges.d.ts.map +1 -1
- package/dist/query/edgeFinder.d.ts.map +1 -1
- package/dist/query/shapeDistanceFilter.d.ts +2 -1
- package/dist/query/shapeDistanceFilter.d.ts.map +1 -1
- package/dist/query.cjs +11 -67
- package/dist/query.js +12 -68
- package/dist/result.cjs +2 -2
- package/dist/result.d.ts +1 -1
- package/dist/result.d.ts.map +1 -1
- package/dist/result.js +4 -4
- package/dist/shapeFns-BC7soJxW.js +402 -0
- package/dist/shapeFns-Bax_zYWH.cjs +401 -0
- package/dist/shapeTypes-DL4j10b_.js +5343 -0
- package/dist/shapeTypes-lhFS-vrZ.cjs +5342 -0
- package/dist/sketching/CompoundSketch.d.ts +1 -1
- package/dist/sketching/CompoundSketch.d.ts.map +1 -1
- package/dist/sketching/Sketch.d.ts +1 -1
- package/dist/sketching/Sketch.d.ts.map +1 -1
- package/dist/sketching/Sketcher.d.ts +1 -1
- package/dist/sketching/Sketcher.d.ts.map +1 -1
- package/dist/sketching/Sketcher2d.d.ts +3 -3
- package/dist/sketching/Sketcher2d.d.ts.map +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/surfaceBuilders-DZuXJNGt.js +176 -0
- package/dist/surfaceBuilders-atbN6bF9.cjs +175 -0
- package/dist/topology/adjacencyFns.d.ts +1 -1
- package/dist/topology/adjacencyFns.d.ts.map +1 -1
- package/dist/topology/api.d.ts +1 -1
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/cast.d.ts +13 -13
- package/dist/topology/cast.d.ts.map +1 -1
- package/dist/topology/colorFns.d.ts +4 -12
- package/dist/topology/colorFns.d.ts.map +1 -1
- package/dist/topology/curveBuilders.d.ts +1 -1
- package/dist/topology/curveBuilders.d.ts.map +1 -1
- package/dist/topology/curveFns.d.ts.map +1 -1
- package/dist/topology/faceFns.d.ts +1 -1
- package/dist/topology/faceFns.d.ts.map +1 -1
- package/dist/topology/faceTagFns.d.ts +4 -12
- package/dist/topology/faceTagFns.d.ts.map +1 -1
- package/dist/topology/healingFns.d.ts +1 -1
- package/dist/topology/healingFns.d.ts.map +1 -1
- package/dist/topology/hullFns.d.ts.map +1 -1
- package/dist/topology/meshCache.d.ts +13 -13
- package/dist/topology/meshCache.d.ts.map +1 -1
- package/dist/topology/meshFns.d.ts.map +1 -1
- package/dist/topology/minkowskiFns.d.ts.map +1 -1
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/polyhedronFns.d.ts.map +1 -1
- package/dist/topology/primitiveFns.d.ts.map +1 -1
- package/dist/topology/shapeBooleans.d.ts +2 -2
- package/dist/topology/shapeBooleans.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts +10 -32
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/solidBuilders.d.ts.map +1 -1
- package/dist/topology/surfaceBuilders.d.ts.map +1 -1
- package/dist/topology/surfaceFns.d.ts.map +1 -1
- package/dist/{topology-XD2qFlgc.js → topology-BVqdnRCJ.js} +51 -90
- package/dist/{topology-CRPSzNkp.cjs → topology-jVTLIQ2V.cjs} +57 -96
- package/dist/topology.cjs +6 -6
- package/dist/topology.js +25 -25
- package/dist/types-CA_xrgDq.cjs +24 -0
- package/dist/types-CWDdqcrq.js +25 -0
- package/dist/utils/ioFilename.d.ts +0 -2
- package/dist/utils/ioFilename.d.ts.map +1 -1
- package/dist/{vectors-9rrStq8t.cjs → vectors-BwRTfFd1.cjs} +14 -8
- package/dist/{vectors-Dp5Iu1KH.js → vectors-CpZfWX0T.js} +13 -7
- package/dist/vectors.cjs +5 -5
- package/dist/vectors.js +2 -2
- package/dist/worker/protocol.d.ts +2 -2
- package/dist/worker/protocol.d.ts.map +1 -1
- package/package.json +8 -3
- package/dist/2d/lib/ocWrapper.d.ts +0 -11
- package/dist/2d/lib/ocWrapper.d.ts.map +0 -1
- package/dist/Blueprint-C7JlgasP.js +0 -1440
- package/dist/Blueprint-CTrwIDuQ.cjs +0 -1439
- package/dist/core/occtBoundary.d.ts +0 -28
- package/dist/core/occtBoundary.d.ts.map +0 -1
- package/dist/curveFns-D0L3YcH-.cjs +0 -286
- package/dist/curveFns-VRW_cski.js +0 -287
- package/dist/faceFns-B8xnZw-f.cjs +0 -358
- package/dist/faceFns-DG4bu-QB.js +0 -359
- package/dist/kernel/occtAdapter.d.ts +0 -98
- package/dist/kernel/occtAdapter.d.ts.map +0 -1
- package/dist/loft-CfKcU3Y1.js +0 -531
- package/dist/loft-hhMumRtt.cjs +0 -530
- package/dist/measurement-C4Ofuy_y.cjs +0 -200
- package/dist/measurement-DzRb6oYN.js +0 -201
- package/dist/occtBoundary-CN_uQJtA.cjs +0 -2219
- package/dist/occtBoundary-Ct0tN8cs.js +0 -2220
- package/dist/operations-BFDNdchq.js +0 -709
- package/dist/operations-CZUFSBuY.cjs +0 -708
- package/dist/shapeFns-D4MYB8um.cjs +0 -557
- package/dist/shapeFns-DNxuGWvV.js +0 -558
- package/dist/shapeTypes-D34s68Xi.js +0 -347
- package/dist/shapeTypes-sXITvFkF.cjs +0 -346
- package/dist/surfaceBuilders-DEd0HUri.js +0 -436
- package/dist/surfaceBuilders-DeFCNwZl.cjs +0 -435
package/README.md
CHANGED
|
@@ -23,9 +23,7 @@ const step = unwrap(exportSTEP(part));
|
|
|
23
23
|
|
|
24
24
|
## Why brepjs?
|
|
25
25
|
|
|
26
|
-
Most CAD libraries for the web are mesh-based — they work with triangles, not real geometry. brepjs gives you boundary representation (B-Rep) modeling
|
|
27
|
-
|
|
28
|
-
Use it for parametric modeling, 3D configurators, CAD file processing, or anywhere you need solid geometry in JavaScript.
|
|
26
|
+
Most CAD libraries for the web are mesh-based — they work with triangles, not real geometry. brepjs gives you boundary representation (B-Rep) modeling with a pluggable geometry kernel. Exact booleans, fillets, and export to formats real CAD software can open.
|
|
29
27
|
|
|
30
28
|
## Install
|
|
31
29
|
|
|
@@ -232,25 +230,18 @@ import { writeFileSync } from 'fs';
|
|
|
232
230
|
writeFileSync('output.step', Buffer.from(await outputBlob.arrayBuffer()));
|
|
233
231
|
```
|
|
234
232
|
|
|
235
|
-
### Custom
|
|
233
|
+
### Custom geometry kernel
|
|
236
234
|
|
|
237
|
-
|
|
235
|
+
brepjs is kernel-agnostic — you can register alternative geometry kernels at runtime:
|
|
238
236
|
|
|
239
237
|
```typescript
|
|
240
|
-
import {
|
|
241
|
-
|
|
242
|
-
// Standard build
|
|
243
|
-
import opencascade from 'brepjs-opencascade';
|
|
244
|
-
const oc = await opencascade();
|
|
245
|
-
initFromOC(oc);
|
|
238
|
+
import { registerKernel, withKernel, box } from 'brepjs';
|
|
246
239
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
const customKernel = await customOC({ locateFile: (f) => `/wasm/${f}` });
|
|
250
|
-
initFromOC(customKernel); // same API — any compatible OC instance works
|
|
240
|
+
registerKernel('my-kernel', myAdapter);
|
|
241
|
+
const result = box(10, 10, 10); // uses your kernel
|
|
251
242
|
```
|
|
252
243
|
|
|
253
|
-
The kernel abstraction layer in `src/kernel/`
|
|
244
|
+
The kernel abstraction layer in `src/kernel/` ensures brepjs code never touches kernel internals directly. See the [Custom Kernel Guide](docs/kernel-swap.md) for writing your own `KernelAdapter`.
|
|
254
245
|
|
|
255
246
|
### Parametric variations
|
|
256
247
|
|
|
@@ -355,10 +346,10 @@ Layer 0 kernel/, utils/ WASM bindings
|
|
|
355
346
|
|
|
356
347
|
## Packages
|
|
357
348
|
|
|
358
|
-
| Package | Description
|
|
359
|
-
| ---------------------------------------------------------------------- |
|
|
360
|
-
| [brepjs](https://www.npmjs.com/package/brepjs) | Core library
|
|
361
|
-
| [brepjs-opencascade](https://www.npmjs.com/package/brepjs-opencascade) |
|
|
349
|
+
| Package | Description |
|
|
350
|
+
| ---------------------------------------------------------------------- | ------------------------------ |
|
|
351
|
+
| [brepjs](https://www.npmjs.com/package/brepjs) | Core library |
|
|
352
|
+
| [brepjs-opencascade](https://www.npmjs.com/package/brepjs-opencascade) | Default geometry kernel (WASM) |
|
|
362
353
|
|
|
363
354
|
## Projects Using brepjs
|
|
364
355
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Blueprint.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/Blueprint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Blueprint.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/Blueprint.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAY9C,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAQvE,OAAO,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAQ,MAAM,0BAA0B,CAAC;AAQrE,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAWzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,YAAW,gBAAgB;IACxD,6DAA6D;IAC7D,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,SAAS,CAAC,YAAY,EAAE,IAAI,GAAG,aAAa,CAAC;IAC7C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA0C;IACvE,OAAO,CA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S,CACP,KAAK,EAAE,QAAQ,EACf,IAAI,EAAE,UAAU,EAChB,EACE,MAAa,EACb,MAAa,EACb,UAAc,GACf,GAAE;QACD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;QAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;KAChB;IAgBR,iEAAiE;IACjE,UAAU;IAcV,2DAA2D;IAC3D,SAAS;IAIT;;;;OAIG;IACH,YAAY,CAAC,MAAM,SAAI;IAIvB,sEAAsE;IACtE,UAAU;IAIV;;;;OAIG;IACH,KAAK,CAAC,MAAM,SAAI;IAIhB,8CAA8C;IAC9C,IAAI,UAAU,IAAI,OAAO,CAGxB;IAED,2CAA2C;IAC3C,IAAI,SAAS,IAAI,OAAO,CAGvB;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAmBjC,gFAAgF;IAChF,QAAQ;IAIR;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,SAAS;CAc5B"}
|
|
@@ -48,7 +48,7 @@ export interface DrawingInterface {
|
|
|
48
48
|
* face). This is the default, but currently supported only for planar
|
|
49
49
|
* and circular faces
|
|
50
50
|
* - `bounds` normalises the UV parameters on the face to [0,1] intervals.
|
|
51
|
-
* - `native` uses the default UV parameters of
|
|
51
|
+
* - `native` uses the default UV parameters of kernel
|
|
52
52
|
*/
|
|
53
53
|
sketchOnFace(face: Face, scaleMode: ScaleMode): SketchData | SketchData[] | (SketchData | SketchData[])[];
|
|
54
54
|
/**
|
package/dist/2d/curves.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { KernelType } from '../kernel/types.js';
|
|
2
2
|
import { Plane } from '../core/planeTypes.js';
|
|
3
3
|
import { Face, Edge } from '../core/shapeTypes.js';
|
|
4
4
|
import { Result } from '../core/result.js';
|
|
@@ -8,14 +8,14 @@ export declare const curvesBoundingBox: (curves: Curve2D[]) => BoundingBox2d;
|
|
|
8
8
|
/** Convert 2D curves to 3D edges by projecting them onto a plane. */
|
|
9
9
|
export declare function curvesAsEdgesOnPlane(curves: Curve2D[], plane: Plane): Edge[];
|
|
10
10
|
/** Convert 2D curves to 3D edges by mapping them onto a parametric surface. */
|
|
11
|
-
export declare const curvesAsEdgesOnSurface: (curves: Curve2D[], geomSurf:
|
|
12
|
-
/** Apply an
|
|
13
|
-
export declare const transformCurves: (curves: Curve2D[], transformation:
|
|
11
|
+
export declare const curvesAsEdgesOnSurface: (curves: Curve2D[], geomSurf: KernelType) => Edge[];
|
|
12
|
+
/** Apply an opaque gp_GTrsf2d transformation to an array of 2D curves. */
|
|
13
|
+
export declare const transformCurves: (curves: Curve2D[], transformation: KernelType | null) => Curve2D[];
|
|
14
14
|
/**
|
|
15
|
-
* Raw
|
|
15
|
+
* Raw kernel `gp_GTrsf2d` handle.
|
|
16
16
|
* Callers are responsible for lifetime management.
|
|
17
17
|
*/
|
|
18
|
-
export type Transformation2D =
|
|
18
|
+
export type Transformation2D = KernelType;
|
|
19
19
|
/** Create a 2D affinity (non-uniform scale) transformation along a direction. */
|
|
20
20
|
export declare const stretchTransform2d: (ratio: number, direction: Point2D, origin?: Point2D) => Transformation2D;
|
|
21
21
|
/** Create a 2D translation transformation. */
|
package/dist/2d/curves.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curves.d.ts","sourceRoot":"","sources":["../../src/2d/curves.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"curves.d.ts","sourceRoot":"","sources":["../../src/2d/curves.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAu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S,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEzD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,EAAE,EACjB,IAAI,EAAE,IAAI,EACV,KAAK,GAAE,SAAsB,GAC5B,MAAM,CAAC,IAAI,EAAE,CAAC,CA0EhB;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAQxD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { KernelType } from '../../kernel/types.js';
|
|
2
2
|
import { Point2D } from './definitions.js';
|
|
3
3
|
/**
|
|
4
|
-
* Axis-aligned 2D bounding box backed by an
|
|
4
|
+
* Axis-aligned 2D bounding box backed by an kernel `Bnd_Box2d`.
|
|
5
5
|
*
|
|
6
6
|
* Provides bounds queries, containment tests, and union operations for
|
|
7
7
|
* spatial indexing of 2D geometry.
|
|
@@ -9,8 +9,8 @@ import { Point2D } from './definitions.js';
|
|
|
9
9
|
export declare class BoundingBox2d {
|
|
10
10
|
private readonly _wrapped;
|
|
11
11
|
private _deleted;
|
|
12
|
-
constructor(wrapped?:
|
|
13
|
-
get wrapped():
|
|
12
|
+
constructor(wrapped?: KernelType);
|
|
13
|
+
get wrapped(): KernelType;
|
|
14
14
|
delete(): void;
|
|
15
15
|
/** Return a human-readable string of the form `(xMin,yMin) - (xMax,yMax)`. */
|
|
16
16
|
get repr(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BoundingBox2d.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/BoundingBox2d.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"BoundingBox2d.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/BoundingBox2d.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGhD;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAa;IACtC,OAAO,CAAC,QAAQ,CAAS;gBAEb,OAAO,CAAC,EAAE,UAAU;IAKhC,IAAI,OAAO,IAAI,UAAU,CAGxB;IAED,MAAM,IAAI,IAAI;IAQd,8EAA8E;IAC9E,IAAI,IAAI,IAAI,MAAM,CAGjB;IAED,iEAAiE;IACjE,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAM/B;IAED,mDAAmD;IACnD,IAAI,MAAM,IAAI,OAAO,CAGpB;IAED,uDAAuD;IACvD,IAAI,KAAK,IAAI,MAAM,CAGlB;IAED,wDAAwD;IACxD,IAAI,MAAM,IAAI,MAAM,CAGnB;IAED;;;;OAIG;IACH,YAAY,CAAC,cAAc,SAAI,GAAG,OAAO;IAWzC,mDAAmD;IACnD,GAAG,CAAC,KAAK,EAAE,aAAa;IAIxB,0EAA0E;IAC1E,KAAK,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IAIpC,iFAAiF;IACjF,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;CAGvC"}
|
package/dist/2d/lib/Curve2D.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { KernelType } from '../../kernel/types.js';
|
|
2
2
|
import { CurveType } from '../../core/definitionMaps.js';
|
|
3
3
|
import { Result } from '../../core/result.js';
|
|
4
4
|
import { BoundingBox2d } from './BoundingBox2d.js';
|
|
@@ -10,7 +10,7 @@ import { Point2D } from './definitions.js';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function deserializeCurve2D(data: string): Curve2D;
|
|
12
12
|
/**
|
|
13
|
-
* Handle-wrapped 2D parametric curve backed by an
|
|
13
|
+
* Handle-wrapped 2D parametric curve backed by an kernel `kernel 2D curve`.
|
|
14
14
|
*
|
|
15
15
|
* Provides evaluation, splitting, projection, tangent queries, and distance
|
|
16
16
|
* computations on a single parametric curve.
|
|
@@ -21,15 +21,13 @@ export declare class Curve2D {
|
|
|
21
21
|
_boundingBox: null | BoundingBox2d;
|
|
22
22
|
private _firstPoint;
|
|
23
23
|
private _lastPoint;
|
|
24
|
-
constructor(handle:
|
|
25
|
-
get wrapped():
|
|
24
|
+
constructor(handle: KernelType);
|
|
25
|
+
get wrapped(): KernelType;
|
|
26
26
|
delete(): void;
|
|
27
27
|
/** Compute (and cache) the 2D bounding box of this curve. */
|
|
28
28
|
get boundingBox(): BoundingBox2d;
|
|
29
29
|
/** Return a human-readable representation, e.g. `LINE (0,0) - (1,1)`. */
|
|
30
30
|
get repr(): string;
|
|
31
|
-
/** Access the underlying OCCT `Geom2d_Curve` (unwrapped from its handle). */
|
|
32
|
-
get innerCurve(): OcType;
|
|
33
31
|
/** Serialize this curve to a string that can be restored with {@link deserializeCurve2D}. */
|
|
34
32
|
serialize(): string;
|
|
35
33
|
/** Evaluate the curve at the given parameter, returning the 2D point. */
|
|
@@ -42,8 +40,6 @@ export declare class Curve2D {
|
|
|
42
40
|
get firstParameter(): number;
|
|
43
41
|
/** Return the parameter value at the end of the curve. */
|
|
44
42
|
get lastParameter(): number;
|
|
45
|
-
/** Create a `Geom2dAdaptor_Curve` for algorithmic queries (caller must delete). */
|
|
46
|
-
adaptor(): OcType;
|
|
47
43
|
/** Return the geometric type of this curve (e.g. `LINE`, `CIRCLE`, `BSPLINE_CURVE`). */
|
|
48
44
|
get geomType(): CurveType;
|
|
49
45
|
/** Create an independent deep copy of this curve. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Curve2D.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/Curve2D.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Curve2D.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/Curve2D.ts"],"names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AAC,iBAAiB;IAyBzB,gFAAgF;IAChF,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM;IAQhD,8EAA8E;IAC9E,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAIlC;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,SAAO,GAAG,MAAM,CAAC,MAAM,CAAC;IA2B3D;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO;IAe3C;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE,EAAE,SAAS,SAAO,GAAG,OAAO,EAAE;CAiCnE"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { OcType } from '../../kernel/types.js';
|
|
2
1
|
import { Curve2D } from './Curve2D.js';
|
|
3
2
|
/**
|
|
4
|
-
* Approximate a 2D curve as a B-spline via
|
|
3
|
+
* Approximate a 2D curve as a B-spline via the kernel's
|
|
4
|
+
* `approximateCurve2dAsBSpline` method.
|
|
5
5
|
*
|
|
6
|
-
* @param
|
|
6
|
+
* @param curve - The source `Curve2D` to approximate.
|
|
7
7
|
* @param tolerance - Maximum deviation from the original curve.
|
|
8
8
|
* @param continuity - Required geometric continuity of the result.
|
|
9
9
|
* @param maxSegments - Maximum number of B-spline spans.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
13
|
-
* const bspline = approximateAsBSpline(curve
|
|
13
|
+
* const bspline = approximateAsBSpline(curve, 1e-4, 'C1');
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
|
-
export declare const approximateAsBSpline: (
|
|
16
|
+
export declare const approximateAsBSpline: (curve: Curve2D, tolerance?: number, continuity?: "C0" | "C1" | "C2" | "C3", maxSegments?: number) => Curve2D;
|
|
17
17
|
/**
|
|
18
18
|
* Decompose a B-spline curve into an array of Bezier arcs.
|
|
19
19
|
*
|
|
20
|
-
* @param
|
|
20
|
+
* @param curve - A `Curve2D` whose type must be `BSPLINE_CURVE`.
|
|
21
21
|
* @returns An array of Bezier `Curve2D` segments covering the original B-spline.
|
|
22
22
|
*/
|
|
23
|
-
export declare const BSplineToBezier: (
|
|
23
|
+
export declare const BSplineToBezier: (curve: Curve2D) => Curve2D[];
|
|
24
24
|
/** Options for SVG-compatible curve approximation. */
|
|
25
25
|
export interface ApproximationOptions {
|
|
26
26
|
/** Maximum deviation from the original curve. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approximations.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/approximations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"approximations.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/approximations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAC/B,OAAO,OAAO,EACd,kBAAgB,EAChB,aAAY,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAW,EAC5C,oBAAiB,KAChB,OASF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,OAAO,EAMvD,CAAC;AAEF,sDAAsD;AACtD,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,UAAU,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACvC,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,OAAO,EAAE,EACjB,OAAO,GAAE,oBAIR,GACA,OAAO,EAAE,CAsCX"}
|
package/dist/2d/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export * from './precision.js';
|
|
|
2
2
|
export * from './definitions.js';
|
|
3
3
|
export * from './approximations.js';
|
|
4
4
|
export * from './BoundingBox2d.js';
|
|
5
|
-
export * from './ocWrapper.js';
|
|
6
5
|
export * from './vectorOperations.js';
|
|
7
6
|
export * from './intersections.js';
|
|
8
7
|
export * from './Curve2D.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
|
|
@@ -9,11 +9,11 @@ interface IntersectionResult {
|
|
|
9
9
|
/**
|
|
10
10
|
* Compute intersection points and common segments between two 2D curves.
|
|
11
11
|
*
|
|
12
|
-
* Uses an early bounding-box rejection test before delegating to the
|
|
12
|
+
* Uses an early bounding-box rejection test before delegating to the kernel
|
|
13
13
|
* `Geom2dAPI_InterCurveCurve` algorithm.
|
|
14
14
|
*
|
|
15
15
|
* @returns `Ok` with intersection points, common segments, and the endpoints of those segments;
|
|
16
|
-
* or an error result when the
|
|
16
|
+
* or an error result when the kernel intersector fails.
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intersections.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/intersections.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"intersections.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/intersections.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,sBAAsB,CAAC;AAG5D,UAAU,kBAAkB;IAC1B,aAAa,EAAE,OAAO,EAAE,CAAC;IACzB,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B,oBAAoB,EAAE,OAAO,EAAE,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,OAAO,EACd,QAAQ,OAAO,EACf,kBAAgB,KACf,MAAM,CAAC,kBAAkB,CA6B3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,EAAE,kBAAgB,KAAG,MAAM,CAAC,OAAO,EAAE,CAiBpF,CAAC"}
|
|
@@ -4,34 +4,17 @@ import { Curve2D } from './Curve2D.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Creates a 2D segment curve between two points.
|
|
6
6
|
*
|
|
7
|
-
* @param startPoint - The starting point of the segment.
|
|
8
|
-
* @param endPoint - The ending point of the segment.
|
|
9
|
-
*
|
|
10
|
-
* @returns A Curve2D object representing the segment.
|
|
11
|
-
*
|
|
12
7
|
* @category Planar curves
|
|
13
8
|
*/
|
|
14
9
|
export declare const make2dSegmentCurve: (startPoint: Point2D, endPoint: Point2D) => Curve2D;
|
|
15
10
|
/**
|
|
16
11
|
* Creates a 2D arc curve defined by three points.
|
|
17
12
|
*
|
|
18
|
-
* @param startPoint - The starting point of the arc.
|
|
19
|
-
* @param midPoint - The midpoint of the arc.
|
|
20
|
-
* @param endPoint - The ending point of the arc.
|
|
21
|
-
*
|
|
22
|
-
* @returns A Curve2D object representing the arc.
|
|
23
|
-
*
|
|
24
13
|
* @category Planar curves
|
|
25
14
|
*/
|
|
26
15
|
export declare const make2dThreePointArc: (startPoint: Point2D, midPoint: Point2D, endPoint: Point2D) => Curve2D;
|
|
27
16
|
/**
|
|
28
|
-
* Creates a 2D tangent arc curve
|
|
29
|
-
*
|
|
30
|
-
* @param startPoint - The starting point of the arc.
|
|
31
|
-
* @param tangent - The tangent vector at the starting point.
|
|
32
|
-
* @param endPoint - The ending point of the arc.
|
|
33
|
-
*
|
|
34
|
-
* @returns A Curve2D object representing the tangent arc.
|
|
17
|
+
* Creates a 2D tangent arc curve.
|
|
35
18
|
*
|
|
36
19
|
* @category Planar curves
|
|
37
20
|
*/
|
|
@@ -39,78 +22,30 @@ export declare const make2dTangentArc: (startPoint: Point2D, tangent: Point2D, e
|
|
|
39
22
|
/**
|
|
40
23
|
* Creates a 2D circle curve.
|
|
41
24
|
*
|
|
42
|
-
* @param radius - The radius of the circle.
|
|
43
|
-
* @param center - The center point of the circle (default is [0, 0]).
|
|
44
|
-
*
|
|
45
|
-
* @returns A Curve2D object representing the circle.
|
|
46
|
-
*
|
|
47
25
|
* @category Planar curves
|
|
48
26
|
*/
|
|
49
27
|
export declare const make2dCircle: (radius: number, center?: Point2D) => Curve2D;
|
|
50
28
|
/**
|
|
51
29
|
* Creates a 2D ellipse curve.
|
|
52
30
|
*
|
|
53
|
-
* @param majorRadius - The major radius of the ellipse.
|
|
54
|
-
* @param minorRadius - The minor radius of the ellipse.
|
|
55
|
-
* @param xDir - The direction vector for the major axis (default is [1, 0]).
|
|
56
|
-
* @param center - The center point of the ellipse (default is [0, 0]).
|
|
57
|
-
* @param direct - Whether the ellipse is direct (default is true).
|
|
58
|
-
*
|
|
59
|
-
* @returns A Curve2D object representing the ellipse.
|
|
60
|
-
*
|
|
61
31
|
* @category Planar curves
|
|
62
32
|
*/
|
|
63
33
|
export declare const make2dEllipse: (majorRadius: number, minorRadius: number, xDir?: Point2D, center?: Point2D, direct?: boolean) => Curve2D;
|
|
64
34
|
/**
|
|
65
35
|
* Creates a 2D ellipse arc curve.
|
|
66
36
|
*
|
|
67
|
-
* @param majorRadius - The major radius of the ellipse.
|
|
68
|
-
* @param minorRadius - The minor radius of the ellipse.
|
|
69
|
-
* @param startAngle - The starting angle of the arc.
|
|
70
|
-
* @param endAngle - The ending angle of the arc.
|
|
71
|
-
* @param center - The center point of the ellipse (default is [0, 0]).
|
|
72
|
-
* @param xDir - The direction vector for the major axis (default is [1, 0]).
|
|
73
|
-
* @param direct - Whether the ellipse is direct (default is true).
|
|
74
|
-
*
|
|
75
|
-
* @returns A Curve2D object representing the ellipse arc.
|
|
76
|
-
*
|
|
77
37
|
* @category Planar curves
|
|
78
38
|
*/
|
|
79
39
|
export declare const make2dEllipseArc: (majorRadius: number, minorRadius: number, startAngle: number, endAngle: number, center: Point2D | undefined, xDir: Point2D, direct?: boolean) => Curve2D;
|
|
80
40
|
/**
|
|
81
41
|
* Creates a 2D Bezier curve defined by a start point, control points, and an end point.
|
|
82
42
|
*
|
|
83
|
-
* @param startPoint - The starting point of the Bezier curve.
|
|
84
|
-
* @param controls - An array of control points for the Bezier curve.
|
|
85
|
-
* @param endPoint - The ending point of the Bezier curve.
|
|
86
|
-
*
|
|
87
|
-
* @returns A Curve2D object representing the Bezier curve.
|
|
88
|
-
*
|
|
89
43
|
* @category Planar curves
|
|
90
44
|
*/
|
|
91
45
|
export declare const make2dBezierCurve: (startPoint: Point2D, controls: Point2D[], endPoint: Point2D) => Curve2D;
|
|
92
46
|
/**
|
|
93
47
|
* Create a 2D interpolated B-spline curve through the given points.
|
|
94
48
|
*
|
|
95
|
-
* @param points - Ordered through-points for the spline.
|
|
96
|
-
* @param options - Options for the B-spline curve.
|
|
97
|
-
* @param options.tolerance - Maximum deviation from the input points (default 1e-3).
|
|
98
|
-
* @param options.smoothing - Optional `[weight1, weight2, weight3]` smoothing
|
|
99
|
-
* weights. When provided, the `Geom2dAPI_PointsToBSpline` smoothing
|
|
100
|
-
* constructor is used instead of the standard one.
|
|
101
|
-
* @param options.degMax - Maximum polynomial degree (default 3).
|
|
102
|
-
* @param options.degMin - Minimum polynomial degree (default 1).
|
|
103
|
-
*
|
|
104
|
-
* @returns `Ok(Curve2D)` on success, or an error result if the approximation fails.
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* ```ts
|
|
108
|
-
* const spline = unwrap(make2dInerpolatedBSplineCurve(
|
|
109
|
-
* [[0, 0], [1, 2], [3, 1]],
|
|
110
|
-
* { degMax: 3 }
|
|
111
|
-
* ));
|
|
112
|
-
* ```
|
|
113
|
-
*
|
|
114
49
|
* @category Planar curves
|
|
115
50
|
*/
|
|
116
51
|
export declare function make2dInerpolatedBSplineCurve(points: Point2D[], { tolerance, smoothing, degMax, degMin, }?: {
|
|
@@ -122,12 +57,6 @@ export declare function make2dInerpolatedBSplineCurve(points: Point2D[], { toler
|
|
|
122
57
|
/**
|
|
123
58
|
* Create a 2D arc given its endpoints and center point.
|
|
124
59
|
*
|
|
125
|
-
* Both `startPoint` and `endPoint` must lie at the circle's radius distance
|
|
126
|
-
* from `center`. The arc passes through the midpoint of the chord unless
|
|
127
|
-
* `longArc` is `true`, in which case the major arc is produced.
|
|
128
|
-
*
|
|
129
|
-
* @param longArc - When `true`, produce the major arc (greater than 180 degrees).
|
|
130
|
-
*
|
|
131
60
|
* @category Planar curves
|
|
132
61
|
*/
|
|
133
62
|
export declare const make2dArcFromCenter: (startPoint: Point2D, endPoint: Point2D, center: Point2D, longArc?: boolean) => Curve2D;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeCurves.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/makeCurves.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"makeCurves.d.ts","sourceRoot":"","sources":["../../../src/2d/l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,CAAC;IACnB,SAAS,CAAC,EAAE,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACZ,GACL,MAAM,CAAC,OAAO,CAAC,CAcjB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,YAAY,OAAO,EACnB,UAAU,OAAO,EACjB,QAAQ,OAAO,EACf,iBAAe,YAWhB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offset.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/offset.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"offset.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/offset.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAmBhD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,OAAO,EACd,QAAQ,MAAM,KACb,OAAO,GAAG;IAAE,SAAS,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAuEtE,CAAC"}
|
package/dist/2d/lib/svgPath.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { OcType } from '../../kernel/types.js';
|
|
2
1
|
import { Point2D } from './definitions.js';
|
|
2
|
+
import { Curve2D } from './Curve2D.js';
|
|
3
3
|
/**
|
|
4
|
-
* Convert
|
|
4
|
+
* Convert a 2D curve to an SVG path command string.
|
|
5
5
|
*
|
|
6
6
|
* Supports lines, degree-1/2/3 Bezier curves, circular arcs, and elliptical
|
|
7
7
|
* arcs. The caller must ensure the curve has already been converted to an
|
|
8
8
|
* SVG-compatible type (see {@link approximateAsSvgCompatibleCurve}).
|
|
9
9
|
*
|
|
10
|
-
* @param
|
|
10
|
+
* @param curve - A `Curve2D` for the segment to render.
|
|
11
11
|
* @param lastPoint - The endpoint of the curve, used as the SVG command target.
|
|
12
12
|
* @returns An SVG path command such as `L`, `Q`, `C`, or `A`.
|
|
13
13
|
*/
|
|
14
|
-
export declare const adaptedCurveToPathElem: (
|
|
14
|
+
export declare const adaptedCurveToPathElem: (curve: Curve2D, lastPoint: Point2D) => string;
|
|
15
15
|
//# sourceMappingURL=svgPath.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svgPath.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/svgPath.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"svgPath.d.ts","sourceRoot":"","sources":["../../../src/2d/lib/svgPath.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,OAAO,EAAE,WAAW,OAAO,KAAG,MAiE3E,CAAC"}
|
package/dist/2d.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const Blueprint = require("./Blueprint-
|
|
4
|
-
const boolean2D = require("./boolean2D-
|
|
3
|
+
const Blueprint = require("./Blueprint-Cuwnrcq0.cjs");
|
|
4
|
+
const boolean2D = require("./boolean2D-DVigykO2.cjs");
|
|
5
5
|
function reverseCurve(curve) {
|
|
6
6
|
const cloned = curve.clone();
|
|
7
7
|
cloned.reverse();
|
|
@@ -70,7 +70,6 @@ function sketch2DOnFace(bp, face, scaleMode) {
|
|
|
70
70
|
exports.Blueprint = Blueprint.Blueprint;
|
|
71
71
|
exports.BoundingBox2d = Blueprint.BoundingBox2d;
|
|
72
72
|
exports.Curve2D = Blueprint.Curve2D;
|
|
73
|
-
exports.axis2d = Blueprint.axis2d;
|
|
74
73
|
exports.Blueprints = boolean2D.Blueprints;
|
|
75
74
|
exports.CompoundBlueprint = boolean2D.CompoundBlueprint;
|
|
76
75
|
exports.cut2D = boolean2D.cut2D;
|
package/dist/2d.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export { createBlueprint, getBounds2D, getOrientation2D, isInside2D, toSVGPathD,
|
|
|
17
17
|
export { fuseBlueprints, cutBlueprints, intersectBlueprints, } from './2d/blueprints/booleanOperations.js';
|
|
18
18
|
export { fuse2D, cut2D, intersect2D, type Shape2D } from './2d/blueprints/boolean2D.js';
|
|
19
19
|
export { reverseCurve, curve2dBoundingBox, curve2dFirstPoint, curve2dLastPoint, curve2dSplitAt, curve2dParameter, curve2dTangentAt, curve2dIsOnCurve, curve2dDistanceFrom, } from './2d/lib/curve2dFns.js';
|
|
20
|
-
export { type Point2D, BoundingBox2d, Curve2D
|
|
20
|
+
export { type Point2D, BoundingBox2d, Curve2D } from './2d/lib/index.js';
|
|
21
21
|
export { organiseBlueprints } from './2d/blueprints/lib.js';
|
|
22
22
|
export { polysidesBlueprint, roundedRectangleBlueprint } from './2d/blueprints/cannedBlueprints.js';
|
|
23
23
|
export type { ScaleMode } from './2d/curves.js';
|
package/dist/2d.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"2d.d.ts","sourceRoot":"","sources":["../src/2d.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAItE,OAAO,EACL,eAAe,EAEf,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,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,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAAE,KAAK,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AACpG,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/2d.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as Blueprint } from "./Blueprint-
|
|
2
|
-
import { d, C
|
|
3
|
-
import { e, C as C2, f, l, g, n, k, q, o, p, r
|
|
1
|
+
import { B as Blueprint } from "./Blueprint-Cg1sY8U_.js";
|
|
2
|
+
import { d, C } from "./Blueprint-Cg1sY8U_.js";
|
|
3
|
+
import { e, C as C2, f, l, g, n, k, q, o, p, r } from "./boolean2D-B0hb_N_J.js";
|
|
4
4
|
function reverseCurve(curve) {
|
|
5
5
|
const cloned = curve.clone();
|
|
6
6
|
cloned.reverse();
|
|
@@ -72,7 +72,6 @@ export {
|
|
|
72
72
|
d as BoundingBox2d,
|
|
73
73
|
C2 as CompoundBlueprint,
|
|
74
74
|
C as Curve2D,
|
|
75
|
-
r as axis2d,
|
|
76
75
|
createBlueprint,
|
|
77
76
|
curve2dBoundingBox,
|
|
78
77
|
curve2dDistanceFrom,
|
|
@@ -96,7 +95,7 @@ export {
|
|
|
96
95
|
p as polysidesBlueprint,
|
|
97
96
|
reverseCurve,
|
|
98
97
|
rotate2D,
|
|
99
|
-
|
|
98
|
+
r as roundedRectangleBlueprint,
|
|
100
99
|
scale2D,
|
|
101
100
|
sketch2DOnFace,
|
|
102
101
|
sketch2DOnPlane,
|