brepjs 18.5.3 → 18.6.1
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/blueprintOffset.d.ts.map +1 -1
- package/dist/2d/blueprints/intersectionSegments.d.ts.map +1 -1
- package/dist/2d/blueprints/segmentAssembly.d.ts.map +1 -1
- package/dist/2d/lib/curve2D.d.ts.map +1 -1
- package/dist/2d/lib/customCorners.d.ts.map +1 -1
- package/dist/2d/lib/stitching.d.ts.map +1 -1
- package/dist/2d/lib/svgPath.d.ts.map +1 -1
- package/dist/2d.cjs +6 -6
- package/dist/2d.js +6 -6
- package/dist/{blueprint-BKo2Z5P_.cjs → blueprint-C5LxqHCa.cjs} +16 -15
- package/dist/{blueprint-DXNeal2M.js → blueprint-CBairprN.js} +16 -15
- package/dist/{blueprintFns-DLmNAtH4.cjs → blueprintFns-CwbDuLxf.cjs} +3 -3
- package/dist/{blueprintFns-DwKTTALX.js → blueprintFns-D8ST0Cf4.js} +3 -3
- package/dist/{boolean2D-C8DlibdA.js → boolean2D-A5u9tJYl.js} +26 -24
- package/dist/{boolean2D-CvirfeVA.cjs → boolean2D-DxZ3Kwlq.cjs} +26 -24
- package/dist/{booleanFns-BTmOI2IT.cjs → booleanFns-DWQMtFDN.cjs} +9 -9
- package/dist/{booleanFns-BvRK1Oi2.js → booleanFns-DjZF4MJ5.js} +9 -9
- package/dist/brepjs.cjs +51 -41
- package/dist/brepjs.js +51 -41
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core.cjs +6 -6
- package/dist/core.js +6 -6
- package/dist/{cornerFinder-D3eGMa24.cjs → cornerFinder-B2CpcVV9.cjs} +3 -3
- package/dist/{cornerFinder-BwE0co98.js → cornerFinder-DGvOt2ab.js} +3 -3
- package/dist/{curveFns-CkhBj1Ot.cjs → curveFns-B8KJKr8-.cjs} +2 -2
- package/dist/{curveFns-DOtvwQN1.js → curveFns-DZYE3BGO.js} +2 -2
- package/dist/{drawFns-ChZrX59C.js → drawFns-Bl865kUL.js} +21 -20
- package/dist/{drawFns-CFqr2BFZ.cjs → drawFns-h8gJBx-H.cjs} +21 -20
- package/dist/{errors-DboJwVCf.js → errors-0fYW_YnO.js} +2 -1
- package/dist/{errors-CXRNVCec.cjs → errors-Dv6pfNct.cjs} +2 -1
- package/dist/{extrudeFns-sFXnQ0GR.cjs → extrudeFns-BlJKAnW8.cjs} +3 -3
- package/dist/{extrudeFns-9m-r4epC.js → extrudeFns-O2s-SFf-.js} +3 -3
- package/dist/{faceFns-9yuvhlzD.cjs → faceFns-B1H43mZ_.cjs} +3 -3
- package/dist/{faceFns-CoVqCTcx.js → faceFns-acz86gqR.js} +3 -3
- package/dist/{helpers-BPqm4AyF.cjs → helpers-C3smxDtp.cjs} +8 -8
- package/dist/{helpers-thCB-5I7.js → helpers-DL1f3xp0.js} +8 -8
- package/dist/{historyFns-DlyOFijD.js → historyFns-CD9qXw5j.js} +6 -6
- package/dist/{historyFns-C8RKuoZR.cjs → historyFns-DBdWeo7Y.cjs} +6 -6
- package/dist/{importFns-C9KoV6Q2.cjs → importFns-5tcN3-fK.cjs} +11 -19
- package/dist/{importFns-TsXZed73.js → importFns-B1p3FiGS.js} +11 -19
- package/dist/io/gltfExportFns.d.ts.map +1 -1
- package/dist/io/objExportFns.d.ts.map +1 -1
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/brepkit/booleanOps.d.ts.map +1 -1
- package/dist/kernel/brepkit/constructionOps.d.ts +3 -2
- package/dist/kernel/brepkit/constructionOps.d.ts.map +1 -1
- package/dist/kernel/brepkit/evolutionOps.d.ts.map +1 -1
- package/dist/kernel/brepkit/geometryOps.d.ts.map +1 -1
- package/dist/kernel/brepkit/helpers.d.ts.map +1 -1
- package/dist/kernel/brepkit/internalOps.d.ts.map +1 -1
- package/dist/kernel/brepkit/ioOps.d.ts.map +1 -1
- package/dist/kernel/brepkit/kernel2dOps.d.ts.map +1 -1
- package/dist/kernel/brepkit/measureOps.d.ts.map +1 -1
- package/dist/kernel/brepkit/meshOps.d.ts.map +1 -1
- package/dist/kernel/brepkit/modifierOps.d.ts.map +1 -1
- package/dist/kernel/brepkit/topologyOps.d.ts.map +1 -1
- package/dist/kernel/occt/advancedOps.d.ts.map +1 -1
- package/dist/kernel/occt/booleanOps.d.ts.map +1 -1
- package/dist/kernel/occt/extendedConstructorOps.d.ts.map +1 -1
- package/dist/kernel/occt/kernel2dOps.d.ts.map +1 -1
- package/dist/kernel/occtWasm/adapterShims.d.ts +5 -0
- package/dist/kernel/occtWasm/adapterShims.d.ts.map +1 -0
- package/dist/kernel/occtWasm/booleanOps.d.ts +12 -0
- package/dist/kernel/occtWasm/booleanOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/constructionOps.d.ts +37 -0
- package/dist/kernel/occtWasm/constructionOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/curveOps.d.ts +24 -0
- package/dist/kernel/occtWasm/curveOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/evolutionOps.d.ts +18 -0
- package/dist/kernel/occtWasm/evolutionOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/helpers.d.ts +32 -0
- package/dist/kernel/occtWasm/helpers.d.ts.map +1 -0
- package/dist/kernel/occtWasm/hullOps.d.ts +13 -0
- package/dist/kernel/occtWasm/hullOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/ioOps.d.ts +53 -0
- package/dist/kernel/occtWasm/ioOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/kernel2dOps.d.ts +91 -0
- package/dist/kernel/occtWasm/kernel2dOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/measureOps.d.ts +32 -0
- package/dist/kernel/occtWasm/measureOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/meshOps.d.ts +7 -0
- package/dist/kernel/occtWasm/meshOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/modifierOps.d.ts +15 -0
- package/dist/kernel/occtWasm/modifierOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +30 -30
- package/dist/kernel/occtWasm/occtWasmAdapter.d.ts.map +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/kernel/occtWasm/primitiveOps.d.ts +11 -0
- package/dist/kernel/occtWasm/primitiveOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/repairOps.d.ts +11 -0
- package/dist/kernel/occtWasm/repairOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/surfaceOps.d.ts +29 -0
- package/dist/kernel/occtWasm/surfaceOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/sweepOps.d.ts +39 -0
- package/dist/kernel/occtWasm/sweepOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/topologyOps.d.ts +15 -0
- package/dist/kernel/occtWasm/topologyOps.d.ts.map +1 -0
- package/dist/kernel/occtWasm/transformOps.d.ts +28 -0
- package/dist/kernel/occtWasm/transformOps.d.ts.map +1 -0
- package/dist/{measureFns-DXLTUwTN.cjs → measureFns-CHmy_Inq.cjs} +3 -3
- package/dist/{measureFns-CkhDfqzu.js → measureFns-CJi8erDL.js} +3 -3
- package/dist/measurement/interferenceFns.d.ts.map +1 -1
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-CAUI3r1d.js → meshFns-BkY1RAoC.js} +3 -3
- package/dist/{meshFns-DzGr_wxJ.cjs → meshFns-t2lR4BDS.cjs} +3 -3
- package/dist/occtWasmAdapter--TZGP9DX.js +4606 -0
- package/dist/occtWasmAdapter-C2VW-uYg.cjs +4719 -0
- package/dist/operations/compoundOpsFns.d.ts.map +1 -1
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{planeOps-sTrM3dcQ.js → planeOps-4i2qEraD.js} +4 -4
- package/dist/{planeOps-BJOIbn4K.cjs → planeOps-CH4ruLuj.cjs} +4 -4
- package/dist/{primitiveFns-ClBrBsj6.cjs → primitiveFns-DwhN--zB.cjs} +7 -7
- package/dist/{primitiveFns-DEIibX8G.js → primitiveFns-Emvge_71.js} +7 -7
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/result.cjs +1 -1
- package/dist/result.js +1 -1
- package/dist/{shapeFns-c2eak2sT.cjs → shapeFns-CObBAJoQ.cjs} +4 -4
- package/dist/{shapeFns-Cwt0CMNm.js → shapeFns-DThjHtJI.js} +4 -4
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeRefFns-D-JLpn7D.cjs → shapeRefFns-I0MHjRAq.cjs} +5 -4
- package/dist/{shapeRefFns-Cx61pDhQ.js → shapeRefFns-WMhIFuGW.js} +5 -4
- package/dist/{shapeTypes-Xnk670Cd.cjs → shapeTypes-8vB31RfA.cjs} +290 -418
- package/dist/{shapeTypes-uibK1QHY.js → shapeTypes-AyL8vv_O.js} +290 -418
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{solidBuilders-BnTtq4g1.js → solidBuilders-C7Xp_ikW.js} +3 -3
- package/dist/{solidBuilders-23LDxzEn.cjs → solidBuilders-Djwgx2mj.cjs} +3 -3
- package/dist/{surfaceBuilders-CUn-cmah.cjs → surfaceBuilders-BEnsewN9.cjs} +3 -3
- package/dist/{surfaceBuilders-DeNnAJb3.js → surfaceBuilders-Con0IpLf.js} +3 -3
- package/dist/topology/minkowskiFns.d.ts.map +1 -1
- package/dist/topology/shapeRef/shapeRefFns.d.ts.map +1 -1
- package/dist/topology/wrapperFns.d.ts.map +1 -1
- package/dist/topology.cjs +6 -6
- package/dist/topology.js +6 -6
- package/dist/utils/vec3.d.ts +32 -0
- package/dist/utils/vec3.d.ts.map +1 -0
- package/dist/vec3-BRj3eI54.js +25 -0
- package/dist/vec3-S4Oh59IX.cjs +36 -0
- package/dist/vectors.cjs +4 -4
- package/dist/vectors.js +4 -4
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +1 -1
- package/package.json +2 -2
- package/dist/occtWasmAdapter-CuZRRioz.cjs +0 -3947
- package/dist/occtWasmAdapter-DIhUXubY.js +0 -3834
- /package/dist/{arrayAccess-tCIbjLs5.js → arrayAccess-2G0pRoaC.js} +0 -0
- /package/dist/{arrayAccess-DsnQpdSD.cjs → arrayAccess-Br-m2PP7.cjs} +0 -0
- /package/dist/{constants-csSEYddm.js → constants-Ci5CA3aZ.js} +0 -0
- /package/dist/{constants-BNP_xnBN.cjs → constants-DTorLmes.cjs} +0 -0
- /package/dist/{types--GD-LVc6.js → types-BIdk_GJY.js} +0 -0
- /package/dist/{types-gLi9wL0N.cjs → types-CDkxah-M.cjs} +0 -0
- /package/dist/{vecOps-CODplJp3.cjs → vecOps-D7xplSx8.cjs} +0 -0
- /package/dist/{vecOps-B-PCHgyB.js → vecOps-DVROrqTV.js} +0 -0
- /package/dist/{workerHandler-Dm0_0F8Z.js → workerHandler-BndMJVx6.js} +0 -0
- /package/dist/{workerHandler-C-3cFcsQ.cjs → workerHandler-sCf818XJ.cjs} +0 -0
package/dist/brepjs.cjs
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_drawFns = require("./drawFns-
|
|
3
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
2
|
+
const require_drawFns = require("./drawFns-h8gJBx-H.cjs");
|
|
3
|
+
const require_shapeTypes = require("./shapeTypes-8vB31RfA.cjs");
|
|
4
|
+
const require_vec3 = require("./vec3-S4Oh59IX.cjs");
|
|
5
|
+
const require_occtWasmAdapter = require("./occtWasmAdapter-C2VW-uYg.cjs");
|
|
6
|
+
const require_errors = require("./errors-Dv6pfNct.cjs");
|
|
7
|
+
const require_faceFns = require("./faceFns-B1H43mZ_.cjs");
|
|
8
|
+
const require_constants = require("./constants-DTorLmes.cjs");
|
|
9
|
+
const require_types = require("./types-CDkxah-M.cjs");
|
|
10
|
+
const require_vecOps = require("./vecOps-D7xplSx8.cjs");
|
|
11
|
+
const require_planeOps = require("./planeOps-CH4ruLuj.cjs");
|
|
12
|
+
const require_shapeFns = require("./shapeFns-CObBAJoQ.cjs");
|
|
13
|
+
const require_curveFns = require("./curveFns-B8KJKr8-.cjs");
|
|
14
|
+
const require_meshFns = require("./meshFns-t2lR4BDS.cjs");
|
|
15
|
+
const require_arrayAccess = require("./arrayAccess-Br-m2PP7.cjs");
|
|
16
|
+
const require_surfaceBuilders = require("./surfaceBuilders-BEnsewN9.cjs");
|
|
17
|
+
const require_booleanFns = require("./booleanFns-DWQMtFDN.cjs");
|
|
18
|
+
const require_primitiveFns = require("./primitiveFns-DwhN--zB.cjs");
|
|
19
|
+
const require_historyFns = require("./historyFns-DBdWeo7Y.cjs");
|
|
20
|
+
const require_boolean2D = require("./boolean2D-DxZ3Kwlq.cjs");
|
|
21
|
+
const require_helpers = require("./helpers-C3smxDtp.cjs");
|
|
22
|
+
const require_solidBuilders = require("./solidBuilders-Djwgx2mj.cjs");
|
|
23
|
+
const require_measureFns = require("./measureFns-CHmy_Inq.cjs");
|
|
24
|
+
const require_cornerFinder = require("./cornerFinder-B2CpcVV9.cjs");
|
|
25
|
+
const require_extrudeFns = require("./extrudeFns-BlJKAnW8.cjs");
|
|
26
|
+
const require_blueprintFns = require("./blueprintFns-CwbDuLxf.cjs");
|
|
27
|
+
const require_importFns = require("./importFns-5tcN3-fK.cjs");
|
|
28
|
+
const require_shapeRefFns = require("./shapeRefFns-I0MHjRAq.cjs");
|
|
29
|
+
const require_workerHandler = require("./workerHandler-sCf818XJ.cjs");
|
|
29
30
|
//#region src/topology/shapeBooleans.ts
|
|
30
31
|
var BOPAlgo_GlueShift = 1;
|
|
31
32
|
var BOPAlgo_GlueFull = 2;
|
|
@@ -413,7 +414,7 @@ function convexHull(points) {
|
|
|
413
414
|
function detectSphere(shape) {
|
|
414
415
|
const faces = require_faceFns.getFaces(shape);
|
|
415
416
|
if (faces.length !== 1) return null;
|
|
416
|
-
const face = faces
|
|
417
|
+
const face = require_vec3.wasmIndex(faces, 0);
|
|
417
418
|
if (require_faceFns.getCachedSurfaceType(face) !== "sphere") return null;
|
|
418
419
|
const faceArea = require_shapeTypes.getKernel().area(face.wrapped);
|
|
419
420
|
return Math.sqrt(faceArea / (4 * Math.PI));
|
|
@@ -1413,8 +1414,8 @@ function checkAllInterferences(shapes, tolerance = 1e-6) {
|
|
|
1413
1414
|
const boxes = shapes.map((s) => require_faceFns.getBounds(s));
|
|
1414
1415
|
shapes.forEach((si, i) => {
|
|
1415
1416
|
for (let j = i + 1; j < shapes.length; j++) {
|
|
1416
|
-
if (aabbDisjoint(boxes
|
|
1417
|
-
const result = require_errors.unwrap(checkInterference(si, shapes
|
|
1417
|
+
if (aabbDisjoint(require_vec3.wasmIndex(boxes, i), require_vec3.wasmIndex(boxes, j), tolerance)) continue;
|
|
1418
|
+
const result = require_errors.unwrap(checkInterference(si, require_vec3.wasmIndex(shapes, j), tolerance));
|
|
1418
1419
|
if (result.hasInterference) pairs.push({
|
|
1419
1420
|
i,
|
|
1420
1421
|
j,
|
|
@@ -2247,7 +2248,7 @@ function resolveTargetFace(shape, faceSpec) {
|
|
|
2247
2248
|
if (typeof faceSpec === "function") {
|
|
2248
2249
|
const found = faceSpec(require_helpers.faceFinder()).findAll(shape);
|
|
2249
2250
|
if (found.length === 0) return require_errors.err(require_errors.queryError(require_errors.BrepErrorCode.COMPOUND_FACE_NOT_FOUND, "compoundOps: face finder matched no faces"));
|
|
2250
|
-
return require_errors.ok(found
|
|
2251
|
+
return require_errors.ok(require_vec3.wasmIndex(found, 0));
|
|
2251
2252
|
}
|
|
2252
2253
|
return require_errors.ok(faceSpec);
|
|
2253
2254
|
}
|
|
@@ -2457,6 +2458,15 @@ function unwrapOrThrow(result) {
|
|
|
2457
2458
|
if (require_errors.isErr(result)) throw new BrepWrapperError(result.error);
|
|
2458
2459
|
return result.value;
|
|
2459
2460
|
}
|
|
2461
|
+
function asValidSolid(s) {
|
|
2462
|
+
return s;
|
|
2463
|
+
}
|
|
2464
|
+
function asOrientedPlanarFace(f) {
|
|
2465
|
+
return f;
|
|
2466
|
+
}
|
|
2467
|
+
function asClosedWire(w) {
|
|
2468
|
+
return w;
|
|
2469
|
+
}
|
|
2460
2470
|
function createWrappedBase(val) {
|
|
2461
2471
|
return {
|
|
2462
2472
|
val,
|
|
@@ -2538,16 +2548,16 @@ function createWrapped3D(val) {
|
|
|
2538
2548
|
split: (tools) => wrapAny(unwrapOrThrow(split(val, tools))),
|
|
2539
2549
|
slice: (planes, opts) => unwrapOrThrow(slice(val, planes, opts)),
|
|
2540
2550
|
fillet(...args) {
|
|
2541
|
-
if (args.length === 1) return wrap3D(unwrapOrThrow(fillet(val, args[0])));
|
|
2542
|
-
return wrap3D(unwrapOrThrow(fillet(val, args[0], args[1])));
|
|
2551
|
+
if (args.length === 1) return wrap3D(unwrapOrThrow(fillet(asValidSolid(val), args[0])));
|
|
2552
|
+
return wrap3D(unwrapOrThrow(fillet(asValidSolid(val), args[0], args[1])));
|
|
2543
2553
|
},
|
|
2544
2554
|
chamfer(...args) {
|
|
2545
|
-
if (args.length === 1) return wrap3D(unwrapOrThrow(chamfer(val, args[0])));
|
|
2546
|
-
return wrap3D(unwrapOrThrow(chamfer(val, args[0], args[1])));
|
|
2555
|
+
if (args.length === 1) return wrap3D(unwrapOrThrow(chamfer(asValidSolid(val), args[0])));
|
|
2556
|
+
return wrap3D(unwrapOrThrow(chamfer(asValidSolid(val), args[0], args[1])));
|
|
2547
2557
|
},
|
|
2548
|
-
shell: (faces, thickness, opts) => wrap3D(unwrapOrThrow(shell(val, faces, thickness, opts))),
|
|
2549
|
-
offset: (distance, opts) => wrap3D(unwrapOrThrow(offset(val, distance, opts))),
|
|
2550
|
-
draft: (faces, opts) => wrap3D(unwrapOrThrow(draft(val, faces, opts))),
|
|
2558
|
+
shell: (faces, thickness, opts) => wrap3D(unwrapOrThrow(shell(asValidSolid(val), faces, thickness, opts))),
|
|
2559
|
+
offset: (distance, opts) => wrap3D(unwrapOrThrow(offset(asValidSolid(val), distance, opts))),
|
|
2560
|
+
draft: (faces, opts) => wrap3D(unwrapOrThrow(draft(asValidSolid(val), faces, opts))),
|
|
2551
2561
|
drill: (opts) => wrap3D(unwrapOrThrow(drill(val, opts))),
|
|
2552
2562
|
pocket: (opts) => wrap3D(unwrapOrThrow(pocket(val, opts))),
|
|
2553
2563
|
boss: (opts) => wrap3D(unwrapOrThrow(boss(val, opts))),
|
|
@@ -2576,7 +2586,7 @@ function createWrappedCurve(val) {
|
|
|
2576
2586
|
isClosed: () => require_curveFns.curveIsClosed(val),
|
|
2577
2587
|
sweep(spine, opts) {
|
|
2578
2588
|
if (!require_shapeTypes.isWire(val)) throw new Error("sweep requires a Wire");
|
|
2579
|
-
const result = unwrapOrThrow(require_extrudeFns.sweep(val, resolve(spine), opts));
|
|
2589
|
+
const result = unwrapOrThrow(require_extrudeFns.sweep(asClosedWire(val), resolve(spine), opts));
|
|
2580
2590
|
return wrap3D(Array.isArray(result) ? result[0] : result);
|
|
2581
2591
|
}
|
|
2582
2592
|
};
|
|
@@ -2590,8 +2600,8 @@ function createWrappedFace(val) {
|
|
|
2590
2600
|
surfaceType: () => unwrapOrThrow(require_faceFns.getSurfaceType(val)),
|
|
2591
2601
|
outerWire: () => require_faceFns.outerWire(val),
|
|
2592
2602
|
innerWires: () => require_faceFns.innerWires(val),
|
|
2593
|
-
extrude: (height) => wrap3D(unwrapOrThrow(extrude(val, height))),
|
|
2594
|
-
revolve: (opts) => wrap3D(unwrapOrThrow(revolve(val, opts)))
|
|
2603
|
+
extrude: (height) => wrap3D(unwrapOrThrow(extrude(asOrientedPlanarFace(val), height))),
|
|
2604
|
+
revolve: (opts) => wrap3D(unwrapOrThrow(revolve(asOrientedPlanarFace(val), opts)))
|
|
2595
2605
|
};
|
|
2596
2606
|
}
|
|
2597
2607
|
function wrapAny(val) {
|
package/dist/brepjs.js
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { $ as initFromOC, A as planarWire, B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, F as as3D, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, P as as2D, Q as init, R as DisposalScope, S as isManifoldShell, T as isPlanarWire, V as getDisposalStats, W as resetDisposalStats, X as getKernel, _ as isSolid, a as createEdge, at as BrepkitAdapter, b as closedWire, c as createSolid, d as isCompound, et as prewarm, f as isEdge, g as isShell, h as isShape3D, i as createCompound, it as supportsProjection, j as validSolid, k as planarFace, l as createVertex, m as isShape1D, n as castShape3D, nt as withKernel, o as createFace, ot as getPerformanceStats, p as isFace, q as withScopeResult, rt as supportsConstraintSketch, s as createShell, st as resetPerformanceStats, t as castShape, tt as registerKernel, u as createWire, v as isVertex, w as isPlanarFace, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { A as
|
|
5
|
-
import { n as
|
|
6
|
-
import { n as
|
|
7
|
-
import {
|
|
8
|
-
import { i as
|
|
9
|
-
import {
|
|
10
|
-
import { a as
|
|
11
|
-
import { a as
|
|
12
|
-
import { n as
|
|
13
|
-
import { n as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { C as
|
|
17
|
-
import { a as
|
|
18
|
-
import { a as
|
|
19
|
-
import {
|
|
20
|
-
import { r as
|
|
21
|
-
import {
|
|
22
|
-
import { t as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { a as
|
|
26
|
-
import { a as
|
|
27
|
-
import { a as
|
|
1
|
+
import { $ as initFromOC, A as planarWire, B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, F as as3D, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, P as as2D, Q as init, R as DisposalScope, S as isManifoldShell, T as isPlanarWire, V as getDisposalStats, W as resetDisposalStats, X as getKernel, _ as isSolid, a as createEdge, at as BrepkitAdapter, b as closedWire, c as createSolid, d as isCompound, et as prewarm, f as isEdge, g as isShell, h as isShape3D, i as createCompound, it as supportsProjection, j as validSolid, k as planarFace, l as createVertex, m as isShape1D, n as castShape3D, nt as withKernel, o as createFace, ot as getPerformanceStats, p as isFace, q as withScopeResult, rt as supportsConstraintSketch, s as createShell, st as resetPerformanceStats, t as castShape, tt as registerKernel, u as createWire, v as isVertex, w as isPlanarFace, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-AyL8vv_O.js";
|
|
2
|
+
import { n as wasmIndex } from "./vec3-BRj3eI54.js";
|
|
3
|
+
import { t as OcctWasmAdapter } from "./occtWasmAdapter--TZGP9DX.js";
|
|
4
|
+
import { A as ok, B as unwrapOr, C as fromNullable, D as mapBoth, E as map, F as tapErr, H as zip, I as tryCatch, L as tryCatchAsync, M as orElse, N as pipeline, O as mapErr, P as tap, R as unwrap, S as flatten, T as isOk, V as unwrapOrElse, _ as all, a as moduleInitError, b as err, c as sketcherStateError, d as validationError, g as OK, h as bug, i as kernelError, j as or, k as match, l as typeCastError, m as BrepBugError, n as computationError, o as queryError, r as ioError, t as BrepErrorCode, u as unsupportedError, v as andThen, w as isErr, x as flatMap, y as collect, z as unwrapErr } from "./errors-0fYW_YnO.js";
|
|
5
|
+
import { A as vertexPosition, B as kernelCallScoped, C as getVertices, D as iterFaces, E as iterEdges, F as isCompSolid, I as iterTopo, L as shapeType, M as cast, N as downcast, O as iterVertices, P as fromBREP, R as kernelCall, T as invalidateShapeCache, a as flipFaceOrientation, b as getEdges, c as normalAt, d as projectPointOnFace, f as removeHolesFromFace, g as getBounds, h as describe$1, i as faceOrientation, j as asTopo, k as iterWires, l as outerWire, m as uvCoordinates, n as faceCenter, o as getSurfaceType, p as uvBounds, r as faceGeomType, s as innerWires, t as classifyPointOnFace, u as pointOnSurface, w as getWires, x as getFaces, y as getCachedSurfaceType, z as kernelCallRaw } from "./faceFns-acz86gqR.js";
|
|
6
|
+
import { n as HASH_CODE_MAX, r as RAD2DEG, t as DEG2RAD } from "./constants-Ci5CA3aZ.js";
|
|
7
|
+
import { n as toVec2, r as toVec3, t as resolveDirection } from "./types-BIdk_GJY.js";
|
|
8
|
+
import { a as vecDot, c as vecLength, d as vecNormalize, f as vecProjectToPlane, g as vecSub, h as vecScale, i as vecDistance, l as vecLengthSq, m as vecRotate, n as vecAngle, o as vecEquals, p as vecRepr, r as vecCross, s as vecIsZero, t as vecAdd, u as vecNegate } from "./vecOps-DVROrqTV.js";
|
|
9
|
+
import { i as pivotPlane, n as createPlane, o as resolvePlane, r as makePlane, s as translatePlane, t as createNamedPlane } from "./planeOps-4i2qEraD.js";
|
|
10
|
+
import { C as findFacesByTag, D as tagFaces, E as setTagMetadata, O as getFaceOrigins, S as getShapeColor, T as getTagMetadata, a as isSameShape, b as colorShape, c as applyMatrix$1, d as resize, f as rotate$1, h as translate$1, i as isEqualShape, k as setShapeOrigin, l as composeTransforms, m as transformCopy$1, n as getHashCode, o as simplify$1, p as scale$1, r as isEmpty$2, s as toBREP$1, t as clone$1, u as mirror$1, w as getFaceTags, x as getFaceColor, y as colorFaces } from "./shapeFns-DThjHtJI.js";
|
|
11
|
+
import { a as curveLength, c as curveStartPoint, d as getCurveType, f as getOrientation, i as curveIsPeriodic, l as curveTangentAt, m as offsetWire2D, n as curveEndPoint, o as curvePeriod, p as interpolateCurve, r as curveIsClosed, s as curvePointAt, t as approximateCurve, u as flipOrientation } from "./curveFns-DZYE3BGO.js";
|
|
12
|
+
import { a as meshEdges$1, c as createMeshCache, i as mesh$1, n as exportSTEP, o as meshMultiLOD, r as exportSTL, s as clearMeshCache, t as exportIGES } from "./meshFns-BkY1RAoC.js";
|
|
13
|
+
import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-2G0pRoaC.js";
|
|
14
|
+
import { n as fill, r as makeFace } from "./surfaceBuilders-Con0IpLf.js";
|
|
15
|
+
import { a as fuseAll, c as sectionToFace$1, i as fuse$1, l as slice$1, n as cut$1, o as intersect$1, r as cutAll, s as section$1, t as booleanPipeline, u as split$1 } from "./booleanFns-DjZF4MJ5.js";
|
|
16
|
+
import { $ as getNurbsSurfaceData, A as fixShape, B as offset$1, C as threePointArc, D as wireLoop, E as wire, F as isValid$1, G as chamferWithEvolution, H as thicken$1, I as solidFromShell, J as fuseWithEvolution, K as cutWithEvolution, L as chamfer$1, M as healFace, N as healSolid, O as autoHeal, P as healWire, Q as getNurbsCurveData, R as draft$1, S as tangentArc, T as vertex, U as variableFillet, V as shell$1, W as positionOnCurve, X as shellWithEvolution, Y as intersectWithEvolution, Z as checkBoolean, _ as polygon, a as circle, at as wiresOfFace, b as sphere, c as cylinder, ct as toGroupedBufferGeometryData, d as ellipsoid, et as adjacentFaces, f as face, g as offsetFace, h as line, i as bsplineApprox, it as verticesOfEdge, j as heal$1, k as fixSelfIntersection, l as ellipse, lt as toLODGeometryData, m as helix, n as bezier, nt as facesOfEdge, o as compound, ot as chamferDistAngle, p as filledFace, q as filletWithEvolution, r as box, rt as sharedEdges, s as cone, st as toBufferGeometryData, t as addHoles, tt as edgesOfFace, u as ellipseArc, ut as toLineGeometryData, v as sewShells, w as torus, x as subFace, y as solid, z as fillet$1 } from "./primitiveFns-Emvge_71.js";
|
|
17
|
+
import { C as walkAssembly, D as exportAssemblySTEP, E as linearPattern, O as createAssembly, S as updateNode, _ as collectShapes, a as findStep, b as findNode, c as registerOperation, d as replayHistory, f as serializeHistory, g as addChild, h as undoLast, i as deserializeHistory, l as registerShape, m as stepsFrom, n as createHistory, o as getShape, p as stepCount, r as createRegistry, s as modifyStep, t as addStep, u as replayFrom, v as countNodes, w as circularPattern, x as removeChild, y as createAssemblyNode } from "./historyFns-CD9qXw5j.js";
|
|
18
|
+
import { a as fuseBlueprints, c as roundedRectangleBlueprint, f as Sketch, h as organiseBlueprints, i as cutBlueprints, m as loftAll, n as fuse2D, o as intersectBlueprints, p as loft$1, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-A5u9tJYl.js";
|
|
19
|
+
import { a as createTypedFinder, i as wireFinder, n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-DL1f3xp0.js";
|
|
20
|
+
import { $ as sketchFaceOffset, B as drawSingleCircle, C as cameraFromPlane, D as makeProjectedEdges, E as projectEdges, F as drawParametricFunction, G as loadFont, H as drawText, I as drawPointsInterpolation, J as textMetrics, K as sketchText, L as drawPolysides, M as draw, N as drawCircle, O as isProjectionPlane, P as drawEllipse, Q as sketchEllipse, R as drawRectangle, S as drawProjection, T as createCamera, U as fontMetrics, V as drawSingleEllipse, W as getFont, X as polysideInnerRadius, Y as makeBaseBox, Z as sketchCircle, _ as sketchLoft, a as drawingIntersect, b as sketchWires, c as rotateDrawing, d as compoundSketchExtrude, et as sketchHelix, f as compoundSketchFace, g as sketchFace, h as sketchExtrude, i as drawingFuse, it as sketchRoundedRectangle, j as deserializeDrawing, l as scaleDrawing, m as compoundSketchRevolve, n as drawingCut, nt as sketchPolysides, o as drawingToSketchOnPlane, ot as Sketches, p as compoundSketchLoft, q as textBlueprints, r as drawingFillet, rt as sketchRectangle, s as mirrorDrawing, st as CompoundSketch, t as drawingChamfer, tt as sketchParametricFunction, u as translateDrawing, v as sketchRevolve, w as cameraLookAt, x as drawFaceOutline, y as sketchSweep, z as drawRoundedRectangle } from "./drawFns-Bl865kUL.js";
|
|
21
|
+
import { r as makeCylinder } from "./solidBuilders-C7Xp_ikW.js";
|
|
22
|
+
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, i as measureCurvatureAtMid, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, r as measureCurvatureAt, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-CJi8erDL.js";
|
|
23
|
+
import { t as cornerFinder } from "./cornerFinder-DGvOt2ab.js";
|
|
24
|
+
import { a as guidedSweep, c as sweep, i as complexExtrude, l as twistExtrude, n as extrudeAll, o as multiSectionSweep, r as revolve$1, s as supportExtrude, t as extrude$1 } from "./extrudeFns-O2s-SFf-.js";
|
|
25
|
+
import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, n as createCompoundBlueprint, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns-D8ST0Cf4.js";
|
|
26
|
+
import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-B1p3FiGS.js";
|
|
27
|
+
import { a as updateRoles, i as resolveRef, n as captureHint, o as defaultScorer, r as createRef, t as assignRoles } from "./shapeRefFns-WMhIFuGW.js";
|
|
28
|
+
import { a as createTaskQueue, c as isEmpty$1, d as isDisposeRequest, f as isErrorResponse, h as isSuccessResponse, i as createWorkerClient, l as pendingCount, m as isOperationRequest, n as createWorkerHandler, o as dequeueTask, p as isInitRequest, r as registerHandler, s as enqueueTask, t as createOperationRegistry, u as rejectAll } from "./workerHandler-BndMJVx6.js";
|
|
28
29
|
//#region \0rolldown/runtime.js
|
|
29
30
|
var __defProp = Object.defineProperty;
|
|
30
31
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -424,7 +425,7 @@ function convexHull(points) {
|
|
|
424
425
|
function detectSphere(shape) {
|
|
425
426
|
const faces = getFaces(shape);
|
|
426
427
|
if (faces.length !== 1) return null;
|
|
427
|
-
const face = faces
|
|
428
|
+
const face = wasmIndex(faces, 0);
|
|
428
429
|
if (getCachedSurfaceType(face) !== "sphere") return null;
|
|
429
430
|
const faceArea = getKernel().area(face.wrapped);
|
|
430
431
|
return Math.sqrt(faceArea / (4 * Math.PI));
|
|
@@ -1424,8 +1425,8 @@ function checkAllInterferences(shapes, tolerance = 1e-6) {
|
|
|
1424
1425
|
const boxes = shapes.map((s) => getBounds(s));
|
|
1425
1426
|
shapes.forEach((si, i) => {
|
|
1426
1427
|
for (let j = i + 1; j < shapes.length; j++) {
|
|
1427
|
-
if (aabbDisjoint(boxes
|
|
1428
|
-
const result = unwrap(checkInterference(si, shapes
|
|
1428
|
+
if (aabbDisjoint(wasmIndex(boxes, i), wasmIndex(boxes, j), tolerance)) continue;
|
|
1429
|
+
const result = unwrap(checkInterference(si, wasmIndex(shapes, j), tolerance));
|
|
1429
1430
|
if (result.hasInterference) pairs.push({
|
|
1430
1431
|
i,
|
|
1431
1432
|
j,
|
|
@@ -2250,7 +2251,7 @@ function resolveTargetFace(shape, faceSpec) {
|
|
|
2250
2251
|
if (typeof faceSpec === "function") {
|
|
2251
2252
|
const found = faceSpec(faceFinder()).findAll(shape);
|
|
2252
2253
|
if (found.length === 0) return err(queryError(BrepErrorCode.COMPOUND_FACE_NOT_FOUND, "compoundOps: face finder matched no faces"));
|
|
2253
|
-
return ok(found
|
|
2254
|
+
return ok(wasmIndex(found, 0));
|
|
2254
2255
|
}
|
|
2255
2256
|
return ok(faceSpec);
|
|
2256
2257
|
}
|
|
@@ -2460,6 +2461,15 @@ function unwrapOrThrow(result) {
|
|
|
2460
2461
|
if (isErr(result)) throw new BrepWrapperError(result.error);
|
|
2461
2462
|
return result.value;
|
|
2462
2463
|
}
|
|
2464
|
+
function asValidSolid(s) {
|
|
2465
|
+
return s;
|
|
2466
|
+
}
|
|
2467
|
+
function asOrientedPlanarFace(f) {
|
|
2468
|
+
return f;
|
|
2469
|
+
}
|
|
2470
|
+
function asClosedWire(w) {
|
|
2471
|
+
return w;
|
|
2472
|
+
}
|
|
2463
2473
|
function createWrappedBase(val) {
|
|
2464
2474
|
return {
|
|
2465
2475
|
val,
|
|
@@ -2541,16 +2551,16 @@ function createWrapped3D(val) {
|
|
|
2541
2551
|
split: (tools) => wrapAny(unwrapOrThrow(split(val, tools))),
|
|
2542
2552
|
slice: (planes, opts) => unwrapOrThrow(slice(val, planes, opts)),
|
|
2543
2553
|
fillet(...args) {
|
|
2544
|
-
if (args.length === 1) return wrap3D(unwrapOrThrow(fillet(val, args[0])));
|
|
2545
|
-
return wrap3D(unwrapOrThrow(fillet(val, args[0], args[1])));
|
|
2554
|
+
if (args.length === 1) return wrap3D(unwrapOrThrow(fillet(asValidSolid(val), args[0])));
|
|
2555
|
+
return wrap3D(unwrapOrThrow(fillet(asValidSolid(val), args[0], args[1])));
|
|
2546
2556
|
},
|
|
2547
2557
|
chamfer(...args) {
|
|
2548
|
-
if (args.length === 1) return wrap3D(unwrapOrThrow(chamfer(val, args[0])));
|
|
2549
|
-
return wrap3D(unwrapOrThrow(chamfer(val, args[0], args[1])));
|
|
2558
|
+
if (args.length === 1) return wrap3D(unwrapOrThrow(chamfer(asValidSolid(val), args[0])));
|
|
2559
|
+
return wrap3D(unwrapOrThrow(chamfer(asValidSolid(val), args[0], args[1])));
|
|
2550
2560
|
},
|
|
2551
|
-
shell: (faces, thickness, opts) => wrap3D(unwrapOrThrow(shell(val, faces, thickness, opts))),
|
|
2552
|
-
offset: (distance, opts) => wrap3D(unwrapOrThrow(offset(val, distance, opts))),
|
|
2553
|
-
draft: (faces, opts) => wrap3D(unwrapOrThrow(draft(val, faces, opts))),
|
|
2561
|
+
shell: (faces, thickness, opts) => wrap3D(unwrapOrThrow(shell(asValidSolid(val), faces, thickness, opts))),
|
|
2562
|
+
offset: (distance, opts) => wrap3D(unwrapOrThrow(offset(asValidSolid(val), distance, opts))),
|
|
2563
|
+
draft: (faces, opts) => wrap3D(unwrapOrThrow(draft(asValidSolid(val), faces, opts))),
|
|
2554
2564
|
drill: (opts) => wrap3D(unwrapOrThrow(drill(val, opts))),
|
|
2555
2565
|
pocket: (opts) => wrap3D(unwrapOrThrow(pocket(val, opts))),
|
|
2556
2566
|
boss: (opts) => wrap3D(unwrapOrThrow(boss(val, opts))),
|
|
@@ -2579,7 +2589,7 @@ function createWrappedCurve(val) {
|
|
|
2579
2589
|
isClosed: () => curveIsClosed(val),
|
|
2580
2590
|
sweep(spine, opts) {
|
|
2581
2591
|
if (!isWire(val)) throw new Error("sweep requires a Wire");
|
|
2582
|
-
const result = unwrapOrThrow(sweep(val, resolve(spine), opts));
|
|
2592
|
+
const result = unwrapOrThrow(sweep(asClosedWire(val), resolve(spine), opts));
|
|
2583
2593
|
return wrap3D(Array.isArray(result) ? result[0] : result);
|
|
2584
2594
|
}
|
|
2585
2595
|
};
|
|
@@ -2593,8 +2603,8 @@ function createWrappedFace(val) {
|
|
|
2593
2603
|
surfaceType: () => unwrapOrThrow(getSurfaceType(val)),
|
|
2594
2604
|
outerWire: () => outerWire(val),
|
|
2595
2605
|
innerWires: () => innerWires(val),
|
|
2596
|
-
extrude: (height) => wrap3D(unwrapOrThrow(extrude(val, height))),
|
|
2597
|
-
revolve: (opts) => wrap3D(unwrapOrThrow(revolve(val, opts)))
|
|
2606
|
+
extrude: (height) => wrap3D(unwrapOrThrow(extrude(asOrientedPlanarFace(val), height))),
|
|
2607
|
+
revolve: (opts) => wrap3D(unwrapOrThrow(revolve(asOrientedPlanarFace(val), opts)))
|
|
2598
2608
|
};
|
|
2599
2609
|
}
|
|
2600
2610
|
function wrapAny(val) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"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"}
|
package/dist/core.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
3
|
-
const require_errors = require("./errors-
|
|
4
|
-
const require_constants = require("./constants-
|
|
5
|
-
const require_types = require("./types-
|
|
6
|
-
const require_vecOps = require("./vecOps-
|
|
7
|
-
const require_planeOps = require("./planeOps-
|
|
2
|
+
const require_shapeTypes = require("./shapeTypes-8vB31RfA.cjs");
|
|
3
|
+
const require_errors = require("./errors-Dv6pfNct.cjs");
|
|
4
|
+
const require_constants = require("./constants-DTorLmes.cjs");
|
|
5
|
+
const require_types = require("./types-CDkxah-M.cjs");
|
|
6
|
+
const require_vecOps = require("./vecOps-D7xplSx8.cjs");
|
|
7
|
+
const require_planeOps = require("./planeOps-CH4ruLuj.cjs");
|
|
8
8
|
exports.BrepBugError = require_errors.BrepBugError;
|
|
9
9
|
exports.DEG2RAD = require_constants.DEG2RAD;
|
|
10
10
|
exports.DisposalScope = require_shapeTypes.DisposalScope;
|
package/dist/core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, R as DisposalScope, S as isManifoldShell, _ as isSolid, b as closedWire, d as isCompound, f as isEdge, g as isShell, h as isShape3D, j as validSolid, m as isShape1D, p as isFace, q as withScopeResult, t as castShape, v as isVertex, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-
|
|
2
|
-
import { A as ok, B as unwrapOr, E as map, I as tryCatch, L as tryCatchAsync, O as mapErr, R as unwrap, T as isOk, V as unwrapOrElse, a as moduleInitError, b as err, c as sketcherStateError, d as validationError, g as OK, h as bug, i as kernelError, k as match, l as typeCastError, m as BrepBugError, n as computationError, o as queryError, r as ioError, u as unsupportedError, v as andThen, w as isErr, x as flatMap, y as collect, z as unwrapErr } from "./errors-
|
|
3
|
-
import { n as HASH_CODE_MAX, r as RAD2DEG, t as DEG2RAD } from "./constants-
|
|
4
|
-
import { n as toVec2, r as toVec3, t as resolveDirection } from "./types
|
|
5
|
-
import { a as vecDot, c as vecLength, d as vecNormalize, f as vecProjectToPlane, g as vecSub, h as vecScale, i as vecDistance, l as vecLengthSq, m as vecRotate, n as vecAngle, o as vecEquals, p as vecRepr, r as vecCross, s as vecIsZero, t as vecAdd, u as vecNegate } from "./vecOps-
|
|
6
|
-
import { i as pivotPlane, n as createPlane, o as resolvePlane, s as translatePlane, t as createNamedPlane } from "./planeOps-
|
|
1
|
+
import { B as createKernelHandle, C as isOrientedFace, D as manifoldShell, E as isValidSolid, H as isLive, I as is2D, J as withScopeResultAsync, K as withScope, L as is3D, M as getShapeKind, O as orientedFace, R as DisposalScope, S as isManifoldShell, _ as isSolid, b as closedWire, d as isCompound, f as isEdge, g as isShell, h as isShape3D, j as validSolid, m as isShape1D, p as isFace, q as withScopeResult, t as castShape, v as isVertex, x as isClosedWire, y as isWire, z as createHandle } from "./shapeTypes-AyL8vv_O.js";
|
|
2
|
+
import { A as ok, B as unwrapOr, E as map, I as tryCatch, L as tryCatchAsync, O as mapErr, R as unwrap, T as isOk, V as unwrapOrElse, a as moduleInitError, b as err, c as sketcherStateError, d as validationError, g as OK, h as bug, i as kernelError, k as match, l as typeCastError, m as BrepBugError, n as computationError, o as queryError, r as ioError, u as unsupportedError, v as andThen, w as isErr, x as flatMap, y as collect, z as unwrapErr } from "./errors-0fYW_YnO.js";
|
|
3
|
+
import { n as HASH_CODE_MAX, r as RAD2DEG, t as DEG2RAD } from "./constants-Ci5CA3aZ.js";
|
|
4
|
+
import { n as toVec2, r as toVec3, t as resolveDirection } from "./types-BIdk_GJY.js";
|
|
5
|
+
import { a as vecDot, c as vecLength, d as vecNormalize, f as vecProjectToPlane, g as vecSub, h as vecScale, i as vecDistance, l as vecLengthSq, m as vecRotate, n as vecAngle, o as vecEquals, p as vecRepr, r as vecCross, s as vecIsZero, t as vecAdd, u as vecNegate } from "./vecOps-DVROrqTV.js";
|
|
6
|
+
import { i as pivotPlane, n as createPlane, o as resolvePlane, s as translatePlane, t as createNamedPlane } from "./planeOps-4i2qEraD.js";
|
|
7
7
|
export { BrepBugError, DEG2RAD, DisposalScope, HASH_CODE_MAX, OK, RAD2DEG, andThen, bug, castShape, closedWire, collect, computationError, createHandle, createKernelHandle, createNamedPlane, createPlane, err, flatMap, getShapeKind, ioError, is2D, is3D, isClosedWire, isCompound, isEdge, isErr, isFace, isLive, isManifoldShell, isOk, isOrientedFace, isShape1D, isShape3D, isShell, isSolid, isValidSolid, isVertex, isWire, kernelError, manifoldShell, map, mapErr, match, moduleInitError, ok, orientedFace, pivotPlane, queryError, resolveDirection, resolvePlane, sketcherStateError, toVec2, toVec3, translatePlane, tryCatch, tryCatchAsync, typeCastError, unsupportedError, unwrap, unwrapErr, unwrapOr, unwrapOrElse, validSolid, validationError, vecAdd, vecAngle, vecCross, vecDistance, vecDot, vecEquals, vecIsZero, vecLength, vecLengthSq, vecNegate, vecNormalize, vecProjectToPlane, vecRepr, vecRotate, vecScale, vecSub, withScope, withScopeResult, withScopeResultAsync };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_constants = require("./constants-
|
|
2
|
-
const require_arrayAccess = require("./arrayAccess-
|
|
3
|
-
const require_helpers = require("./helpers-
|
|
1
|
+
const require_constants = require("./constants-DTorLmes.cjs");
|
|
2
|
+
const require_arrayAccess = require("./arrayAccess-Br-m2PP7.cjs");
|
|
3
|
+
const require_helpers = require("./helpers-C3smxDtp.cjs");
|
|
4
4
|
//#region src/query/cornerFinder.ts
|
|
5
5
|
var PI_2 = 2 * Math.PI;
|
|
6
6
|
function positiveHalfAngle(angle) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as DEG2RAD } from "./constants-
|
|
2
|
-
import { n as getAtOrThrow } from "./arrayAccess-
|
|
3
|
-
import { _ as samePoint, p as distance2d, u as angle2d } from "./helpers-
|
|
1
|
+
import { t as DEG2RAD } from "./constants-Ci5CA3aZ.js";
|
|
2
|
+
import { n as getAtOrThrow } from "./arrayAccess-2G0pRoaC.js";
|
|
3
|
+
import { _ as samePoint, p as distance2d, u as angle2d } from "./helpers-DL1f3xp0.js";
|
|
4
4
|
//#region src/query/cornerFinder.ts
|
|
5
5
|
var PI_2 = 2 * Math.PI;
|
|
6
6
|
function positiveHalfAngle(angle) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-8vB31RfA.cjs");
|
|
2
|
+
const require_errors = require("./errors-Dv6pfNct.cjs");
|
|
3
3
|
//#region src/topology/curveFns.ts
|
|
4
4
|
/**
|
|
5
5
|
* Curve and 1D shape functions — functional replacements for _1DShape/Curve methods.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { X as getKernel, f as isEdge, t as castShape, y as isWire } from "./shapeTypes-
|
|
2
|
-
import { A as ok, b as err, l as typeCastError } from "./errors-
|
|
1
|
+
import { X as getKernel, f as isEdge, t as castShape, y as isWire } from "./shapeTypes-AyL8vv_O.js";
|
|
2
|
+
import { A as ok, b as err, l as typeCastError } from "./errors-0fYW_YnO.js";
|
|
3
3
|
//#region src/topology/curveFns.ts
|
|
4
4
|
/**
|
|
5
5
|
* Curve and 1D shape functions — functional replacements for _1DShape/Curve methods.
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { R as DisposalScope, X as getKernel, Y as _usingCtx, o as createFace, p as isFace, t as castShape, u as createWire } from "./shapeTypes-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { _ as
|
|
13
|
-
import { _ as
|
|
14
|
-
import { o as
|
|
15
|
-
import { t as
|
|
16
|
-
import {
|
|
1
|
+
import { R as DisposalScope, X as getKernel, Y as _usingCtx, o as createFace, p as isFace, t as castShape, u as createWire } from "./shapeTypes-AyL8vv_O.js";
|
|
2
|
+
import { n as wasmIndex } from "./vec3-BRj3eI54.js";
|
|
3
|
+
import { A as ok, R as unwrap, T as isOk, b as err, d as validationError, h as bug, r as ioError, s as safeIndex, t as BrepErrorCode } from "./errors-0fYW_YnO.js";
|
|
4
|
+
import { M as cast, N as downcast, b as getEdges, c as normalAt, l as outerWire, n as faceCenter } from "./faceFns-acz86gqR.js";
|
|
5
|
+
import { t as DEG2RAD } from "./constants-Ci5CA3aZ.js";
|
|
6
|
+
import { r as toVec3 } from "./types-BIdk_GJY.js";
|
|
7
|
+
import { c as vecLength, d as vecNormalize, g as vecSub, h as vecScale, m as vecRotate, r as vecCross } from "./vecOps-DVROrqTV.js";
|
|
8
|
+
import { a as planeToWorld, o as resolvePlane } from "./planeOps-4i2qEraD.js";
|
|
9
|
+
import { m as offsetWire2D } from "./curveFns-DZYE3BGO.js";
|
|
10
|
+
import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-2G0pRoaC.js";
|
|
11
|
+
import { c as makeBSplineApproximation, d as makeEllipse, p as makeHelix, r as makeFace, s as assembleWire, t as addHolesInFace, u as makeCircle } from "./surfaceBuilders-Con0IpLf.js";
|
|
12
|
+
import { S as Flatbush, _ as Blueprints, b as make2dOffset, c as roundedRectangleBlueprint, f as Sketch, g as CompoundBlueprint, h as organiseBlueprints, l as BaseSketcher2d, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D, u as BlueprintSketcher, v as chamferCurves, x as intersectCurves, y as filletCurves } from "./boolean2D-A5u9tJYl.js";
|
|
13
|
+
import { _ as samePoint$1, b as subtract2d, c as PRECISION_OFFSET, l as add2d, y as squareDistance2d } from "./helpers-DL1f3xp0.js";
|
|
14
|
+
import { _ as Curve2D, a as edgeToCurve, c as make2dCircle, d as make2dInerpolatedBSplineCurve, f as make2dSegmentCurve, g as approximateAsSvgCompatibleCurve, i as curvesAsEdgesOnPlane, l as make2dEllipse, o as make2dArcFromCenter, t as Blueprint, v as deserializeCurve2D, y as BoundingBox2d } from "./blueprint-CBairprN.js";
|
|
15
|
+
import { o as makeSolid, t as makeCompound } from "./solidBuilders-C7Xp_ikW.js";
|
|
16
|
+
import { t as cornerFinder } from "./cornerFinder-DGvOt2ab.js";
|
|
17
|
+
import { i as complexExtrude, l as twistExtrude, r as revolve, t as extrude } from "./extrudeFns-O2s-SFf-.js";
|
|
17
18
|
import opentype from "opentype.js";
|
|
18
19
|
//#region src/2d/lib/stitching.ts
|
|
19
20
|
/**
|
|
@@ -45,11 +46,11 @@ var stitchCurves = (curves, precision = 1e-7) => {
|
|
|
45
46
|
let maxLoops = curves.length;
|
|
46
47
|
while (true) {
|
|
47
48
|
if (maxLoops-- < 0) bug("stitchCurves", "Infinite loop detected");
|
|
48
|
-
const [x, y] = connectedCurves
|
|
49
|
+
const [x, y] = wasmIndex(connectedCurves, connectedCurves.length - 1).lastPoint;
|
|
49
50
|
const neighbors = startPoints.search(x - precision, y - precision, x + precision, y + precision);
|
|
50
51
|
const indexDistance = (otherIndex) => Math.abs((currentIndex - otherIndex) % curves.length);
|
|
51
52
|
const potentialNextCurves = neighbors.filter((neighborIndex) => !visited.has(neighborIndex)).map((neighborIndex) => [
|
|
52
|
-
curves
|
|
53
|
+
wasmIndex(curves, neighborIndex),
|
|
53
54
|
neighborIndex,
|
|
54
55
|
indexDistance(neighborIndex)
|
|
55
56
|
]).sort(([, , a], [, , b]) => a - b);
|
|
@@ -57,7 +58,7 @@ var stitchCurves = (curves, precision = 1e-7) => {
|
|
|
57
58
|
stitchedCurves.push(connectedCurves);
|
|
58
59
|
break;
|
|
59
60
|
}
|
|
60
|
-
const [nextCurve, nextCurveIndex] = potentialNextCurves
|
|
61
|
+
const [nextCurve, nextCurveIndex] = wasmIndex(potentialNextCurves, 0);
|
|
61
62
|
connectedCurves.push(nextCurve);
|
|
62
63
|
visited.add(nextCurveIndex);
|
|
63
64
|
currentIndex = nextCurveIndex;
|
|
@@ -778,7 +779,7 @@ function offsetBlueprint(blueprint, offset, offsetConfig = {}) {
|
|
|
778
779
|
const prunedCurves = splitCurves.filter((curve) => {
|
|
779
780
|
const [[xMin, yMin], [xMax, yMax]] = curve.boundingBox.bounds;
|
|
780
781
|
return !originalIndex.search(xMin - absOffset, yMin - absOffset, xMax + absOffset, yMax + absOffset).some((idx) => {
|
|
781
|
-
return blueprint.curves
|
|
782
|
+
return wasmIndex(blueprint.curves, idx).distanceFrom(curve) < absOffset - PRECISION_OFFSET;
|
|
782
783
|
});
|
|
783
784
|
});
|
|
784
785
|
if (!prunedCurves.length) return null;
|
|
@@ -29,22 +29,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
enumerable: true
|
|
30
30
|
}) : target, mod));
|
|
31
31
|
//#endregion
|
|
32
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
32
|
+
const require_shapeTypes = require("./shapeTypes-8vB31RfA.cjs");
|
|
33
|
+
const require_vec3 = require("./vec3-S4Oh59IX.cjs");
|
|
34
|
+
const require_errors = require("./errors-Dv6pfNct.cjs");
|
|
35
|
+
const require_faceFns = require("./faceFns-B1H43mZ_.cjs");
|
|
36
|
+
const require_constants = require("./constants-DTorLmes.cjs");
|
|
37
|
+
const require_types = require("./types-CDkxah-M.cjs");
|
|
38
|
+
const require_vecOps = require("./vecOps-D7xplSx8.cjs");
|
|
39
|
+
const require_planeOps = require("./planeOps-CH4ruLuj.cjs");
|
|
40
|
+
const require_curveFns = require("./curveFns-B8KJKr8-.cjs");
|
|
41
|
+
const require_arrayAccess = require("./arrayAccess-Br-m2PP7.cjs");
|
|
42
|
+
const require_surfaceBuilders = require("./surfaceBuilders-BEnsewN9.cjs");
|
|
43
|
+
const require_boolean2D = require("./boolean2D-DxZ3Kwlq.cjs");
|
|
44
|
+
const require_helpers = require("./helpers-C3smxDtp.cjs");
|
|
45
|
+
const require_blueprint = require("./blueprint-C5LxqHCa.cjs");
|
|
46
|
+
const require_solidBuilders = require("./solidBuilders-Djwgx2mj.cjs");
|
|
47
|
+
const require_cornerFinder = require("./cornerFinder-B2CpcVV9.cjs");
|
|
48
|
+
const require_extrudeFns = require("./extrudeFns-BlJKAnW8.cjs");
|
|
48
49
|
let opentype_js = require("opentype.js");
|
|
49
50
|
opentype_js = __toESM(opentype_js, 1);
|
|
50
51
|
//#region src/2d/lib/stitching.ts
|
|
@@ -77,11 +78,11 @@ var stitchCurves = (curves, precision = 1e-7) => {
|
|
|
77
78
|
let maxLoops = curves.length;
|
|
78
79
|
while (true) {
|
|
79
80
|
if (maxLoops-- < 0) require_errors.bug("stitchCurves", "Infinite loop detected");
|
|
80
|
-
const [x, y] = connectedCurves
|
|
81
|
+
const [x, y] = require_vec3.wasmIndex(connectedCurves, connectedCurves.length - 1).lastPoint;
|
|
81
82
|
const neighbors = startPoints.search(x - precision, y - precision, x + precision, y + precision);
|
|
82
83
|
const indexDistance = (otherIndex) => Math.abs((currentIndex - otherIndex) % curves.length);
|
|
83
84
|
const potentialNextCurves = neighbors.filter((neighborIndex) => !visited.has(neighborIndex)).map((neighborIndex) => [
|
|
84
|
-
curves
|
|
85
|
+
require_vec3.wasmIndex(curves, neighborIndex),
|
|
85
86
|
neighborIndex,
|
|
86
87
|
indexDistance(neighborIndex)
|
|
87
88
|
]).sort(([, , a], [, , b]) => a - b);
|
|
@@ -89,7 +90,7 @@ var stitchCurves = (curves, precision = 1e-7) => {
|
|
|
89
90
|
stitchedCurves.push(connectedCurves);
|
|
90
91
|
break;
|
|
91
92
|
}
|
|
92
|
-
const [nextCurve, nextCurveIndex] = potentialNextCurves
|
|
93
|
+
const [nextCurve, nextCurveIndex] = require_vec3.wasmIndex(potentialNextCurves, 0);
|
|
93
94
|
connectedCurves.push(nextCurve);
|
|
94
95
|
visited.add(nextCurveIndex);
|
|
95
96
|
currentIndex = nextCurveIndex;
|
|
@@ -810,7 +811,7 @@ function offsetBlueprint(blueprint, offset, offsetConfig = {}) {
|
|
|
810
811
|
const prunedCurves = splitCurves.filter((curve) => {
|
|
811
812
|
const [[xMin, yMin], [xMax, yMax]] = curve.boundingBox.bounds;
|
|
812
813
|
return !originalIndex.search(xMin - absOffset, yMin - absOffset, xMax + absOffset, yMax + absOffset).some((idx) => {
|
|
813
|
-
return blueprint.curves
|
|
814
|
+
return require_vec3.wasmIndex(blueprint.curves, idx).distanceFrom(curve) < absOffset - require_helpers.PRECISION_OFFSET;
|
|
814
815
|
});
|
|
815
816
|
});
|
|
816
817
|
if (!prunedCurves.length) return null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as wasmIndex } from "./vec3-BRj3eI54.js";
|
|
1
2
|
//#region src/core/result.ts
|
|
2
3
|
function ok(value) {
|
|
3
4
|
return {
|
|
@@ -481,7 +482,7 @@ function unsupportedError(code, message, cause, metadata, suggestion) {
|
|
|
481
482
|
*/
|
|
482
483
|
function safeIndex(arr, index, context) {
|
|
483
484
|
if (index < 0 || index >= arr.length) bug(context ?? "safeIndex", `Index ${index} is out of bounds (array length ${arr.length})`);
|
|
484
|
-
return arr
|
|
485
|
+
return wasmIndex(arr, index);
|
|
485
486
|
}
|
|
486
487
|
//#endregion
|
|
487
488
|
export { ok as A, unwrapOr as B, fromNullable as C, mapBoth as D, map as E, tapErr as F, zip as H, tryCatch as I, tryCatchAsync as L, orElse as M, pipeline as N, mapErr as O, tap as P, unwrap as R, flatten as S, isOk as T, unwrapOrElse as V, all as _, moduleInitError as a, err as b, sketcherStateError as c, validationError as d, getSuggestionForCode as f, OK as g, bug as h, kernelError as i, or as j, match as k, typeCastError as l, BrepBugError as m, computationError as n, queryError as o, translateKernelError as p, ioError as r, safeIndex as s, BrepErrorCode as t, unsupportedError as u, andThen as v, isErr as w, flatMap as x, collect as y, unwrapErr as z };
|