brepjs 18.118.19 → 18.118.21
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.cjs +7 -7
- package/dist/2d.js +7 -7
- package/dist/{adjacencyFns-CA3Etyxq.js → adjacencyFns-Dgsl8VJ2.js} +27 -2
- package/dist/{adjacencyFns-Ds3HCvKX.cjs → adjacencyFns-h7eAxaRD.cjs} +27 -2
- package/dist/{blueprint-0DxFJgG3.js → blueprint-CwQmYoR4.js} +8 -8
- package/dist/{blueprint-BbWSvB5F.cjs → blueprint-DG-2uqNB.cjs} +19 -19
- package/dist/{blueprintFns-BaUv-Wlq.cjs → blueprintFns-FAuYTbQQ.cjs} +3 -3
- package/dist/{blueprintFns-cG_DFd8M.js → blueprintFns-aCrK18ZR.js} +3 -3
- package/dist/{blueprintSketcher-Cgz3qJx2.js → blueprintSketcher-VvIRL3M8.js} +5 -5
- package/dist/{blueprintSketcher-DKbyT3MJ.cjs → blueprintSketcher-k5dNnvzs.cjs} +21 -21
- package/dist/{boolean2D-B1WZsDzl.cjs → boolean2D-BmkwzUgt.cjs} +17 -17
- package/dist/{boolean2D-BgAUsrkF.js → boolean2D-qYYFeLWX.js} +6 -6
- package/dist/brepjs.cjs +35 -35
- package/dist/brepjs.js +29 -29
- package/dist/bug-BdOHwn_e.js +47 -0
- package/dist/{vec3-CFwOI0ZI.cjs → bug-O02CsAmt.cjs} +34 -0
- package/dist/{cameraFns-DIPrieGu.cjs → cameraFns-BZMHFbh9.cjs} +4 -4
- package/dist/{cameraFns-DdyBVRGK.js → cameraFns-CYU4C4N6.js} +4 -4
- package/dist/core.cjs +6 -5
- package/dist/core.js +4 -3
- package/dist/{cornerFinder-DxAdJ27L.cjs → cornerFinder-BEiSjmuO.cjs} +1 -1
- package/dist/{cornerFinder-Bz4GBpuu.js → cornerFinder-DhOm0L8g.js} +1 -1
- package/dist/{curveFns-Lkb1QlRl.js → curveFns-SNQ04JW6.js} +2 -2
- package/dist/{curveFns-_f5x9L6D.cjs → curveFns-YN8_CsqU.cjs} +2 -2
- package/dist/{drawFns-DrrUmioW.js → drawFns-8zxP0gC5.js} +15 -15
- package/dist/{drawFns-BL6RRjT0.cjs → drawFns-Dqsv_t37.cjs} +34 -34
- package/dist/{errors-DNWJsfVU.js → errors-B3CDG537.js} +2 -24
- package/dist/{errors-CXJtc4I7.cjs → errors-CJU8CHng.cjs} +3 -37
- package/dist/{faceFns-BapYNAxj.cjs → faceFns-C0SwZInk.cjs} +3 -3
- package/dist/{faceFns-CgTNP9kU.js → faceFns-CCu9ULQm.js} +3 -3
- package/dist/{healingFns-8zD9gHRr.cjs → healingFns-Bbl5KTIh.cjs} +6 -6
- package/dist/{healingFns-Bp8ixSdr.js → healingFns-D6Bizorp.js} +6 -6
- package/dist/{helpers-DGAx5Y2e.js → helpers-By-BruMN.js} +8 -7
- package/dist/{helpers-DARRNSnZ.cjs → helpers-Cv-lOGsc.cjs} +9 -8
- package/dist/{importFns-B8VrggoW.cjs → importFns-6eFs1L_G.cjs} +10 -10
- package/dist/{importFns-D8kNKBaP.js → importFns-Bcza0b4Y.js} +4 -4
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +5 -2
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/kernel/occtWasm/occtWasmTypes.d.ts +4 -0
- package/dist/kernel/unsupported.d.ts +14 -0
- package/dist/{loftFns-DTJrpzK7.cjs → loftFns-Bbe5jRA-.cjs} +2 -2
- package/dist/{loftFns-CSdcxPhe.js → loftFns-DEReccFa.js} +2 -2
- package/dist/{measureFns-Pv782Tb2.js → measureFns-DHj5Z-5c.js} +4 -4
- package/dist/{measureFns-DBBUqf_V.cjs → measureFns-DMzw5wf0.cjs} +4 -4
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-CP_Gg9j9.cjs → meshFns-B9pPcwuD.cjs} +4 -4
- package/dist/{meshFns-CYFz0R29.js → meshFns-C2nLgSf2.js} +4 -4
- package/dist/{occtWasmAdapter-BgmRCYeD.js → occtWasmAdapter-5_6aHhcD.js} +43 -9
- package/dist/{occtWasmAdapter-CWX5KCl8.cjs → occtWasmAdapter-CIxwUim8.cjs} +56 -10
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{planeOps-DSjjtrjg.js → planeOps-Cp6GQ23-.js} +1 -1
- package/dist/{planeOps-BA4HfgQu.cjs → planeOps-Cr25KWWA.cjs} +1 -1
- package/dist/{primitiveFns-cAodLWtw.js → primitiveFns-D2zyQa3w.js} +5 -5
- package/dist/{primitiveFns-BhfCCIWH.cjs → primitiveFns-DZXN7qDb.cjs} +5 -5
- package/dist/projection.cjs +1 -1
- package/dist/projection.js +1 -1
- package/dist/query.cjs +2 -2
- package/dist/query.js +2 -2
- package/dist/{refResolveFns-BF9Ag5ch.cjs → refResolveFns-CHm7tsm2.cjs} +6 -6
- package/dist/{refResolveFns-B7ixHjFn.js → refResolveFns-C_mHlM8R.js} +6 -6
- package/dist/result.cjs +4 -3
- package/dist/result.js +2 -1
- package/dist/{shapeFns-ey7LN7Bu.js → shapeFns-BakfS4c9.js} +3 -3
- package/dist/{shapeFns-DGEpliyN.cjs → shapeFns-DzXcfZHY.cjs} +3 -3
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-B1YVA0wM.js → shapeTypes-B5bBKbg9.js} +9 -9
- package/dist/{shapeTypes-DXLJEolb.cjs → shapeTypes-BfOb9vzc.cjs} +183 -183
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-CbdRC65U.cjs → solidBuilders-BgrXN-GP.cjs} +7 -7
- package/dist/{solidBuilders-Dzd09AEk.js → solidBuilders-DaTgm_Wj.js} +7 -7
- package/dist/{surfaceBuilders-DISUSNgU.js → surfaceBuilders-BdUP_OXk.js} +3 -3
- package/dist/{surfaceBuilders-M_S5pGJi.cjs → surfaceBuilders-CUNhA_3a.cjs} +3 -3
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-BNR8zfrZ.cjs → textBlueprints--5GSuYEm.cjs} +19 -18
- package/dist/{textBlueprints-BlN1vCZ2.js → textBlueprints-C_JaAGiG.js} +10 -9
- package/dist/{textMetrics-BcgFzxJW.js → textMetrics-829YpBdN.js} +2 -2
- package/dist/{textMetrics-kUZVQtvY.cjs → textMetrics-CyJlakdR.cjs} +2 -2
- package/dist/{threadFns-VuImNUwV.cjs → threadFns-BBELmTZv.cjs} +8 -8
- package/dist/{threadFns-CU9bwc38.js → threadFns-H0mRmS6I.js} +8 -8
- package/dist/topology/adjacencyFns.d.ts +4 -0
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-DQmiyVS8.js → topologyQueryFns-MAUFbsSp.js} +2 -2
- package/dist/{topologyQueryFns-WesEKd3r.cjs → topologyQueryFns-tns6VXoD.cjs} +2 -2
- package/dist/vectors.cjs +1 -1
- package/dist/vectors.js +1 -1
- package/package.json +1 -1
- package/dist/vec3-Dpha8d5k.js +0 -25
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const require_textBlueprints = require("./textBlueprints
|
|
2
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
3
|
-
const
|
|
4
|
-
const require_errors = require("./errors-
|
|
5
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_textBlueprints = require("./textBlueprints--5GSuYEm.cjs");
|
|
2
|
+
const require_shapeTypes = require("./shapeTypes-BfOb9vzc.cjs");
|
|
3
|
+
const require_bug = require("./bug-O02CsAmt.cjs");
|
|
4
|
+
const require_errors = require("./errors-CJU8CHng.cjs");
|
|
5
|
+
const require_topologyQueryFns = require("./topologyQueryFns-tns6VXoD.cjs");
|
|
6
6
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
7
7
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
8
8
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
9
|
-
const require_planeOps = require("./planeOps-
|
|
10
|
-
const require_faceFns = require("./faceFns-
|
|
11
|
-
const require_curveFns = require("./curveFns-
|
|
9
|
+
const require_planeOps = require("./planeOps-Cr25KWWA.cjs");
|
|
10
|
+
const require_faceFns = require("./faceFns-C0SwZInk.cjs");
|
|
11
|
+
const require_curveFns = require("./curveFns-YN8_CsqU.cjs");
|
|
12
12
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
13
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
14
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
15
|
-
const require_helpers = require("./helpers-
|
|
16
|
-
const require_blueprint = require("./blueprint-
|
|
17
|
-
const require_cornerFinder = require("./cornerFinder-
|
|
18
|
-
const require_boolean2D = require("./boolean2D-
|
|
19
|
-
const require_cameraFns = require("./cameraFns-
|
|
13
|
+
const require_surfaceBuilders = require("./surfaceBuilders-CUNhA_3a.cjs");
|
|
14
|
+
const require_blueprintSketcher = require("./blueprintSketcher-k5dNnvzs.cjs");
|
|
15
|
+
const require_helpers = require("./helpers-Cv-lOGsc.cjs");
|
|
16
|
+
const require_blueprint = require("./blueprint-DG-2uqNB.cjs");
|
|
17
|
+
const require_cornerFinder = require("./cornerFinder-BEiSjmuO.cjs");
|
|
18
|
+
const require_boolean2D = require("./boolean2D-BmkwzUgt.cjs");
|
|
19
|
+
const require_cameraFns = require("./cameraFns-BZMHFbh9.cjs");
|
|
20
20
|
//#region src/2d/lib/stitching.ts
|
|
21
21
|
/**
|
|
22
22
|
* Group a flat list of curves into connected chains by matching endpoints.
|
|
@@ -47,12 +47,12 @@ var stitchCurves = (curves, precision = 1e-7) => {
|
|
|
47
47
|
visited.add(index);
|
|
48
48
|
let maxLoops = curves.length;
|
|
49
49
|
while (true) {
|
|
50
|
-
if (maxLoops-- < 0)
|
|
51
|
-
const [x, y] =
|
|
50
|
+
if (maxLoops-- < 0) require_bug.bug("stitchCurves", "Infinite loop detected");
|
|
51
|
+
const [x, y] = require_bug.wasmIndex(connectedCurves, connectedCurves.length - 1).lastPoint;
|
|
52
52
|
const neighbors = startPoints.search(x - precision, y - precision, x + precision, y + precision);
|
|
53
53
|
const indexDistance = (otherIndex) => Math.abs((currentIndex - otherIndex) % curves.length);
|
|
54
54
|
const potentialNextCurves = neighbors.filter((neighborIndex) => !visited.has(neighborIndex)).map((neighborIndex) => [
|
|
55
|
-
|
|
55
|
+
require_bug.wasmIndex(curves, neighborIndex),
|
|
56
56
|
neighborIndex,
|
|
57
57
|
indexDistance(neighborIndex)
|
|
58
58
|
]).sort(([, , a], [, , b]) => a - b);
|
|
@@ -60,7 +60,7 @@ var stitchCurves = (curves, precision = 1e-7) => {
|
|
|
60
60
|
stitchedCurves.push(connectedCurves);
|
|
61
61
|
break;
|
|
62
62
|
}
|
|
63
|
-
const [nextCurve, nextCurveIndex] =
|
|
63
|
+
const [nextCurve, nextCurveIndex] = require_bug.wasmIndex(potentialNextCurves, 0);
|
|
64
64
|
connectedCurves.push(nextCurve);
|
|
65
65
|
visited.add(nextCurveIndex);
|
|
66
66
|
currentIndex = nextCurveIndex;
|
|
@@ -114,7 +114,7 @@ var Sketcher = class extends require_blueprintSketcher.BaseSketcher2d {
|
|
|
114
114
|
buildWire() {
|
|
115
115
|
try {
|
|
116
116
|
var _usingCtx$4 = require_shapeTypes._usingCtx();
|
|
117
|
-
if (!this.pendingCurves.length)
|
|
117
|
+
if (!this.pendingCurves.length) require_bug.bug("Sketcher.buildWire", "No lines to convert into a wire");
|
|
118
118
|
const scope = _usingCtx$4.u(new require_shapeTypes.DisposalScope());
|
|
119
119
|
return require_errors.unwrap(require_surfaceBuilders.assembleWire(require_blueprint.curvesAsEdgesOnPlane(this.pendingCurves, this.plane).map((e) => scope.register(e))));
|
|
120
120
|
} catch (_) {
|
|
@@ -142,7 +142,7 @@ var Sketcher = class extends require_blueprintSketcher.BaseSketcher2d {
|
|
|
142
142
|
* matching across kernels.
|
|
143
143
|
*/
|
|
144
144
|
closeWithMirror() {
|
|
145
|
-
if (require_helpers.samePoint(this.pointer, this.firstPoint))
|
|
145
|
+
if (require_helpers.samePoint(this.pointer, this.firstPoint)) require_bug.bug("Sketcher.closeWithMirror", "Cannot close with a mirror when the sketch is already closed");
|
|
146
146
|
const wire = this.buildWire();
|
|
147
147
|
const pointer3d = require_planeOps.planeToWorld(this.plane, this.pointer);
|
|
148
148
|
const normal = require_vecOps.vecCross(require_vecOps.vecNormalize(require_vecOps.vecSub(pointer3d, require_planeOps.planeToWorld(this.plane, this.firstPoint))), this.plane.zDir);
|
|
@@ -579,7 +579,7 @@ function splitAtIntersection(previousCurve, curve, intersections) {
|
|
|
579
579
|
const intersection = intersections.length === 1 ? require_errors.safeIndex(intersections, 0, "rawOffsets") : selectClosestIntersection(intersections, previousCurve.original.lastPoint);
|
|
580
580
|
const splitPreviousCurve = require_errors.safeIndex(previousCurve.offset.splitAt([intersection], require_helpers.PRECISION_OFFSET), 0, "rawOffsets");
|
|
581
581
|
const splitCurve = curve.offset.splitAt([intersection], require_helpers.PRECISION_OFFSET).at(-1);
|
|
582
|
-
if (!splitCurve)
|
|
582
|
+
if (!splitCurve) require_bug.bug("offset.rawOffsets", "Split produced no trailing curve segment");
|
|
583
583
|
return {
|
|
584
584
|
splitPrevious: {
|
|
585
585
|
offset: splitPreviousCurve,
|
|
@@ -678,7 +678,7 @@ function rawOffsets(blueprint, offset, offsetConfig = {}) {
|
|
|
678
678
|
}
|
|
679
679
|
const iterateOffsetCurves = function* () {
|
|
680
680
|
for (const curve of offsetCurves.slice(0, -1)) yield curve;
|
|
681
|
-
if (!savedLastCurve)
|
|
681
|
+
if (!savedLastCurve) require_bug.bug("offset.rawOffsets", "No saved curve after iterating offset segments");
|
|
682
682
|
yield savedLastCurve;
|
|
683
683
|
};
|
|
684
684
|
for (const curve of iterateOffsetCurves()) {
|
|
@@ -746,7 +746,7 @@ function offsetBlueprint(blueprint, offset, offsetConfig = {}) {
|
|
|
746
746
|
const prunedCurves = splitCurves.filter((curve) => {
|
|
747
747
|
const [[xMin, yMin], [xMax, yMax]] = curve.boundingBox.bounds;
|
|
748
748
|
return !originalIndex.search(xMin - absOffset, yMin - absOffset, xMax + absOffset, yMax + absOffset).some((idx) => {
|
|
749
|
-
return
|
|
749
|
+
return require_bug.wasmIndex(blueprint.curves, idx).distanceFrom(curve) < absOffset - require_helpers.PRECISION_OFFSET;
|
|
750
750
|
});
|
|
751
751
|
});
|
|
752
752
|
if (!prunedCurves.length) return null;
|
|
@@ -821,15 +821,15 @@ function modifyCorners(makeCorner, blueprint, radius, finder) {
|
|
|
821
821
|
};
|
|
822
822
|
blueprint.curves.slice(1).forEach((secondCurve) => {
|
|
823
823
|
const firstCurve = curves.pop();
|
|
824
|
-
if (!firstCurve)
|
|
824
|
+
if (!firstCurve) require_bug.bug("customCorners.modifyCorners", "Unexpected empty curve stack during filleting");
|
|
825
825
|
addModifiedCorner(firstCurve, secondCurve);
|
|
826
826
|
});
|
|
827
827
|
const lastCurve = curves.at(-1);
|
|
828
|
-
if (!lastCurve)
|
|
828
|
+
if (!lastCurve) require_bug.bug("customCorners.modifyCorners", "Unexpected empty curve list during corner modification");
|
|
829
829
|
if (require_helpers.samePoint(require_arrayAccess.firstOrThrow(curves).firstPoint, lastCurve.lastPoint) && curves.length > 1) {
|
|
830
830
|
const firstCurve = curves.pop();
|
|
831
831
|
const secondCurve = curves.shift();
|
|
832
|
-
if (!firstCurve || !secondCurve)
|
|
832
|
+
if (!firstCurve || !secondCurve) require_bug.bug("customCorners.modifyCorners", "Unexpected empty curve stack during close-and-fillet");
|
|
833
833
|
addModifiedCorner(firstCurve, secondCurve);
|
|
834
834
|
}
|
|
835
835
|
return new require_blueprint.Blueprint(curves);
|
|
@@ -925,7 +925,7 @@ var Drawing = class Drawing {
|
|
|
925
925
|
type: "Blueprint",
|
|
926
926
|
curves: shape.curves.map((c) => c.serialize())
|
|
927
927
|
};
|
|
928
|
-
else
|
|
928
|
+
else require_bug.bug("Drawing.serialize", "Unknown shape type for serialization");
|
|
929
929
|
}
|
|
930
930
|
return JSON.stringify(serializeHelper(this.innerShape));
|
|
931
931
|
}
|
|
@@ -1008,13 +1008,13 @@ var Drawing = class Drawing {
|
|
|
1008
1008
|
return new Drawing(chamfer2D(this.innerShape, radius, finder));
|
|
1009
1009
|
}
|
|
1010
1010
|
sketchOnPlane(inputPlane, origin) {
|
|
1011
|
-
if (!this.innerShape)
|
|
1011
|
+
if (!this.innerShape) require_bug.bug("Drawing", "Trying to sketch an empty drawing");
|
|
1012
1012
|
const result = this.innerShape.sketchOnPlane(inputPlane, origin);
|
|
1013
1013
|
return wrapBlueprintResult(this.innerShape, result);
|
|
1014
1014
|
}
|
|
1015
1015
|
/** Project this drawing onto a 3D face surface with the given scale mode. */
|
|
1016
1016
|
sketchOnFace(face, scaleMode) {
|
|
1017
|
-
if (!this.innerShape)
|
|
1017
|
+
if (!this.innerShape) require_bug.bug("Drawing", "Trying to sketch an empty drawing");
|
|
1018
1018
|
const result = this.innerShape.sketchOnFace(face, scaleMode);
|
|
1019
1019
|
return wrapBlueprintResult(this.innerShape, result);
|
|
1020
1020
|
}
|
|
@@ -1041,14 +1041,14 @@ var Drawing = class Drawing {
|
|
|
1041
1041
|
}
|
|
1042
1042
|
/** Approximate the drawing curves for a target format (currently only `'svg'`). */
|
|
1043
1043
|
approximate(target, options = {}) {
|
|
1044
|
-
if (target !== "svg")
|
|
1044
|
+
if (target !== "svg") require_bug.bug("Drawing.approximate", "Only 'svg' is supported for now");
|
|
1045
1045
|
return new Drawing(approximateForSVG(this.innerShape, options));
|
|
1046
1046
|
}
|
|
1047
1047
|
/** Access the underlying {@link Blueprint}, throwing if the drawing is compound. */
|
|
1048
1048
|
get blueprint() {
|
|
1049
1049
|
if (!(this.innerShape instanceof require_blueprint.Blueprint)) {
|
|
1050
1050
|
if (this.innerShape instanceof require_blueprintSketcher.Blueprints && this.innerShape.blueprints.length === 1 && this.innerShape.blueprints[0] instanceof require_blueprint.Blueprint) return this.innerShape.blueprints[0];
|
|
1051
|
-
|
|
1051
|
+
require_bug.bug("Drawing.blueprint", "This drawing is not a blueprint");
|
|
1052
1052
|
}
|
|
1053
1053
|
return this.innerShape;
|
|
1054
1054
|
}
|
|
@@ -1062,7 +1062,7 @@ function deserializeDrawing(data) {
|
|
|
1062
1062
|
if (json["type"] === "CompoundBlueprint") return new require_blueprintSketcher.CompoundBlueprint(json["blueprints"].map(deserializeHelper));
|
|
1063
1063
|
else if (json["type"] === "Blueprints") return new require_blueprintSketcher.Blueprints(json["blueprints"].map(deserializeHelper));
|
|
1064
1064
|
else if (json["type"] === "Blueprint") return new require_blueprint.Blueprint(json["curves"].map((c) => require_blueprint.deserializeCurve2D(c)));
|
|
1065
|
-
else
|
|
1065
|
+
else require_bug.bug("Drawing.deserialize", "Unknown shape type for deserialization");
|
|
1066
1066
|
}
|
|
1067
1067
|
return new Drawing(deserializeHelper(JSON.parse(data)));
|
|
1068
1068
|
}
|
|
@@ -1208,7 +1208,7 @@ function drawText(text, { startX = 0, startY = 0, fontSize = 16, fontFamily = "d
|
|
|
1208
1208
|
* @category Drawing
|
|
1209
1209
|
*/
|
|
1210
1210
|
var drawPointsInterpolation = (points, approximationConfig = {}, options = {}) => {
|
|
1211
|
-
if (points.length < 2)
|
|
1211
|
+
if (points.length < 2) require_bug.bug("drawPointsInterpolation", `Need at least 2 points for interpolation, got ${points.length}`);
|
|
1212
1212
|
const curves = [require_errors.unwrap(require_blueprint.make2dInerpolatedBSplineCurve(points, approximationConfig))];
|
|
1213
1213
|
const firstPoint = points[0];
|
|
1214
1214
|
const lastPoint = points[points.length - 1];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as wasmIndex, n as bug } from "./bug-BdOHwn_e.js";
|
|
2
2
|
//#region src/core/result.ts
|
|
3
3
|
function ok(value) {
|
|
4
4
|
return {
|
|
@@ -165,28 +165,6 @@ function pipeline(input) {
|
|
|
165
165
|
return makePipeline(initial);
|
|
166
166
|
}
|
|
167
167
|
//#endregion
|
|
168
|
-
//#region src/utils/bug.ts
|
|
169
|
-
/**
|
|
170
|
-
* Bug / panic helper — these throw and should never be caught in normal code.
|
|
171
|
-
* Lives in utils (Layer 0) so it can be used by all layers including kernel.
|
|
172
|
-
*/
|
|
173
|
-
/** Error thrown for invariant violations / programmer bugs (should never be caught). */
|
|
174
|
-
var BrepBugError = class extends Error {
|
|
175
|
-
location;
|
|
176
|
-
constructor(location, message) {
|
|
177
|
-
super(`Bug in ${location}: ${message}`);
|
|
178
|
-
this.name = "BrepBugError";
|
|
179
|
-
this.location = location;
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
/**
|
|
183
|
-
* Throws a BrepBugError for invariant violations / programmer errors.
|
|
184
|
-
* Equivalent to Rust's panic!() — should never be caught in normal code.
|
|
185
|
-
*/
|
|
186
|
-
function bug(location, message) {
|
|
187
|
-
throw new BrepBugError(location, message);
|
|
188
|
-
}
|
|
189
|
-
//#endregion
|
|
190
168
|
//#region src/core/kernelErrorTranslation.ts
|
|
191
169
|
/**
|
|
192
170
|
* Kernel error translation — maps cryptic kernel messages to user-friendly explanations.
|
|
@@ -490,4 +468,4 @@ function safeIndex(arr, index, context) {
|
|
|
490
468
|
return wasmIndex(arr, index);
|
|
491
469
|
}
|
|
492
470
|
//#endregion
|
|
493
|
-
export {
|
|
471
|
+
export { orElse as A, zip as B, isOk as C, match as D, mapErr as E, tryCatchAsync as F, unwrap as I, unwrapErr as L, tap as M, tapErr as N, ok as O, tryCatch as P, unwrapOr as R, isErr as S, mapBoth as T, collect as _, moduleInitError as a, flatten as b, sketcherStateError as c, validationError as d, getSuggestionForCode as f, andThen as g, all as h, kernelError as i, pipeline as j, or as k, typeCastError as l, OK as m, computationError as n, queryError as o, translateKernelError as p, ioError as r, safeIndex as s, BrepErrorCode as t, unsupportedError as u, err as v, map as w, fromNullable as x, flatMap as y, unwrapOrElse as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_bug = require("./bug-O02CsAmt.cjs");
|
|
2
2
|
//#region src/core/result.ts
|
|
3
3
|
function ok(value) {
|
|
4
4
|
return {
|
|
@@ -165,28 +165,6 @@ function pipeline(input) {
|
|
|
165
165
|
return makePipeline(initial);
|
|
166
166
|
}
|
|
167
167
|
//#endregion
|
|
168
|
-
//#region src/utils/bug.ts
|
|
169
|
-
/**
|
|
170
|
-
* Bug / panic helper — these throw and should never be caught in normal code.
|
|
171
|
-
* Lives in utils (Layer 0) so it can be used by all layers including kernel.
|
|
172
|
-
*/
|
|
173
|
-
/** Error thrown for invariant violations / programmer bugs (should never be caught). */
|
|
174
|
-
var BrepBugError = class extends Error {
|
|
175
|
-
location;
|
|
176
|
-
constructor(location, message) {
|
|
177
|
-
super(`Bug in ${location}: ${message}`);
|
|
178
|
-
this.name = "BrepBugError";
|
|
179
|
-
this.location = location;
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
/**
|
|
183
|
-
* Throws a BrepBugError for invariant violations / programmer errors.
|
|
184
|
-
* Equivalent to Rust's panic!() — should never be caught in normal code.
|
|
185
|
-
*/
|
|
186
|
-
function bug(location, message) {
|
|
187
|
-
throw new BrepBugError(location, message);
|
|
188
|
-
}
|
|
189
|
-
//#endregion
|
|
190
168
|
//#region src/core/kernelErrorTranslation.ts
|
|
191
169
|
/**
|
|
192
170
|
* Kernel error translation — maps cryptic kernel messages to user-friendly explanations.
|
|
@@ -486,16 +464,10 @@ function unsupportedError(code, message, cause, metadata, suggestion) {
|
|
|
486
464
|
* @param context - Optional caller context for the error message (e.g. function name).
|
|
487
465
|
*/
|
|
488
466
|
function safeIndex(arr, index, context) {
|
|
489
|
-
if (index < 0 || index >= arr.length) bug(context ?? "safeIndex", `Index ${index} is out of bounds (array length ${arr.length})`);
|
|
490
|
-
return
|
|
467
|
+
if (index < 0 || index >= arr.length) require_bug.bug(context ?? "safeIndex", `Index ${index} is out of bounds (array length ${arr.length})`);
|
|
468
|
+
return require_bug.wasmIndex(arr, index);
|
|
491
469
|
}
|
|
492
470
|
//#endregion
|
|
493
|
-
Object.defineProperty(exports, "BrepBugError", {
|
|
494
|
-
enumerable: true,
|
|
495
|
-
get: function() {
|
|
496
|
-
return BrepBugError;
|
|
497
|
-
}
|
|
498
|
-
});
|
|
499
471
|
Object.defineProperty(exports, "BrepErrorCode", {
|
|
500
472
|
enumerable: true,
|
|
501
473
|
get: function() {
|
|
@@ -520,12 +492,6 @@ Object.defineProperty(exports, "andThen", {
|
|
|
520
492
|
return andThen;
|
|
521
493
|
}
|
|
522
494
|
});
|
|
523
|
-
Object.defineProperty(exports, "bug", {
|
|
524
|
-
enumerable: true,
|
|
525
|
-
get: function() {
|
|
526
|
-
return bug;
|
|
527
|
-
}
|
|
528
|
-
});
|
|
529
495
|
Object.defineProperty(exports, "collect", {
|
|
530
496
|
enumerable: true,
|
|
531
497
|
get: function() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BfOb9vzc.cjs");
|
|
2
|
+
const require_errors = require("./errors-CJU8CHng.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-tns6VXoD.cjs");
|
|
4
4
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
5
5
|
//#region src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as castShape, rt as getKernel } from "./shapeTypes-
|
|
2
|
-
import {
|
|
3
|
-
import { a as getCachedSurfaceType } from "./topologyQueryFns-
|
|
1
|
+
import { i as castShape, rt as getKernel } from "./shapeTypes-B5bBKbg9.js";
|
|
2
|
+
import { I as unwrap, O as ok, l as typeCastError, v as err } from "./errors-B3CDG537.js";
|
|
3
|
+
import { a as getCachedSurfaceType } from "./topologyQueryFns-MAUFbsSp.js";
|
|
4
4
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
5
5
|
//#region src/topology/cast.ts
|
|
6
6
|
var TOPO_ENUM = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BfOb9vzc.cjs");
|
|
2
|
+
const require_errors = require("./errors-CJU8CHng.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-tns6VXoD.cjs");
|
|
4
4
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
|
-
const require_faceFns = require("./faceFns-
|
|
6
|
-
const require_shapeFns = require("./shapeFns-
|
|
5
|
+
const require_faceFns = require("./faceFns-C0SwZInk.cjs");
|
|
6
|
+
const require_shapeFns = require("./shapeFns-DzXcfZHY.cjs");
|
|
7
7
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
8
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
8
|
+
const require_solidBuilders = require("./solidBuilders-BgrXN-GP.cjs");
|
|
9
9
|
//#region src/topology/threeHelpers.ts
|
|
10
10
|
/**
|
|
11
11
|
* Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { C as isSolid, R as getShapeKind, T as isWire, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, rt as getKernel, x as isShape3D, y as isFace } from "./shapeTypes-
|
|
2
|
-
import {
|
|
3
|
-
import { c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-
|
|
1
|
+
import { C as isSolid, R as getShapeKind, T as isWire, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, rt as getKernel, x as isShape3D, y as isFace } from "./shapeTypes-B5bBKbg9.js";
|
|
2
|
+
import { C as isOk, O as ok, S as isErr, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, v as err } from "./errors-B3CDG537.js";
|
|
3
|
+
import { c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-MAUFbsSp.js";
|
|
4
4
|
import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
|
|
5
|
-
import { y as downcast } from "./faceFns-
|
|
6
|
-
import { _ as collectInputFaceHashes, y as propagateAllMetadata } from "./shapeFns-
|
|
5
|
+
import { y as downcast } from "./faceFns-CCu9ULQm.js";
|
|
6
|
+
import { _ as collectInputFaceHashes, y as propagateAllMetadata } from "./shapeFns-BakfS4c9.js";
|
|
7
7
|
import { t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
8
|
-
import { f as cut, h as fuseAll, m as fuse, p as cutAll } from "./solidBuilders-
|
|
8
|
+
import { f as cut, h as fuseAll, m as fuse, p as cutAll } from "./solidBuilders-DaTgm_Wj.js";
|
|
9
9
|
//#region src/topology/threeHelpers.ts
|
|
10
10
|
/**
|
|
11
11
|
* Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { rt as getKernel, y as isFace } from "./shapeTypes-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { rt as getKernel, y as isFace } from "./shapeTypes-B5bBKbg9.js";
|
|
2
|
+
import { n as bug } from "./bug-BdOHwn_e.js";
|
|
3
|
+
import { C as isOk, O as ok, o as queryError, v as err } from "./errors-B3CDG537.js";
|
|
4
|
+
import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-MAUFbsSp.js";
|
|
4
5
|
import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
|
|
5
6
|
import { a as vecDot, d as vecNormalize } from "./vecOps-SKPRvPH-.js";
|
|
6
|
-
import { l as normalAt, s as getSurfaceType } from "./faceFns-
|
|
7
|
-
import { a as isSameShape, n as getHashCode } from "./shapeFns-
|
|
8
|
-
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-
|
|
9
|
-
import { n as measureArea } from "./measureFns-
|
|
7
|
+
import { l as normalAt, s as getSurfaceType } from "./faceFns-CCu9ULQm.js";
|
|
8
|
+
import { a as isSameShape, n as getHashCode } from "./shapeFns-BakfS4c9.js";
|
|
9
|
+
import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-SNQ04JW6.js";
|
|
10
|
+
import { n as measureArea } from "./measureFns-DHj5Z-5c.js";
|
|
10
11
|
//#region src/utils/vec2d.ts
|
|
11
12
|
/** Precision for curve intersection and parameter operations. */
|
|
12
13
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const
|
|
3
|
-
const
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BfOb9vzc.cjs");
|
|
2
|
+
const require_bug = require("./bug-O02CsAmt.cjs");
|
|
3
|
+
const require_errors = require("./errors-CJU8CHng.cjs");
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-tns6VXoD.cjs");
|
|
4
5
|
const require_constants = require("./constants-BOVyEYGH.cjs");
|
|
5
6
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
6
|
-
const require_faceFns = require("./faceFns-
|
|
7
|
-
const require_shapeFns = require("./shapeFns-
|
|
8
|
-
const require_curveFns = require("./curveFns-
|
|
9
|
-
const require_measureFns = require("./measureFns-
|
|
7
|
+
const require_faceFns = require("./faceFns-C0SwZInk.cjs");
|
|
8
|
+
const require_shapeFns = require("./shapeFns-DzXcfZHY.cjs");
|
|
9
|
+
const require_curveFns = require("./curveFns-YN8_CsqU.cjs");
|
|
10
|
+
const require_measureFns = require("./measureFns-DMzw5wf0.cjs");
|
|
10
11
|
//#region src/utils/vec2d.ts
|
|
11
12
|
/** Precision for curve intersection and parameter operations. */
|
|
12
13
|
var PRECISION_INTERSECTION = 1e-9;
|
|
@@ -101,7 +102,7 @@ var cartesianToPolar = ([x, y]) => {
|
|
|
101
102
|
*/
|
|
102
103
|
var normalize2d = ([x, y]) => {
|
|
103
104
|
const result = normalize2d$1([x, y]);
|
|
104
|
-
if (result[0] === 0 && result[1] === 0)
|
|
105
|
+
if (result[0] === 0 && result[1] === 0) require_bug.bug("normalize2d", "Cannot normalize zero-length vector");
|
|
105
106
|
return result;
|
|
106
107
|
};
|
|
107
108
|
//#endregion
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const
|
|
3
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BfOb9vzc.cjs");
|
|
2
|
+
const require_bug = require("./bug-O02CsAmt.cjs");
|
|
3
|
+
const require_errors = require("./errors-CJU8CHng.cjs");
|
|
4
4
|
const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
|
|
5
|
-
const require_blueprint = require("./blueprint-
|
|
5
|
+
const require_blueprint = require("./blueprint-DG-2uqNB.cjs");
|
|
6
6
|
//#region src/io/objExportFns.ts
|
|
7
7
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
8
8
|
function vec3At(arr, i) {
|
|
9
|
-
return
|
|
9
|
+
return require_bug.vec3At(arr, i * 3);
|
|
10
10
|
}
|
|
11
11
|
/** Read a triangle's three vertex indices from the triangles array. */
|
|
12
12
|
function triAt(arr, offset) {
|
|
13
|
-
return
|
|
13
|
+
return require_bug.vec3At(arr, offset);
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Export a ShapeMesh as a Wavefront OBJ string.
|
|
@@ -91,9 +91,9 @@ function computeMinMax(data) {
|
|
|
91
91
|
-Infinity
|
|
92
92
|
];
|
|
93
93
|
for (let i = 0; i < data.length; i += 3) for (let j = 0; j < 3; j++) {
|
|
94
|
-
const v =
|
|
95
|
-
if (v <
|
|
96
|
-
if (v >
|
|
94
|
+
const v = require_bug.wasmIndex(data, i + j);
|
|
95
|
+
if (v < require_bug.wasmIndex(min, j)) min[j] = v;
|
|
96
|
+
if (v > require_bug.wasmIndex(max, j)) max[j] = v;
|
|
97
97
|
}
|
|
98
98
|
return {
|
|
99
99
|
min,
|
|
@@ -333,7 +333,7 @@ function computeMaterialLayout(mesh, materialMap) {
|
|
|
333
333
|
let offset = 0;
|
|
334
334
|
for (const gi of groupIndices) {
|
|
335
335
|
const fg = require_arrayAccess.getAtOrThrow(faceGroups, gi);
|
|
336
|
-
for (let i = fg.start; i < fg.start + fg.count; i++) indices[offset++] =
|
|
336
|
+
for (let i = fg.start; i < fg.start + fg.count; i++) indices[offset++] = require_bug.wasmIndex(triangles, i);
|
|
337
337
|
}
|
|
338
338
|
primitiveData.push({
|
|
339
339
|
indices,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as castShape, rt as getKernel } from "./shapeTypes-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { i as castShape, rt as getKernel } from "./shapeTypes-B5bBKbg9.js";
|
|
2
|
+
import { i as wasmIndex, r as vec3At$1 } from "./bug-BdOHwn_e.js";
|
|
3
|
+
import { O as ok, r as ioError, t as BrepErrorCode, v as err } from "./errors-B3CDG537.js";
|
|
4
4
|
import { n as getAtOrThrow } from "./arrayAccess-DrUGPADn.js";
|
|
5
|
-
import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-
|
|
5
|
+
import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-CwQmYoR4.js";
|
|
6
6
|
//#region src/io/objExportFns.ts
|
|
7
7
|
/** Read a vec3 from a typed array at the given vertex index. */
|
|
8
8
|
function vec3At(arr, i) {
|
package/dist/io.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_meshFns = require("./meshFns-
|
|
3
|
-
const require_importFns = require("./importFns-
|
|
2
|
+
const require_meshFns = require("./meshFns-B9pPcwuD.cjs");
|
|
3
|
+
const require_importFns = require("./importFns-6eFs1L_G.cjs");
|
|
4
4
|
exports.blueprintToDXF = require_importFns.blueprintToDXF;
|
|
5
5
|
exports.exportDXF = require_importFns.exportDXF;
|
|
6
6
|
exports.exportGlb = require_importFns.exportGlb;
|
package/dist/io.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-
|
|
2
|
-
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-
|
|
1
|
+
import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-C2nLgSf2.js";
|
|
2
|
+
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-Bcza0b4Y.js";
|
|
3
3
|
export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_occtWasmAdapter = require("../../occtWasmAdapter-
|
|
2
|
+
const require_occtWasmAdapter = require("../../occtWasmAdapter-CIxwUim8.cjs");
|
|
3
3
|
exports.OcctWasmAdapter = require_occtWasmAdapter.OcctWasmAdapter;
|
|
@@ -40,10 +40,13 @@ export declare class OcctWasmAdapter implements KernelAdapter {
|
|
|
40
40
|
delete(): void;
|
|
41
41
|
}): void;
|
|
42
42
|
executeBatch(_json: string): string;
|
|
43
|
+
private readonly openCheckpoints;
|
|
43
44
|
checkpoint(): number;
|
|
44
45
|
checkpointCount(): number;
|
|
45
|
-
restoreCheckpoint(
|
|
46
|
-
discardCheckpoint(
|
|
46
|
+
restoreCheckpoint(cp: number): void;
|
|
47
|
+
discardCheckpoint(cp: number): void;
|
|
48
|
+
/** Drop `cp` and any marks nested inside it (LIFO), so the depth stays honest. */
|
|
49
|
+
private closeCheckpoint;
|
|
47
50
|
makeBox(width: number, height: number, depth: number): KernelShape;
|
|
48
51
|
makeCylinder(radius: number, height: number, center?: [number, number, number], direction?: [number, number, number]): KernelShape;
|
|
49
52
|
makeSphere(radius: number, center?: [number, number, number]): KernelShape;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as OcctWasmAdapter } from "../../occtWasmAdapter-
|
|
1
|
+
import { t as OcctWasmAdapter } from "../../occtWasmAdapter-5_6aHhcD.js";
|
|
2
2
|
export { OcctWasmAdapter };
|
|
@@ -113,6 +113,10 @@ export interface OcctKernelWasm {
|
|
|
113
113
|
release(id: number): void;
|
|
114
114
|
releaseAll(): void;
|
|
115
115
|
getShapeCount(): number;
|
|
116
|
+
/** Mark the current arena high-water point (occt-wasm >= 3.7.0). */
|
|
117
|
+
checkpoint(): number;
|
|
118
|
+
/** Free every handle allocated at or after `mark` in one call (occt-wasm >= 3.7.0). */
|
|
119
|
+
releaseSince(mark: number): void;
|
|
116
120
|
makeBox(dx: number, dy: number, dz: number): number;
|
|
117
121
|
makeBoxFromCorners(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number): number;
|
|
118
122
|
makeCylinder(radius: number, height: number): number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared error for "this kernel doesn't implement this operation" — a stubbed
|
|
3
|
+
* adapter method (occt's brepkit-only stubs, occt-wasm's not-yet-implemented) or
|
|
4
|
+
* a manifold op that needs an absent occt replay. Feature-detection recognises it
|
|
5
|
+
* structurally via {@link isUnsupportedKernelOperationError} instead of matching
|
|
6
|
+
* each adapter's message text, so a native-vs-fallback probe stays decoupled from
|
|
7
|
+
* wording. Adapters keep their existing messages; this only adds the marker.
|
|
8
|
+
*/
|
|
9
|
+
/** Thrown by a kernel adapter asked to perform an operation it doesn't support. */
|
|
10
|
+
export declare class UnsupportedKernelOperationError extends Error {
|
|
11
|
+
constructor(message: string);
|
|
12
|
+
}
|
|
13
|
+
/** True if `error` is an {@link UnsupportedKernelOperationError} from any kernel adapter. */
|
|
14
|
+
export declare function isUnsupportedKernelOperationError(error: unknown): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BfOb9vzc.cjs");
|
|
2
|
+
const require_errors = require("./errors-CJU8CHng.cjs");
|
|
3
3
|
const require_types = require("./types-KjA8tY4Y.cjs");
|
|
4
4
|
const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
|
|
5
5
|
//#region src/operations/extrudeUtils.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as isWire, d as createSolid, h as disposeResultShape, m as disposeDowncastSource, n as castResultShape, rt as getKernel, tt as _usingCtx, x as isShape3D } from "./shapeTypes-
|
|
2
|
-
import {
|
|
1
|
+
import { T as isWire, d as createSolid, h as disposeResultShape, m as disposeDowncastSource, n as castResultShape, rt as getKernel, tt as _usingCtx, x as isShape3D } from "./shapeTypes-B5bBKbg9.js";
|
|
2
|
+
import { O as ok, S as isErr, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, v as err } from "./errors-B3CDG537.js";
|
|
3
3
|
import { r as toVec3 } from "./types-D24Y27N0.js";
|
|
4
4
|
import { c as vecLength, d as vecNormalize, t as vecAdd } from "./vecOps-SKPRvPH-.js";
|
|
5
5
|
//#region src/operations/extrudeUtils.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { rt as getKernel } from "./shapeTypes-
|
|
2
|
-
import {
|
|
3
|
-
import { w as kernelCallRaw } from "./topologyQueryFns-
|
|
4
|
-
import { m as uvBounds } from "./faceFns-
|
|
1
|
+
import { rt as getKernel } from "./shapeTypes-B5bBKbg9.js";
|
|
2
|
+
import { O as ok, d as validationError, t as BrepErrorCode, v as err } from "./errors-B3CDG537.js";
|
|
3
|
+
import { w as kernelCallRaw } from "./topologyQueryFns-MAUFbsSp.js";
|
|
4
|
+
import { m as uvBounds } from "./faceFns-CCu9ULQm.js";
|
|
5
5
|
//#region src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BfOb9vzc.cjs");
|
|
2
|
+
const require_errors = require("./errors-CJU8CHng.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-tns6VXoD.cjs");
|
|
4
|
+
const require_faceFns = require("./faceFns-C0SwZInk.cjs");
|
|
5
5
|
//#region src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
package/dist/measurement.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_measureFns = require("./measureFns-
|
|
2
|
+
const require_measureFns = require("./measureFns-DMzw5wf0.cjs");
|
|
3
3
|
exports.createDistanceQuery = require_measureFns.createDistanceQuery;
|
|
4
4
|
exports.measureArea = require_measureFns.measureArea;
|
|
5
5
|
exports.measureDistance = require_measureFns.measureDistance;
|
package/dist/measurement.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-
|
|
1
|
+
import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-DHj5Z-5c.js";
|
|
2
2
|
export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
-
const require_shapeFns = require("./shapeFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-BfOb9vzc.cjs");
|
|
2
|
+
const require_errors = require("./errors-CJU8CHng.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-tns6VXoD.cjs");
|
|
4
|
+
const require_shapeFns = require("./shapeFns-DzXcfZHY.cjs");
|
|
5
5
|
//#region src/topology/meshCache.ts
|
|
6
6
|
/**
|
|
7
7
|
* Build a parameter key for the inner cache map (excludes shape identity).
|