brepjs 12.8.2 → 12.10.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/dist/2d/blueprints/{approximations.d.ts → blueprintApproximations.d.ts} +1 -1
- package/dist/2d/blueprints/blueprintApproximations.d.ts.map +1 -0
- package/dist/2d/blueprints/{customCorners.d.ts → blueprintCustomCorners.d.ts} +1 -1
- package/dist/2d/blueprints/blueprintCustomCorners.d.ts.map +1 -0
- package/dist/2d/blueprints/blueprintFns.d.ts +17 -3
- package/dist/2d/blueprints/blueprintFns.d.ts.map +1 -1
- package/dist/2d/blueprints/{offset.d.ts → blueprintOffset.d.ts} +1 -1
- package/dist/2d/blueprints/blueprintOffset.d.ts.map +1 -0
- package/dist/2d/blueprints/index.d.ts +4 -4
- package/dist/2d/blueprints/index.d.ts.map +1 -1
- package/dist/2d/lib/Curve2D.d.ts +1 -1
- package/dist/2d/lib/Curve2D.d.ts.map +1 -1
- package/dist/2d/lib/svgPath.d.ts.map +1 -1
- package/dist/2d/lib/vectorOperations.d.ts +4 -1
- package/dist/2d/lib/vectorOperations.d.ts.map +1 -1
- package/dist/2d-CzEysb7A.js +108 -0
- package/dist/2d-DCxS_sb_.cjs +107 -0
- package/dist/2d.cjs +24 -88
- package/dist/2d.d.ts +1 -1
- package/dist/2d.js +34 -99
- package/dist/{Blueprint-CQ28WJhz.cjs → Blueprint-BoC0DsDm.cjs} +15 -45
- package/dist/{Blueprint-DbVaf6k7.js → Blueprint-CQNRtmYG.js} +33 -63
- package/dist/{boolean2D-y3E92F0u.js → boolean2D-DXAt4GAK.js} +132 -62
- package/dist/{boolean2D-0blbVtJ8.cjs → boolean2D-N9Pgumgg.cjs} +112 -42
- package/dist/{booleanFns-BCTjYZAg.js → booleanFns-BXV7Oh0h.js} +53 -50
- package/dist/{booleanFns-gmsX3Cv2.cjs → booleanFns-CxArUj_q.cjs} +43 -40
- package/dist/brepjs.cjs +448 -379
- package/dist/brepjs.js +1634 -1563
- package/dist/core/dimensionTypes.d.ts +52 -0
- package/dist/core/dimensionTypes.d.ts.map +1 -0
- package/dist/core/disposal.d.ts +18 -0
- package/dist/core/disposal.d.ts.map +1 -1
- package/dist/core/errors.d.ts +7 -8
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/kernelErrorTranslation.d.ts +15 -0
- package/dist/core/kernelErrorTranslation.d.ts.map +1 -0
- package/dist/core/planeOps.d.ts +14 -0
- package/dist/core/planeOps.d.ts.map +1 -1
- package/dist/core/result.d.ts +4 -0
- package/dist/core/result.d.ts.map +1 -1
- package/dist/core/shapeTypes.d.ts +14 -146
- package/dist/core/shapeTypes.d.ts.map +1 -1
- package/dist/core/{definitionMaps.d.ts → typeDiscriminants.d.ts} +5 -1
- package/dist/core/typeDiscriminants.d.ts.map +1 -0
- package/dist/core/validityTypes.d.ts +100 -0
- package/dist/core/validityTypes.d.ts.map +1 -0
- package/dist/core.cjs +52 -11
- package/dist/core.d.ts +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +119 -76
- package/dist/{curveFns-BZngcnQ1.cjs → curveFns-CWZRuXQ3.cjs} +2 -2
- package/dist/{curveFns-mROFhiuG.js → curveFns-OmbtFSG8.js} +14 -14
- package/dist/{drawFns-Bwakrq7w.js → drawFns-8S0ULGRj.js} +146 -118
- package/dist/{drawFns-CjRc1NfQ.cjs → drawFns-voV2wEp8.cjs} +153 -125
- package/dist/{faceFns-B8GnxjdY.js → faceFns-Bn2seBfp.js} +16 -24
- package/dist/{faceFns-DB1Fc5gy.cjs → faceFns-CmIrjdt1.cjs} +2 -10
- package/dist/{helpers-X0juxnwj.js → helpers-CEn618MW.js} +89 -21
- package/dist/{helpers-C8NoT0Wu.cjs → helpers-mipaxDTy.cjs} +77 -9
- package/dist/index.d.ts +20 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/io/gltfImportFns.d.ts +18 -0
- package/dist/io/gltfImportFns.d.ts.map +1 -0
- package/dist/io/ioUtils.d.ts +16 -0
- package/dist/io/ioUtils.d.ts.map +1 -0
- package/dist/io/objImportFns.d.ts.map +1 -1
- package/dist/io/threemfImportFns.d.ts.map +1 -1
- package/dist/io.cjs +4 -4
- package/dist/io.js +4 -4
- package/dist/kernel/brepkit/booleanOps.d.ts +23 -0
- package/dist/kernel/brepkit/booleanOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/constructionOps.d.ts +51 -0
- package/dist/kernel/brepkit/constructionOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/evolutionOps.d.ts +31 -0
- package/dist/kernel/brepkit/evolutionOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/geometryOps.d.ts +56 -0
- package/dist/kernel/brepkit/geometryOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/helpers.d.ts +84 -0
- package/dist/kernel/brepkit/helpers.d.ts.map +1 -0
- package/dist/kernel/brepkit/internalOps.d.ts +28 -0
- package/dist/kernel/brepkit/internalOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/ioOps.d.ts +43 -0
- package/dist/kernel/brepkit/ioOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/measureOps.d.ts +30 -0
- package/dist/kernel/brepkit/measureOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/meshOps.d.ts +7 -0
- package/dist/kernel/brepkit/meshOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/modifierOps.d.ts +15 -0
- package/dist/kernel/brepkit/modifierOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/repairOps.d.ts +14 -0
- package/dist/kernel/brepkit/repairOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/sweepOps.d.ts +27 -0
- package/dist/kernel/brepkit/sweepOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/topologyOps.d.ts +16 -0
- package/dist/kernel/brepkit/topologyOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/transformOps.d.ts +14 -0
- package/dist/kernel/brepkit/transformOps.d.ts.map +1 -0
- package/dist/kernel/brepkitAdapter.d.ts +1 -1
- package/dist/kernel/brepkitAdapter.d.ts.map +1 -1
- package/dist/kernel/brepkitWasmTypes.d.ts +8 -0
- package/dist/kernel/brepkitWasmTypes.d.ts.map +1 -1
- package/dist/kernel/defaultAdapter.d.ts.map +1 -1
- package/dist/kernel/extendedConstructorOps.d.ts +9 -1
- package/dist/kernel/extendedConstructorOps.d.ts.map +1 -1
- package/dist/kernel/index.d.ts +1 -0
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/kernel/interfaces/boolean-ops.d.ts +25 -0
- package/dist/kernel/interfaces/boolean-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/builder-ops.d.ts +57 -0
- package/dist/kernel/interfaces/builder-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/core.d.ts +30 -0
- package/dist/kernel/interfaces/core.d.ts.map +1 -0
- package/dist/kernel/interfaces/curve-ops.d.ts +41 -0
- package/dist/kernel/interfaces/curve-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/evolution-ops.d.ts +19 -0
- package/dist/kernel/interfaces/evolution-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/index.d.ts +37 -0
- package/dist/kernel/interfaces/index.d.ts.map +1 -0
- package/dist/kernel/interfaces/io-ops.d.ts +66 -0
- package/dist/kernel/interfaces/io-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/measure-ops.d.ts +35 -0
- package/dist/kernel/interfaces/measure-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/mesh-ops.d.ts +21 -0
- package/dist/kernel/interfaces/mesh-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/modifier-ops.d.ts +22 -0
- package/dist/kernel/interfaces/modifier-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/primitive-ops.d.ts +13 -0
- package/dist/kernel/interfaces/primitive-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/repair-ops.d.ts +36 -0
- package/dist/kernel/interfaces/repair-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/surface-ops.d.ts +50 -0
- package/dist/kernel/interfaces/surface-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/sweep-ops.d.ts +49 -0
- package/dist/kernel/interfaces/sweep-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/topology-ops.d.ts +30 -0
- package/dist/kernel/interfaces/topology-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/transform-ops.d.ts +35 -0
- package/dist/kernel/interfaces/transform-ops.d.ts.map +1 -0
- package/dist/kernel/modifierOps.d.ts +2 -2
- package/dist/kernel/modifierOps.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +2 -446
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/measurement/measureCache.d.ts +11 -9
- package/dist/measurement/measureCache.d.ts.map +1 -1
- package/dist/measurement/measureFns.d.ts +24 -71
- package/dist/measurement/measureFns.d.ts.map +1 -1
- package/dist/measurement/measureTypes.d.ts +30 -0
- package/dist/measurement/measureTypes.d.ts.map +1 -0
- package/dist/{measurement-D8EJ694A.js → measurement-fJWDEpz0.js} +53 -34
- package/dist/measurement-ph-kanQ7.cjs +154 -0
- package/dist/measurement.cjs +2 -1
- package/dist/measurement.d.ts +1 -1
- package/dist/measurement.d.ts.map +1 -1
- package/dist/measurement.js +4 -3
- package/dist/{meshFns-BnV0ZR8w.cjs → meshFns-B9p4EVV8.cjs} +4 -4
- package/dist/{meshFns-nQjK38EC.js → meshFns-D0qIoxm-.js} +3 -3
- package/dist/operations/compoundOpsFns.d.ts +38 -0
- package/dist/operations/compoundOpsFns.d.ts.map +1 -0
- package/dist/operations/convexHullFns.d.ts +21 -0
- package/dist/operations/convexHullFns.d.ts.map +1 -0
- package/dist/operations/extrudeFns.d.ts +2 -93
- package/dist/operations/extrudeFns.d.ts.map +1 -1
- package/dist/operations/guidedSweepFns.d.ts +3 -22
- package/dist/operations/guidedSweepFns.d.ts.map +1 -1
- package/dist/operations/multiSweepFns.d.ts +3 -29
- package/dist/operations/multiSweepFns.d.ts.map +1 -1
- package/dist/operations/roofFns.d.ts +2 -2
- package/dist/operations/roofFns.d.ts.map +1 -1
- package/dist/operations/straightSkeleton.d.ts.map +1 -1
- package/dist/operations/sweepFns.d.ts +121 -0
- package/dist/operations/sweepFns.d.ts.map +1 -0
- package/dist/{operations-BfbkK6DU.js → operations-DX_qy_TB.js} +29 -177
- package/dist/{operations-CYpmLSC4.cjs → operations-Ds4xoyxR.cjs} +6 -154
- package/dist/operations.cjs +6 -10
- package/dist/operations.d.ts +0 -2
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +26 -30
- package/dist/originTrackingFns-BOCAMfd0.js +137 -0
- package/dist/originTrackingFns-SPU7ly3_.cjs +136 -0
- package/dist/query/edgeFinder.d.ts +4 -14
- package/dist/query/edgeFinder.d.ts.map +1 -1
- package/dist/query/faceFinder.d.ts +4 -14
- package/dist/query/faceFinder.d.ts.map +1 -1
- package/dist/query/finderCore.d.ts +6 -0
- package/dist/query/finderCore.d.ts.map +1 -1
- package/dist/query/shapeFinders.d.ts +32 -0
- package/dist/query/shapeFinders.d.ts.map +1 -0
- package/dist/query/wireFinder.d.ts +4 -9
- package/dist/query/wireFinder.d.ts.map +1 -1
- package/dist/query.cjs +54 -32
- package/dist/query.js +56 -34
- package/dist/{result-BaSD1fqR.js → result-CoDaWsvc.js} +48 -90
- package/dist/{result-fAX0OZzI.cjs → result-DULetAht.cjs} +17 -59
- package/dist/result.cjs +1 -1
- package/dist/result.js +23 -23
- package/dist/shapeFns-BZ6zk7nd.js +34 -0
- package/dist/shapeFns-bRkrwI8R.cjs +33 -0
- package/dist/{shapeTypes-7xEam9Ri.cjs → shapeTypes-T0n6mRmt.cjs} +170 -137
- package/dist/{shapeTypes-CpSaBLDv.js → shapeTypes-dhhm-T5A.js} +205 -172
- package/dist/sketching/CompoundSketch.d.ts +4 -4
- package/dist/sketching/CompoundSketch.d.ts.map +1 -1
- package/dist/sketching/Sketch.d.ts +3 -3
- package/dist/sketching/Sketch.d.ts.map +1 -1
- package/dist/sketching/Sketcher.d.ts.map +1 -1
- package/dist/sketching/Sketches.d.ts +1 -1
- package/dist/sketching/Sketches.d.ts.map +1 -1
- package/dist/sketching/draw.d.ts +1 -20
- package/dist/sketching/draw.d.ts.map +1 -1
- package/dist/sketching/draw3d.d.ts +22 -0
- package/dist/sketching/draw3d.d.ts.map +1 -0
- package/dist/sketching/sketchFns.d.ts +3 -3
- package/dist/sketching/sketchFns.d.ts.map +1 -1
- package/dist/sketching/sketchLib.d.ts +2 -2
- package/dist/sketching/sketchLib.d.ts.map +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.d.ts +2 -1
- package/dist/sketching.d.ts.map +1 -1
- package/dist/sketching.js +2 -2
- package/dist/{solidBuilders-994_MQwB.cjs → solidBuilders-BEAoLYvr.cjs} +3 -3
- package/dist/{solidBuilders-DmwhTCCd.js → solidBuilders-tVmD3R7Z.js} +12 -12
- package/dist/{surfaceBuilders-5VA34a3_.cjs → surfaceBuilders-DYS8AMSS.cjs} +3 -3
- package/dist/{surfaceBuilders-nQdJ56fe.js → surfaceBuilders-Dl0ATFbO.js} +15 -15
- package/dist/sweepFns-BKnQs59A.js +215 -0
- package/dist/sweepFns-COqeYIUp.cjs +214 -0
- package/dist/text/textBlueprints.d.ts +4 -3
- package/dist/text/textBlueprints.d.ts.map +1 -1
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/cast.d.ts +1 -5
- package/dist/topology/cast.d.ts.map +1 -1
- package/dist/topology/compoundOpsFns.d.ts +3 -35
- package/dist/topology/compoundOpsFns.d.ts.map +1 -1
- package/dist/topology/curveFns.d.ts +1 -1
- package/dist/topology/curveFns.d.ts.map +1 -1
- package/dist/topology/index.d.ts +2 -3
- package/dist/topology/index.d.ts.map +1 -1
- package/dist/topology/{colorFns.d.ts → metadata/colorFns.d.ts} +2 -2
- package/dist/topology/metadata/colorFns.d.ts.map +1 -0
- package/dist/topology/{faceTagFns.d.ts → metadata/faceTagFns.d.ts} +2 -2
- package/dist/topology/metadata/faceTagFns.d.ts.map +1 -0
- package/dist/topology/metadata/metadataPropagation.d.ts +30 -0
- package/dist/topology/metadata/metadataPropagation.d.ts.map +1 -0
- package/dist/topology/metadata/originTrackingFns.d.ts +23 -0
- package/dist/topology/metadata/originTrackingFns.d.ts.map +1 -0
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/shapeFns.d.ts +6 -120
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/topologyQueryFns.d.ts +67 -0
- package/dist/topology/topologyQueryFns.d.ts.map +1 -0
- package/dist/topology/transformFns.d.ts +49 -0
- package/dist/topology/transformFns.d.ts.map +1 -0
- package/dist/topology/wrapperFns.d.ts.map +1 -1
- package/dist/{topology-C7x98OVn.js → topology-C1oUQXZS.js} +235 -50
- package/dist/{topology-ANwCzGL8.cjs → topology-xyDYbkHW.cjs} +205 -20
- package/dist/topology.cjs +18 -17
- package/dist/topology.js +97 -96
- package/dist/topologyQueryFns-0IptTUCo.cjs +118 -0
- package/dist/topologyQueryFns-Dj4Xd5kx.js +119 -0
- package/dist/{types-CWDdqcrq.js → types-CcKqsmd0.js} +2 -2
- package/dist/utils/precisionRound.d.ts +4 -0
- package/dist/utils/precisionRound.d.ts.map +1 -1
- package/dist/utils/vec2d.d.ts +5 -0
- package/dist/utils/vec2d.d.ts.map +1 -1
- package/dist/{vecOps-ZDdZWbwT.js → vecOps-LTN--A58.js} +15 -15
- package/dist/{vectors-Bx8wkNui.js → vectors-B8juLsQB.js} +15 -7
- package/dist/{vectors-D_IiZx0q.cjs → vectors-I_0zdD3O.cjs} +9 -1
- package/dist/vectors.cjs +1 -1
- package/dist/vectors.js +23 -23
- package/package.json +9 -9
- package/dist/2d/blueprints/approximations.d.ts.map +0 -1
- package/dist/2d/blueprints/customCorners.d.ts.map +0 -1
- package/dist/2d/blueprints/offset.d.ts.map +0 -1
- package/dist/core/definitionMaps.d.ts.map +0 -1
- package/dist/core/geometryHelpers.d.ts +0 -30
- package/dist/core/geometryHelpers.d.ts.map +0 -1
- package/dist/core/memory.d.ts +0 -6
- package/dist/core/memory.d.ts.map +0 -1
- package/dist/core/typeErrors.d.ts +0 -17
- package/dist/core/typeErrors.d.ts.map +0 -1
- package/dist/cornerFinder-Ckz-mPHE.js +0 -59
- package/dist/cornerFinder-ZmOyOOsh.cjs +0 -58
- package/dist/loft-Bhw-FMoL.js +0 -228
- package/dist/loft-hp3pc1M7.cjs +0 -227
- package/dist/measurement-BoNTUBAp.cjs +0 -135
- package/dist/operations/extrude.d.ts +0 -72
- package/dist/operations/extrude.d.ts.map +0 -1
- package/dist/operations/loft.d.ts +0 -33
- package/dist/operations/loft.d.ts.map +0 -1
- package/dist/shapeFns-C2SnNvdH.cjs +0 -468
- package/dist/shapeFns-FDuKkrDR.js +0 -469
- package/dist/topology/colorFns.d.ts.map +0 -1
- package/dist/topology/faceTagFns.d.ts.map +0 -1
- package/dist/utils/round2.d.ts +0 -3
- package/dist/utils/round2.d.ts.map +0 -1
- package/dist/utils/round5.d.ts +0 -3
- package/dist/utils/round5.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brepjs",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.10.0",
|
|
4
4
|
"description": "Web CAD library with pluggable geometry kernel",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cad",
|
|
@@ -187,18 +187,18 @@
|
|
|
187
187
|
"prepare": "husky && bash scripts/ensure-wasm.sh"
|
|
188
188
|
},
|
|
189
189
|
"devDependencies": {
|
|
190
|
-
"@commitlint/cli": "20.
|
|
191
|
-
"@commitlint/config-conventional": "20.
|
|
190
|
+
"@commitlint/cli": "20.5.0",
|
|
191
|
+
"@commitlint/config-conventional": "20.5.0",
|
|
192
192
|
"@eslint/js": "10.0.1",
|
|
193
193
|
"@size-limit/file": "12.0.1",
|
|
194
194
|
"@types/opentype.js": "1.3.9",
|
|
195
|
-
"@vitest/coverage-v8": "4.0
|
|
195
|
+
"@vitest/coverage-v8": "4.1.0",
|
|
196
196
|
"brepjs-opencascade": "*",
|
|
197
|
-
"brepkit-wasm": "
|
|
197
|
+
"brepkit-wasm": "2.4.1",
|
|
198
198
|
"eslint": "10.0.3",
|
|
199
199
|
"husky": "9.1.7",
|
|
200
200
|
"knip": "5.86.0",
|
|
201
|
-
"lint-staged": "16.
|
|
201
|
+
"lint-staged": "16.4.0",
|
|
202
202
|
"prettier": "3.8.1",
|
|
203
203
|
"size-limit": "12.0.1",
|
|
204
204
|
"typedoc": "0.28.17",
|
|
@@ -206,11 +206,11 @@
|
|
|
206
206
|
"typescript-eslint": "8.57.0",
|
|
207
207
|
"vite": "7.3.1",
|
|
208
208
|
"vite-plugin-dts": "4.5.4",
|
|
209
|
-
"vitest": "4.0
|
|
209
|
+
"vitest": "4.1.0"
|
|
210
210
|
},
|
|
211
211
|
"peerDependencies": {
|
|
212
212
|
"brepjs-opencascade": "^0.5.1 || ^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.0",
|
|
213
|
-
"brepkit-wasm": "^0.10.1 || ^1.0.0"
|
|
213
|
+
"brepkit-wasm": "^0.10.1 || ^1.0.0 || ^2.0.0"
|
|
214
214
|
},
|
|
215
215
|
"peerDependenciesMeta": {
|
|
216
216
|
"brepjs-opencascade": {
|
|
@@ -221,7 +221,7 @@
|
|
|
221
221
|
}
|
|
222
222
|
},
|
|
223
223
|
"dependencies": {
|
|
224
|
-
"flatbush": "4.5.
|
|
224
|
+
"flatbush": "4.5.1",
|
|
225
225
|
"opentype.js": "1.3.4"
|
|
226
226
|
},
|
|
227
227
|
"overrides": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"approximations.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/approximations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAI5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,oBAAoB,GAAG,CAAC,CAS5F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customCorners.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/customCorners.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAgF9C;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,WAE7E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,WAE9E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"offset.d.ts","sourceRoot":"","sources":["../../../src/2d/blueprints/offset.ts"],"names":[],"mappings":"AAKA,OAAO,EAIL,OAAO,EAQR,MAAM,iBAAiB,CAAC;AACzB,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAGvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AA2G9C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,YAAY,GAAE,cAAmB,GAChC,OAAO,EAAE,CA2HX;AAOD,8CAA8C;AAC9C,MAAM,WAAW,cAAc;IAC7B,yEAAyE;IACzE,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;CAC5C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,YAAY,GAAE,cAAmB,GAChC,OAAO,CAmGT;AAUD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAC5B,EAAE,EAAE,OAAO,EACX,cAAc,EAAE,MAAM,EACtB,YAAY,GAAE,cAAmB,GAChC,OAAO,CAeT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"definitionMaps.d.ts","sourceRoot":"","sources":["../../src/core/definitionMaps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,aAAa,CAAC;AAGnD,yDAAyD;AACzD,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,QAAQ,GACR,SAAS,GACT,WAAW,GACX,UAAU,GACV,cAAc,GACd,eAAe,GACf,cAAc,GACd,aAAa,CAAC;AAmBlB;;;;GAIG;AAEH,eAAO,MAAM,aAAa,GAAI,MAAM,GAAG,KAAG,MAAM,CAAC,SAAS,CAKzD,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Plane, PlaneName, PlaneInput } from './planeTypes.js';
|
|
2
|
-
import { PointInput } from './types.js';
|
|
3
|
-
import { KernelType } from '../kernel/types.js';
|
|
4
|
-
/**
|
|
5
|
-
* Create or copy a {@link Plane}.
|
|
6
|
-
*
|
|
7
|
-
* When called with a `Plane` object, returns a shallow copy.
|
|
8
|
-
* When called with a `PlaneName` string (or no arguments), resolves the named
|
|
9
|
-
* plane with an optional origin offset.
|
|
10
|
-
*
|
|
11
|
-
* @param plane - A `Plane` object to copy, or a `PlaneName` string to resolve.
|
|
12
|
-
* @param origin - Origin point or scalar offset along the plane normal.
|
|
13
|
-
* @default plane `'XY'`
|
|
14
|
-
*/
|
|
15
|
-
declare function makePlane(plane: Plane): Plane;
|
|
16
|
-
declare function makePlane(plane?: PlaneName, origin?: PointInput | number): Plane;
|
|
17
|
-
export { makePlane };
|
|
18
|
-
/**
|
|
19
|
-
* Mirror an kernel shape across a plane.
|
|
20
|
-
*
|
|
21
|
-
* The mirror plane can be specified as a `PlaneName`, a `Plane` object,
|
|
22
|
-
* or a direction vector (used as the plane normal). Defaults to the YZ plane.
|
|
23
|
-
*
|
|
24
|
-
* @param shape - Raw kernel shape to mirror.
|
|
25
|
-
* @param inputPlane - Mirror plane specification.
|
|
26
|
-
* @param origin - Override origin for the mirror plane.
|
|
27
|
-
* @returns A new mirrored kernel shape.
|
|
28
|
-
*/
|
|
29
|
-
export declare function mirror(shape: KernelType, inputPlane?: PlaneInput | PointInput, origin?: PointInput): KernelType;
|
|
30
|
-
//# sourceMappingURL=geometryHelpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"geometryHelpers.d.ts","sourceRoot":"","sources":["../../src/core/geometryHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,KAAK,EAAQ,UAAU,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD;;;;;;;;;;GAUG;AACH,iBAAS,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC;AACxC,iBAAS,SAAS,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;AAU3E,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CACpB,KAAK,EAAE,UAAU,EACjB,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,EACpC,MAAM,CAAC,EAAE,UAAU,GAClB,UAAU,CAgCZ"}
|
package/dist/core/memory.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory management utilities — re-export hub for disposal.ts.
|
|
3
|
-
*/
|
|
4
|
-
export type { Deletable } from './disposal.js';
|
|
5
|
-
export { createHandle, createKernelHandle, DisposalScope, withScope, withScopeResult, withScopeResultAsync, isLive, registerForCleanup, unregisterFromCleanup, type ShapeHandle, type KernelHandle, } from './disposal.js';
|
|
6
|
-
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/core/memory.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Dimension } from './shapeTypes.js';
|
|
2
|
-
/**
|
|
3
|
-
* Compile-time error message for dimension mismatches.
|
|
4
|
-
* Resolves to a string literal type that appears in IDE diagnostics.
|
|
5
|
-
*/
|
|
6
|
-
export type DimensionError<Op extends string, Expected extends string, Got extends string> = `❌ ${Op}: expected ${Expected}, got ${Got}`;
|
|
7
|
-
/**
|
|
8
|
-
* Conditional type that resolves to T if D matches Expected,
|
|
9
|
-
* otherwise resolves to a readable error string type.
|
|
10
|
-
*/
|
|
11
|
-
export type RequireDimension<D extends Dimension, Expected extends Dimension, T, Op extends string = 'operation'> = D extends Expected ? T : DimensionError<Op, Expected, D>;
|
|
12
|
-
/**
|
|
13
|
-
* Asserts both dimensions are equal at the type level.
|
|
14
|
-
* Resolves to the shared dimension if equal, or a readable error if not.
|
|
15
|
-
*/
|
|
16
|
-
export type SameDimension<A extends Dimension, B extends Dimension, Op extends string = 'operation'> = A extends B ? A : DimensionError<Op, A, B>;
|
|
17
|
-
//# sourceMappingURL=typeErrors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeErrors.d.ts","sourceRoot":"","sources":["../../src/core/typeErrors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,MAAM,MAAM,cAAc,CACxB,EAAE,SAAS,MAAM,EACjB,QAAQ,SAAS,MAAM,EACvB,GAAG,SAAS,MAAM,IAChB,KAAK,EAAE,cAAc,QAAQ,SAAS,GAAG,EAAE,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAC1B,CAAC,SAAS,SAAS,EACnB,QAAQ,SAAS,SAAS,EAC1B,CAAC,EACD,EAAE,SAAS,MAAM,GAAG,WAAW,IAC7B,CAAC,SAAS,QAAQ,GAAG,CAAC,GAAG,cAAc,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,aAAa,CACvB,CAAC,SAAS,SAAS,EACnB,CAAC,SAAS,SAAS,EACnB,EAAE,SAAS,MAAM,GAAG,WAAW,IAC7B,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
|
|
2
|
-
import { a as angle2d, s as samePoint, d as distance2d } from "./helpers-X0juxnwj.js";
|
|
3
|
-
const PI_2 = 2 * Math.PI;
|
|
4
|
-
function positiveHalfAngle(angle) {
|
|
5
|
-
const limitedAngle = angle % PI_2;
|
|
6
|
-
const coterminalAngle = limitedAngle < 0 ? limitedAngle + PI_2 : limitedAngle;
|
|
7
|
-
if (coterminalAngle < Math.PI) return coterminalAngle;
|
|
8
|
-
if (coterminalAngle === Math.PI) return 0;
|
|
9
|
-
return Math.abs(coterminalAngle - PI_2);
|
|
10
|
-
}
|
|
11
|
-
function blueprintCorners(blueprint) {
|
|
12
|
-
return blueprint.curves.map((curve, index) => ({
|
|
13
|
-
firstCurve: curve,
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- modulo wraps within bounds
|
|
15
|
-
secondCurve: blueprint.curves[(index + 1) % blueprint.curves.length],
|
|
16
|
-
point: curve.lastPoint
|
|
17
|
-
}));
|
|
18
|
-
}
|
|
19
|
-
function buildCornerFinder(filters) {
|
|
20
|
-
const withFilter = (pred) => buildCornerFinder([...filters, pred]);
|
|
21
|
-
const shouldKeep = (corner) => filters.every((f) => f(corner));
|
|
22
|
-
return {
|
|
23
|
-
shouldKeep,
|
|
24
|
-
when: (pred) => withFilter(pred),
|
|
25
|
-
inList: (points) => withFilter((corner) => points.some((p) => samePoint(p, corner.point))),
|
|
26
|
-
atDistance: (distance, point = [0, 0]) => withFilter((corner) => Math.abs(distance2d(point, corner.point) - distance) < 1e-9),
|
|
27
|
-
atPoint: (point) => withFilter((corner) => samePoint(point, corner.point)),
|
|
28
|
-
inBox: (corner1, corner2) => {
|
|
29
|
-
const minX = Math.min(corner1[0], corner2[0]);
|
|
30
|
-
const maxX = Math.max(corner1[0], corner2[0]);
|
|
31
|
-
const minY = Math.min(corner1[1], corner2[1]);
|
|
32
|
-
const maxY = Math.max(corner1[1], corner2[1]);
|
|
33
|
-
return withFilter((corner) => {
|
|
34
|
-
const [x, y] = corner.point;
|
|
35
|
-
return x >= minX && x <= maxX && y >= minY && y <= maxY;
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
ofAngle: (angle) => withFilter((corner) => {
|
|
39
|
-
const tgt1 = corner.firstCurve.tangentAt(1);
|
|
40
|
-
const tgt2 = corner.secondCurve.tangentAt(0);
|
|
41
|
-
return Math.abs(positiveHalfAngle(angle2d(tgt1, tgt2)) - positiveHalfAngle(DEG2RAD * angle)) < 1e-9;
|
|
42
|
-
}),
|
|
43
|
-
not: (fn) => {
|
|
44
|
-
const inner = fn(buildCornerFinder([]));
|
|
45
|
-
return withFilter((corner) => !inner.shouldKeep(corner));
|
|
46
|
-
},
|
|
47
|
-
either: (fns) => {
|
|
48
|
-
const builtFinders = fns.map((fn) => fn(buildCornerFinder([])));
|
|
49
|
-
return withFilter((corner) => builtFinders.some((f) => f.shouldKeep(corner)));
|
|
50
|
-
},
|
|
51
|
-
find: (blueprint) => blueprintCorners(blueprint).filter(shouldKeep)
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function cornerFinder() {
|
|
55
|
-
return buildCornerFinder([]);
|
|
56
|
-
}
|
|
57
|
-
export {
|
|
58
|
-
cornerFinder as c
|
|
59
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const vecOps = require("./vecOps-CjRL1jau.cjs");
|
|
3
|
-
const helpers = require("./helpers-C8NoT0Wu.cjs");
|
|
4
|
-
const PI_2 = 2 * Math.PI;
|
|
5
|
-
function positiveHalfAngle(angle) {
|
|
6
|
-
const limitedAngle = angle % PI_2;
|
|
7
|
-
const coterminalAngle = limitedAngle < 0 ? limitedAngle + PI_2 : limitedAngle;
|
|
8
|
-
if (coterminalAngle < Math.PI) return coterminalAngle;
|
|
9
|
-
if (coterminalAngle === Math.PI) return 0;
|
|
10
|
-
return Math.abs(coterminalAngle - PI_2);
|
|
11
|
-
}
|
|
12
|
-
function blueprintCorners(blueprint) {
|
|
13
|
-
return blueprint.curves.map((curve, index) => ({
|
|
14
|
-
firstCurve: curve,
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- modulo wraps within bounds
|
|
16
|
-
secondCurve: blueprint.curves[(index + 1) % blueprint.curves.length],
|
|
17
|
-
point: curve.lastPoint
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
function buildCornerFinder(filters) {
|
|
21
|
-
const withFilter = (pred) => buildCornerFinder([...filters, pred]);
|
|
22
|
-
const shouldKeep = (corner) => filters.every((f) => f(corner));
|
|
23
|
-
return {
|
|
24
|
-
shouldKeep,
|
|
25
|
-
when: (pred) => withFilter(pred),
|
|
26
|
-
inList: (points) => withFilter((corner) => points.some((p) => helpers.samePoint(p, corner.point))),
|
|
27
|
-
atDistance: (distance, point = [0, 0]) => withFilter((corner) => Math.abs(helpers.distance2d(point, corner.point) - distance) < 1e-9),
|
|
28
|
-
atPoint: (point) => withFilter((corner) => helpers.samePoint(point, corner.point)),
|
|
29
|
-
inBox: (corner1, corner2) => {
|
|
30
|
-
const minX = Math.min(corner1[0], corner2[0]);
|
|
31
|
-
const maxX = Math.max(corner1[0], corner2[0]);
|
|
32
|
-
const minY = Math.min(corner1[1], corner2[1]);
|
|
33
|
-
const maxY = Math.max(corner1[1], corner2[1]);
|
|
34
|
-
return withFilter((corner) => {
|
|
35
|
-
const [x, y] = corner.point;
|
|
36
|
-
return x >= minX && x <= maxX && y >= minY && y <= maxY;
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
ofAngle: (angle) => withFilter((corner) => {
|
|
40
|
-
const tgt1 = corner.firstCurve.tangentAt(1);
|
|
41
|
-
const tgt2 = corner.secondCurve.tangentAt(0);
|
|
42
|
-
return Math.abs(positiveHalfAngle(helpers.angle2d(tgt1, tgt2)) - positiveHalfAngle(vecOps.DEG2RAD * angle)) < 1e-9;
|
|
43
|
-
}),
|
|
44
|
-
not: (fn) => {
|
|
45
|
-
const inner = fn(buildCornerFinder([]));
|
|
46
|
-
return withFilter((corner) => !inner.shouldKeep(corner));
|
|
47
|
-
},
|
|
48
|
-
either: (fns) => {
|
|
49
|
-
const builtFinders = fns.map((fn) => fn(buildCornerFinder([])));
|
|
50
|
-
return withFilter((corner) => builtFinders.some((f) => f.shouldKeep(corner)));
|
|
51
|
-
},
|
|
52
|
-
find: (blueprint) => blueprintCorners(blueprint).filter(shouldKeep)
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function cornerFinder() {
|
|
56
|
-
return buildCornerFinder([]);
|
|
57
|
-
}
|
|
58
|
-
exports.cornerFinder = cornerFinder;
|
package/dist/loft-Bhw-FMoL.js
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
|
|
2
|
-
var __typeError = (msg) => {
|
|
3
|
-
throw TypeError(msg);
|
|
4
|
-
};
|
|
5
|
-
var __using = (stack, value, async) => {
|
|
6
|
-
if (value != null) {
|
|
7
|
-
if (typeof value !== "object" && typeof value !== "function") __typeError("Object expected");
|
|
8
|
-
var dispose, inner;
|
|
9
|
-
if (async) dispose = value[__knownSymbol("asyncDispose")];
|
|
10
|
-
if (dispose === void 0) {
|
|
11
|
-
dispose = value[__knownSymbol("dispose")];
|
|
12
|
-
if (async) inner = dispose;
|
|
13
|
-
}
|
|
14
|
-
if (typeof dispose !== "function") __typeError("Object not disposable");
|
|
15
|
-
if (inner) dispose = function() {
|
|
16
|
-
try {
|
|
17
|
-
inner.call(this);
|
|
18
|
-
} catch (e) {
|
|
19
|
-
return Promise.reject(e);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
stack.push([async, dispose, value]);
|
|
23
|
-
} else if (async) {
|
|
24
|
-
stack.push([async]);
|
|
25
|
-
}
|
|
26
|
-
return value;
|
|
27
|
-
};
|
|
28
|
-
var __callDispose = (stack, error, hasError) => {
|
|
29
|
-
var E = typeof SuppressedError === "function" ? SuppressedError : function(e, s, m, _) {
|
|
30
|
-
return _ = Error(m), _.name = "SuppressedError", _.error = e, _.suppressed = s, _;
|
|
31
|
-
};
|
|
32
|
-
var fail = (e) => error = hasError ? new E(e, error, "An error was suppressed during disposal") : (hasError = true, e);
|
|
33
|
-
var next = (it) => {
|
|
34
|
-
while (it = stack.pop()) {
|
|
35
|
-
try {
|
|
36
|
-
var result = it[1] && it[1].call(it[2]);
|
|
37
|
-
if (it[0]) return Promise.resolve(result).then(next, (e) => (fail(e), next()));
|
|
38
|
-
} catch (e) {
|
|
39
|
-
fail(e);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
if (hasError) throw error;
|
|
43
|
-
};
|
|
44
|
-
return next();
|
|
45
|
-
};
|
|
46
|
-
import { B as getKernel, F as createSolid, D as DisposalScope } from "./shapeTypes-CpSaBLDv.js";
|
|
47
|
-
import { a as toVec3 } from "./types-CWDdqcrq.js";
|
|
48
|
-
import { g as vecLength, D as DEG2RAD, v as vecAdd } from "./vecOps-ZDdZWbwT.js";
|
|
49
|
-
import { d as downcast, c as cast, a as isShape3D, b as isWire } from "./faceFns-B8GnxjdY.js";
|
|
50
|
-
import { e as err, z as validationError, o as ok, v as unwrap, a as andThen, r as typeCastError, k as kernelError } from "./result-BaSD1fqR.js";
|
|
51
|
-
import { a as makeLine, b as assembleWire, c as makeHelix } from "./surfaceBuilders-nQdJ56fe.js";
|
|
52
|
-
import { m as makeVertex } from "./solidBuilders-DmwhTCCd.js";
|
|
53
|
-
function buildLawFromProfile(extrusionLength, { profile, endFactor = 1 }) {
|
|
54
|
-
if (profile !== "s-curve" && profile !== "linear") {
|
|
55
|
-
return err(
|
|
56
|
-
validationError("UNSUPPORTED_PROFILE", `Unsupported extrusion profile: ${String(profile)}`)
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
const law = getKernel().buildExtrusionLaw(profile, extrusionLength, endFactor);
|
|
60
|
-
return ok(law.Trim(0, extrusionLength, 1e-6));
|
|
61
|
-
}
|
|
62
|
-
const basicFaceExtrusion = (face, extrusionVec) => {
|
|
63
|
-
const kernel = getKernel();
|
|
64
|
-
const vec = toVec3(extrusionVec);
|
|
65
|
-
const len = vecLength(vec);
|
|
66
|
-
const dir = len > 0 ? [vec[0] / len, vec[1] / len, vec[2] / len] : [0, 0, 1];
|
|
67
|
-
const shape = kernel.extrude(face.wrapped, dir, len);
|
|
68
|
-
const solid = createSolid(unwrap(downcast(shape)));
|
|
69
|
-
return solid;
|
|
70
|
-
};
|
|
71
|
-
const revolution = (face, center = [0, 0, 0], direction = [0, 0, 1], angle = 360) => {
|
|
72
|
-
const centerVec = toVec3(center);
|
|
73
|
-
const directionVec = toVec3(direction);
|
|
74
|
-
const kernel = getKernel();
|
|
75
|
-
const revolShape = kernel.revolveVec(
|
|
76
|
-
face.wrapped,
|
|
77
|
-
[...centerVec],
|
|
78
|
-
[...directionVec],
|
|
79
|
-
angle * DEG2RAD
|
|
80
|
-
);
|
|
81
|
-
const result = andThen(cast(revolShape), (shape) => {
|
|
82
|
-
if (!isShape3D(shape))
|
|
83
|
-
return err(typeCastError("REVOLUTION_NOT_3D", "Revolution did not produce a 3D shape"));
|
|
84
|
-
return ok(shape);
|
|
85
|
-
});
|
|
86
|
-
return result;
|
|
87
|
-
};
|
|
88
|
-
function genericSweep(wire, spine, {
|
|
89
|
-
frenet = false,
|
|
90
|
-
auxiliarySpine,
|
|
91
|
-
law = null,
|
|
92
|
-
transitionMode = "right",
|
|
93
|
-
withContact,
|
|
94
|
-
support,
|
|
95
|
-
forceProfileSpineOthogonality,
|
|
96
|
-
mode: sweepMode,
|
|
97
|
-
tolerance,
|
|
98
|
-
boundTolerance,
|
|
99
|
-
angularTolerance,
|
|
100
|
-
maxDegree,
|
|
101
|
-
maxSegments
|
|
102
|
-
} = {}, shellMode = false) {
|
|
103
|
-
if (sweepMode === "simple" && !shellMode) {
|
|
104
|
-
const kernel2 = getKernel();
|
|
105
|
-
const resultOc = kernel2.simplePipe(wire.wrapped, spine.wrapped);
|
|
106
|
-
const result2 = andThen(cast(resultOc), (shape2) => {
|
|
107
|
-
if (!isShape3D(shape2))
|
|
108
|
-
return err(typeCastError("SWEEP_NOT_3D", "Simple pipe did not produce a 3D shape"));
|
|
109
|
-
return ok(shape2);
|
|
110
|
-
});
|
|
111
|
-
return result2;
|
|
112
|
-
}
|
|
113
|
-
const kernel = getKernel();
|
|
114
|
-
const withCorrection = transitionMode === "round" ? true : !!forceProfileSpineOthogonality;
|
|
115
|
-
const result = kernel.sweepPipeShell(wire.wrapped, spine.wrapped, {
|
|
116
|
-
transitionMode,
|
|
117
|
-
contact: !!withContact,
|
|
118
|
-
correction: withCorrection,
|
|
119
|
-
frenet,
|
|
120
|
-
shellMode,
|
|
121
|
-
...auxiliarySpine?.wrapped ? { auxiliary: auxiliarySpine.wrapped } : {},
|
|
122
|
-
...law !== null ? { law } : {},
|
|
123
|
-
...support !== null ? { support } : {},
|
|
124
|
-
tolerance,
|
|
125
|
-
boundTolerance,
|
|
126
|
-
angularTolerance,
|
|
127
|
-
maxDegree,
|
|
128
|
-
maxSegments
|
|
129
|
-
});
|
|
130
|
-
if (shellMode && typeof result === "object" && "firstShape" in result) {
|
|
131
|
-
const shape2 = unwrap(cast(result.shape));
|
|
132
|
-
if (!isShape3D(shape2)) {
|
|
133
|
-
return err(typeCastError("SWEEP_NOT_3D", "Sweep did not produce a 3D shape"));
|
|
134
|
-
}
|
|
135
|
-
const startWire = unwrap(cast(result.firstShape));
|
|
136
|
-
const endWire = unwrap(cast(result.lastShape));
|
|
137
|
-
if (!isWire(startWire)) {
|
|
138
|
-
return err(typeCastError("SWEEP_START_NOT_WIRE", "Sweep did not produce a start Wire"));
|
|
139
|
-
}
|
|
140
|
-
if (!isWire(endWire)) {
|
|
141
|
-
return err(typeCastError("SWEEP_END_NOT_WIRE", "Sweep did not produce an end Wire"));
|
|
142
|
-
}
|
|
143
|
-
return ok([shape2, startWire, endWire]);
|
|
144
|
-
}
|
|
145
|
-
const shape = unwrap(cast(result));
|
|
146
|
-
if (!isShape3D(shape)) {
|
|
147
|
-
return err(typeCastError("SWEEP_NOT_3D", "Sweep did not produce a 3D shape"));
|
|
148
|
-
}
|
|
149
|
-
return ok(shape);
|
|
150
|
-
}
|
|
151
|
-
function complexExtrude(wire, center, normal, profileShape, shellMode = false) {
|
|
152
|
-
var _stack = [];
|
|
153
|
-
try {
|
|
154
|
-
const scope = __using(_stack, new DisposalScope());
|
|
155
|
-
const centerVec = toVec3(center);
|
|
156
|
-
const normalVec = toVec3(normal);
|
|
157
|
-
const endVec = vecAdd(centerVec, normalVec);
|
|
158
|
-
const mainSpineEdge = scope.register(makeLine(centerVec, endVec));
|
|
159
|
-
const spine = scope.register(unwrap(assembleWire([mainSpineEdge])));
|
|
160
|
-
const law = profileShape ? scope.register(unwrap(buildLawFromProfile(vecLength(normalVec), profileShape))) : null;
|
|
161
|
-
const result = shellMode ? genericSweep(wire, spine, { law }, shellMode) : genericSweep(wire, spine, { law });
|
|
162
|
-
return result;
|
|
163
|
-
} catch (_) {
|
|
164
|
-
var _error = _, _hasError = true;
|
|
165
|
-
} finally {
|
|
166
|
-
__callDispose(_stack, _error, _hasError);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
function twistExtrude(wire, angleDegrees, center, normal, profileShape, shellMode = false) {
|
|
170
|
-
var _stack = [];
|
|
171
|
-
try {
|
|
172
|
-
const scope = __using(_stack, new DisposalScope());
|
|
173
|
-
const centerVec = toVec3(center);
|
|
174
|
-
const normalVec = toVec3(normal);
|
|
175
|
-
const endVec = vecAdd(centerVec, normalVec);
|
|
176
|
-
const mainSpineEdge = scope.register(makeLine(centerVec, endVec));
|
|
177
|
-
const spine = scope.register(unwrap(assembleWire([mainSpineEdge])));
|
|
178
|
-
const extrusionLength = vecLength(normalVec);
|
|
179
|
-
const pitch = 360 / angleDegrees * extrusionLength;
|
|
180
|
-
const radius = 1;
|
|
181
|
-
const auxiliarySpine = scope.register(
|
|
182
|
-
makeHelix(pitch, extrusionLength, radius, centerVec, normalVec)
|
|
183
|
-
);
|
|
184
|
-
const law = profileShape ? scope.register(unwrap(buildLawFromProfile(extrusionLength, profileShape))) : null;
|
|
185
|
-
const result = shellMode ? genericSweep(wire, spine, { auxiliarySpine, law }, shellMode) : genericSweep(wire, spine, { auxiliarySpine, law });
|
|
186
|
-
return result;
|
|
187
|
-
} catch (_) {
|
|
188
|
-
var _error = _, _hasError = true;
|
|
189
|
-
} finally {
|
|
190
|
-
__callDispose(_stack, _error, _hasError);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
const loft = (wires, { ruled = true, startPoint, endPoint } = {}, returnShell = false) => {
|
|
194
|
-
if (wires.length === 0 && !startPoint && !endPoint) {
|
|
195
|
-
return err(validationError("LOFT_EMPTY", "Loft requires at least one wire or start/end point"));
|
|
196
|
-
}
|
|
197
|
-
const kernel = getKernel();
|
|
198
|
-
const startVertex = startPoint ? makeVertex(toVec3(startPoint)).wrapped : void 0;
|
|
199
|
-
const endVertex = endPoint ? makeVertex(toVec3(endPoint)).wrapped : void 0;
|
|
200
|
-
try {
|
|
201
|
-
const shape = kernel.loftAdvanced(
|
|
202
|
-
wires.map((w) => w.wrapped),
|
|
203
|
-
{
|
|
204
|
-
solid: !returnShell,
|
|
205
|
-
ruled,
|
|
206
|
-
...startVertex ? { startVertex } : {},
|
|
207
|
-
...endVertex ? { endVertex } : {}
|
|
208
|
-
}
|
|
209
|
-
);
|
|
210
|
-
const result = andThen(cast(shape), (s) => {
|
|
211
|
-
if (!isShape3D(s))
|
|
212
|
-
return err(typeCastError("LOFT_NOT_3D", "Loft did not produce a 3D shape"));
|
|
213
|
-
return ok(s);
|
|
214
|
-
});
|
|
215
|
-
return result;
|
|
216
|
-
} catch {
|
|
217
|
-
return err(kernelError("LOFT_FAILED", "Loft operation failed"));
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
export {
|
|
221
|
-
buildLawFromProfile as a,
|
|
222
|
-
basicFaceExtrusion as b,
|
|
223
|
-
complexExtrude as c,
|
|
224
|
-
genericSweep as g,
|
|
225
|
-
loft as l,
|
|
226
|
-
revolution as r,
|
|
227
|
-
twistExtrude as t
|
|
228
|
-
};
|