brepjs 20.9.0 → 20.10.2
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 +6 -6
- package/dist/2d.js +6 -6
- package/dist/{adjacencyFns-qDDFKib0.cjs → adjacencyFns-CS62XPcQ.cjs} +3 -3
- package/dist/{adjacencyFns-CRd3d1xM.js → adjacencyFns-DG9R99LR.js} +3 -3
- package/dist/{blueprint-Dr-l3Nlb.js → blueprint-B8tYa1RE.js} +5 -5
- package/dist/{blueprint-CgWpKzKK.cjs → blueprint-YK9OBMxh.cjs} +5 -5
- package/dist/{blueprintFns-DU8jUsTf.js → blueprintFns-C0x5vPm-.js} +2 -2
- package/dist/{blueprintFns-lhshdjAb.cjs → blueprintFns-DDiWI0Ol.cjs} +2 -2
- package/dist/{blueprintSketcher-ZRJzo1tb.cjs → blueprintSketcher-7v6ufdam.cjs} +3 -3
- package/dist/{blueprintSketcher-P4oIgADL.js → blueprintSketcher-DcyidOGa.js} +3 -3
- package/dist/{boolean2D-h4By3wwW.cjs → boolean2D-B21GheGE.cjs} +4 -4
- package/dist/{boolean2D-iTKFBIvC.js → boolean2D-DYAua9O_.js} +4 -4
- package/dist/brepjs.cjs +49 -91
- package/dist/brepjs.js +49 -91
- package/dist/{cameraFns-Dgx3MCGf.js → cameraFns-CAjuoPKb.js} +3 -3
- package/dist/{cameraFns-CNWY4B7i.cjs → cameraFns-HpsMe1iL.cjs} +3 -3
- package/dist/core.cjs +2 -2
- package/dist/core.js +2 -2
- package/dist/{cornerFinder-BqGipV9i.js → cornerFinder-DHg0ej_Q.js} +1 -1
- package/dist/{cornerFinder-DZORgosi.cjs → cornerFinder-DVHtBOzM.cjs} +1 -1
- package/dist/{curveFns-DqgDK9xJ.js → curveFns-BdmSrGqT.js} +1 -1
- package/dist/{curveFns-C01yujmY.cjs → curveFns-DUSOe8uJ.cjs} +1 -1
- package/dist/{drawFns-mtCQj7Qu.cjs → drawFns-Cy7P1Q-L.cjs} +12 -12
- package/dist/{drawFns-BbDx57EX.js → drawFns-X0cS9iAp.js} +12 -12
- package/dist/{faceFns-BNGMbh3P.js → faceFns-DKEm5U-p.js} +2 -2
- package/dist/{faceFns-BlYowjvU.cjs → faceFns-vVGf6osa.cjs} +2 -2
- package/dist/{healingFns-DXYEpHAx.cjs → healingFns-CW0olP8u.cjs} +21 -12
- package/dist/{healingFns-xPtXVShE.js → healingFns-C_3Zf9sr.js} +21 -12
- package/dist/{helpers-Ngw1OFee.cjs → helpers-BIpWypkW.cjs} +6 -6
- package/dist/{helpers-vd5KEdfZ.js → helpers-CcZp3tLI.js} +6 -6
- package/dist/{importFns-BwEwuqM2.cjs → importFns-DI3Q8B0Q.cjs} +2 -2
- package/dist/{importFns-DQW8EVaa.js → importFns-D_tBVKl2.js} +2 -2
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/faultyEdges.d.ts +11 -0
- package/dist/kernel/occtWasm/constructionOps.d.ts +4 -2
- package/dist/kernel/occtWasm/helpers.d.ts +5 -0
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +2 -2
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/kernel/occtWasm/occtWasmTypes.d.ts +2 -0
- package/dist/kernel/optionalBackend.d.ts +3 -1
- package/dist/{loftFns-Cth0_MXM.js → loftFns-DIsFP0VL.js} +1 -1
- package/dist/{loftFns-DlBiqyB-.cjs → loftFns-tGsV_hHY.cjs} +1 -1
- package/dist/{measureFns-BnbD7-w7.cjs → measureFns-BoNCUOKe.cjs} +3 -3
- package/dist/{measureFns-B_DpfIE3.js → measureFns-eCuwj0im.js} +3 -3
- package/dist/measurement.cjs +2 -2
- package/dist/measurement.js +2 -2
- package/dist/{meshFns-DlGc_nS6.cjs → meshFns-0W1-80zv.cjs} +3 -3
- package/dist/{meshFns-B4L-5mVr.js → meshFns-B9jPfcB2.js} +3 -3
- package/dist/{occtWasmAdapter-Bi9GozJ9.js → occtWasmAdapter-ClvPe3OJ.js} +115 -13
- package/dist/{occtWasmAdapter-Dd9giakk.cjs → occtWasmAdapter-CsDULjij.cjs} +120 -12
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{originTrackingFns-BQIWwnFh.js → originTrackingFns-BW2BaJW8.js} +2 -2
- package/dist/{originTrackingFns-DDOCQdaW.cjs → originTrackingFns-cEKFxtia.cjs} +2 -2
- package/dist/{primitiveFns-B8ab8U8_.cjs → primitiveFns-BJ-ehvvd.cjs} +4 -4
- package/dist/{primitiveFns-ChWAGjel.js → primitiveFns-BOZ7Kx0M.js} +4 -4
- package/dist/{principalBoxFns-DXNRJ_A-.cjs → principalBoxFns-B1j2sNAc.cjs} +3 -3
- package/dist/{principalBoxFns-CvAYgpY4.js → principalBoxFns-B6PZwxDM.js} +3 -3
- 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/quick.js +3 -2
- package/dist/{refResolveFns-Bc5nUmmk.js → refResolveFns-BxvibZPu.js} +6 -6
- package/dist/{refResolveFns-C6CYnUNd.cjs → refResolveFns-DvDeMCVU.cjs} +6 -6
- package/dist/{shapeFns-Cn0lAxbU.cjs → shapeFns-CJrIL2CG.cjs} +2 -2
- package/dist/{shapeFns-DLD8qAsI.js → shapeFns-De7CbEeQ.js} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-D0j6Lk3z.js → shapeTypes-BCy8JI0O.js} +5 -2
- package/dist/{shapeTypes-K0rZK5U-.cjs → shapeTypes-CNQn1x5H.cjs} +5 -2
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-DfXGia5F.cjs → solidBuilders-BN1p303l.cjs} +5 -5
- package/dist/{solidBuilders-94pT7hv6.js → solidBuilders-YbLOfWIp.js} +5 -5
- package/dist/{surfaceBuilders-DnZj4fvS.cjs → surfaceBuilders-C5lz2TNF.cjs} +3 -3
- package/dist/{surfaceBuilders-DGEXvSTe.js → surfaceBuilders-CaN-lye8.js} +3 -3
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-D4Yez18p.js → textBlueprints-BlfIkOUx.js} +7 -7
- package/dist/{textBlueprints-BUV_vedl.cjs → textBlueprints-jlqCGG4p.cjs} +7 -7
- package/dist/{textMetrics-BwFqDdvR.cjs → textMetrics-B2KxCoHk.cjs} +1 -1
- package/dist/{textMetrics-C1iq-fwi.js → textMetrics-BjhB4Zur.js} +1 -1
- package/dist/{threadFns-DS6WgBI2.cjs → threadFns-DO9SkBPb.cjs} +7 -7
- package/dist/{threadFns-DHL3t8zV.js → threadFns-DWMumhmK.js} +7 -7
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-BPJZTpIz.cjs → topologyQueryFns-BwhwOtxv.cjs} +1 -1
- package/dist/{topologyQueryFns-DtzwRKVP.js → topologyQueryFns-Clkdolgd.js} +1 -1
- package/dist/{validityTypes-DfqnKBzz.cjs → validityTypes-B_6gRPPO.cjs} +1 -1
- package/dist/{validityTypes-CqFq8m-i.js → validityTypes-txYFYYN6.js} +1 -1
- package/package.json +2 -2
|
@@ -1225,6 +1225,27 @@ function buildAsciiSTL(vertices, triangles) {
|
|
|
1225
1225
|
lines.push("endsolid brepjs");
|
|
1226
1226
|
return lines.join("\n") + "\n";
|
|
1227
1227
|
}
|
|
1228
|
+
// src/kernel/faultyEdges.ts
|
|
1229
|
+
/**
|
|
1230
|
+
* A fillet or chamfer the kernel could not build, naming the edges it failed
|
|
1231
|
+
* on. The indexes point into the edges array passed to the kernel method, so
|
|
1232
|
+
* the caller can map them back to its own edge handles without retrying edge
|
|
1233
|
+
* by edge.
|
|
1234
|
+
*/
|
|
1235
|
+
var FAULTY_EDGES_MARKER = Symbol.for("brepjs.kernel.faultyEdgeIndexes");
|
|
1236
|
+
var FaultyEdgesError = class extends Error {
|
|
1237
|
+
constructor(message, faultyEdgeIndexes, options) {
|
|
1238
|
+
super(message, options);
|
|
1239
|
+
this.name = "FaultyEdgesError";
|
|
1240
|
+
Object.defineProperty(this, FAULTY_EDGES_MARKER, { value: faultyEdgeIndexes });
|
|
1241
|
+
}
|
|
1242
|
+
};
|
|
1243
|
+
/** The failing edges' indexes carried by a {@link FaultyEdgesError}, or `undefined`. */
|
|
1244
|
+
function faultyEdgeIndexesOf(error) {
|
|
1245
|
+
if (!(error instanceof Error)) return void 0;
|
|
1246
|
+
const indexes = Reflect.get(error, FAULTY_EDGES_MARKER);
|
|
1247
|
+
return Array.isArray(indexes) ? indexes : void 0;
|
|
1248
|
+
}
|
|
1228
1249
|
// src/kernel/occtWasm/helpers.ts
|
|
1229
1250
|
var noop = () => {};
|
|
1230
1251
|
/** Build an opaque kernel handle for an arena-allocated WASM shape. */
|
|
@@ -1251,6 +1272,21 @@ function unwrap(shape) {
|
|
|
1251
1272
|
if (typeof shape === "number") return shape;
|
|
1252
1273
|
throw new Error("occt-wasm: expected an OcctWasmHandle or number, got " + typeof shape);
|
|
1253
1274
|
}
|
|
1275
|
+
var FAULTY_EDGES_SUFFIX = /\[faulty edges: (\d+(?:,\d+)*)\]/;
|
|
1276
|
+
/**
|
|
1277
|
+
* Run a raw fillet/chamfer call, turning the facade's ` [faulty edges: 3,7]`
|
|
1278
|
+
* message suffix (arena ids, occt-wasm 5.8+) into indexes into `edges`.
|
|
1279
|
+
*/
|
|
1280
|
+
function reportingFaultyEdges(edges, run) {
|
|
1281
|
+
try {
|
|
1282
|
+
return run();
|
|
1283
|
+
} catch (e) {
|
|
1284
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
1285
|
+
const ids = FAULTY_EDGES_SUFFIX.exec(message)?.[1]?.split(",").map(Number);
|
|
1286
|
+
if (!ids) throw e;
|
|
1287
|
+
throw new FaultyEdgesError(message, edges.flatMap((edge, i) => ids.includes(unwrap(edge)) ? [i] : []), { cause: e });
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1254
1290
|
/** Map a WASM shape type string to our ShapeType enum. */
|
|
1255
1291
|
function mapShapeType(wasmType) {
|
|
1256
1292
|
switch (wasmType.toLowerCase()) {
|
|
@@ -2754,7 +2790,7 @@ function fillet(k, Module, shape, edges, radius) {
|
|
|
2754
2790
|
const r = resolveUniformRadius(edges, radius);
|
|
2755
2791
|
const vec = makeVecU32(Module, edges.map(unwrap));
|
|
2756
2792
|
try {
|
|
2757
|
-
return wrapResult(k, k.fillet(unwrap(shape), vec, r));
|
|
2793
|
+
return wrapResult(k, reportingFaultyEdges(edges, () => k.fillet(unwrap(shape), vec, r)));
|
|
2758
2794
|
} finally {
|
|
2759
2795
|
vec.delete();
|
|
2760
2796
|
}
|
|
@@ -2763,7 +2799,7 @@ function chamfer(k, Module, shape, edges, distance) {
|
|
|
2763
2799
|
const d = resolveUniformRadius(edges, distance);
|
|
2764
2800
|
const vec = makeVecU32(Module, edges.map(unwrap));
|
|
2765
2801
|
try {
|
|
2766
|
-
return wrapResult(k, k.chamfer(unwrap(shape), vec, d));
|
|
2802
|
+
return wrapResult(k, reportingFaultyEdges(edges, () => k.chamfer(unwrap(shape), vec, d)));
|
|
2767
2803
|
} finally {
|
|
2768
2804
|
vec.delete();
|
|
2769
2805
|
}
|
|
@@ -3740,11 +3776,77 @@ function makeCircleArc(k, center, normal, radius, startAngle, endAngle) {
|
|
|
3740
3776
|
function makeArcEdge(k, p1, p2, p3) {
|
|
3741
3777
|
return handle("edge", k.makeArcEdge(p1[0], p1[1], p1[2], p2[0], p2[1], p2[2], p3[0], p3[1], p3[2]));
|
|
3742
3778
|
}
|
|
3743
|
-
function
|
|
3744
|
-
return
|
|
3779
|
+
function rawEllipse(k, center, normal, major, minor) {
|
|
3780
|
+
return k.makeEllipseEdge(...center, ...normal, major, minor);
|
|
3745
3781
|
}
|
|
3746
|
-
|
|
3747
|
-
|
|
3782
|
+
/** Where OCCT puts the major axis for `normal` alone: the direction to parameter 0. */
|
|
3783
|
+
function defaultMajorAxis(k, ellipseId, center) {
|
|
3784
|
+
const vertices = k.getSubShapes(ellipseId, "vertex");
|
|
3785
|
+
try {
|
|
3786
|
+
const p = k.vertexPosition(vertices.get(0));
|
|
3787
|
+
try {
|
|
3788
|
+
return [
|
|
3789
|
+
p.get(0) - center[0],
|
|
3790
|
+
p.get(1) - center[1],
|
|
3791
|
+
p.get(2) - center[2]
|
|
3792
|
+
];
|
|
3793
|
+
} finally {
|
|
3794
|
+
p.delete();
|
|
3795
|
+
}
|
|
3796
|
+
} finally {
|
|
3797
|
+
for (let i = 0; i < vertices.size(); i++) k.release(vertices.get(i));
|
|
3798
|
+
vertices.delete();
|
|
3799
|
+
}
|
|
3800
|
+
}
|
|
3801
|
+
/** Angle about `normal` that turns `from` onto `xDir` projected into the ellipse plane. */
|
|
3802
|
+
function angleToXDir(from, normal, xDir) {
|
|
3803
|
+
const nLen = Math.hypot(...normal);
|
|
3804
|
+
const n = normal.map((v) => v / nLen);
|
|
3805
|
+
const along = xDir[0] * n[0] + xDir[1] * n[1] + xDir[2] * n[2];
|
|
3806
|
+
const xp = xDir.map((v, i) => v - along * (n[i] ?? 0));
|
|
3807
|
+
if (Math.hypot(...xp) < 1e-12 * Math.max(1, Math.hypot(...xDir))) throw new Error("occt-wasm: ellipse xDir is parallel to the normal");
|
|
3808
|
+
const cross = [
|
|
3809
|
+
from[1] * xp[2] - from[2] * xp[1],
|
|
3810
|
+
from[2] * xp[0] - from[0] * xp[2],
|
|
3811
|
+
from[0] * xp[1] - from[1] * xp[0]
|
|
3812
|
+
];
|
|
3813
|
+
const sin = cross[0] * n[0] + cross[1] * n[1] + cross[2] * n[2];
|
|
3814
|
+
const cos = from[0] * xp[0] + from[1] * xp[1] + from[2] * xp[2];
|
|
3815
|
+
return Math.atan2(sin, cos);
|
|
3816
|
+
}
|
|
3817
|
+
/** Rotate `id` about the ellipse axis, releasing it; returns the rotated id. */
|
|
3818
|
+
function turnAboutAxis(k, id, center, normal, angle) {
|
|
3819
|
+
if (Math.abs(angle) < 1e-12) return id;
|
|
3820
|
+
try {
|
|
3821
|
+
return k.rotate(id, ...center, ...normal, angle);
|
|
3822
|
+
} finally {
|
|
3823
|
+
k.release(id);
|
|
3824
|
+
}
|
|
3825
|
+
}
|
|
3826
|
+
function makeEllipseEdge(k, center, normal, majorRadius, minorRadius, xDir) {
|
|
3827
|
+
const id = rawEllipse(k, center, normal, majorRadius, minorRadius);
|
|
3828
|
+
if (!xDir) return handle("edge", id);
|
|
3829
|
+
let angle;
|
|
3830
|
+
try {
|
|
3831
|
+
angle = angleToXDir(defaultMajorAxis(k, id, center), normal, xDir);
|
|
3832
|
+
} catch (e) {
|
|
3833
|
+
k.release(id);
|
|
3834
|
+
throw e;
|
|
3835
|
+
}
|
|
3836
|
+
return handle("edge", turnAboutAxis(k, id, center, normal, angle));
|
|
3837
|
+
}
|
|
3838
|
+
function makeEllipseArc(k, center, normal, majorRadius, minorRadius, startAngle, endAngle, xDir) {
|
|
3839
|
+
const arc = () => k.makeEllipseArc(...center, ...normal, majorRadius, minorRadius, startAngle, endAngle);
|
|
3840
|
+
if (!xDir) return handle("edge", arc());
|
|
3841
|
+
if (k.makeEllipseArcOriented) return handle("edge", k.makeEllipseArcOriented(...center, ...normal, ...xDir, majorRadius, minorRadius, startAngle, endAngle));
|
|
3842
|
+
const probe = rawEllipse(k, center, normal, majorRadius, minorRadius);
|
|
3843
|
+
let angle;
|
|
3844
|
+
try {
|
|
3845
|
+
angle = angleToXDir(defaultMajorAxis(k, probe, center), normal, xDir);
|
|
3846
|
+
} finally {
|
|
3847
|
+
k.release(probe);
|
|
3848
|
+
}
|
|
3849
|
+
return handle("edge", turnAboutAxis(k, arc(), center, normal, angle));
|
|
3748
3850
|
}
|
|
3749
3851
|
function makeBezierEdge(k, Module, points) {
|
|
3750
3852
|
const flat = [];
|
|
@@ -4836,7 +4938,7 @@ function filletWithHistory(k, Module, shape, edges, radius, inputFaceHashes, has
|
|
|
4836
4938
|
const edgeVec = makeVecU32(Module, edges.map(unwrap));
|
|
4837
4939
|
const hashVec = makeVecInt(Module, inputFaceHashes);
|
|
4838
4940
|
try {
|
|
4839
|
-
const { id, evolution } = parseEvolution(k.filletWithHistory(unwrap(shape), edgeVec, r, hashVec, hashUpperBound));
|
|
4941
|
+
const { id, evolution } = parseEvolution(reportingFaultyEdges(edges, () => k.filletWithHistory(unwrap(shape), edgeVec, r, hashVec, hashUpperBound)));
|
|
4840
4942
|
return {
|
|
4841
4943
|
shape: wrapResult(k, id),
|
|
4842
4944
|
evolution
|
|
@@ -4851,7 +4953,7 @@ function chamferWithHistory(k, Module, shape, edges, distance, inputFaceHashes,
|
|
|
4851
4953
|
const edgeVec = makeVecU32(Module, edges.map(unwrap));
|
|
4852
4954
|
const hashVec = makeVecInt(Module, inputFaceHashes);
|
|
4853
4955
|
try {
|
|
4854
|
-
const { id, evolution } = parseEvolution(k.chamferWithHistory(unwrap(shape), edgeVec, d, hashVec, hashUpperBound));
|
|
4956
|
+
const { id, evolution } = parseEvolution(reportingFaultyEdges(edges, () => k.chamferWithHistory(unwrap(shape), edgeVec, d, hashVec, hashUpperBound)));
|
|
4855
4957
|
return {
|
|
4856
4958
|
shape: wrapResult(k, id),
|
|
4857
4959
|
evolution
|
|
@@ -5142,11 +5244,11 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
5142
5244
|
makeArcEdge(p1, p2, p3) {
|
|
5143
5245
|
return makeArcEdge(this.k, p1, p2, p3);
|
|
5144
5246
|
}
|
|
5145
|
-
makeEllipseEdge(center, normal, majorRadius, minorRadius,
|
|
5146
|
-
return makeEllipseEdge(this.k, center, normal, majorRadius, minorRadius);
|
|
5247
|
+
makeEllipseEdge(center, normal, majorRadius, minorRadius, xDir) {
|
|
5248
|
+
return makeEllipseEdge(this.k, center, normal, majorRadius, minorRadius, xDir);
|
|
5147
5249
|
}
|
|
5148
|
-
makeEllipseArc(center, normal, majorRadius, minorRadius, startAngle, endAngle,
|
|
5149
|
-
return makeEllipseArc(this.k, center, normal, majorRadius, minorRadius, startAngle, endAngle);
|
|
5250
|
+
makeEllipseArc(center, normal, majorRadius, minorRadius, startAngle, endAngle, xDir) {
|
|
5251
|
+
return makeEllipseArc(this.k, center, normal, majorRadius, minorRadius, startAngle, endAngle, xDir);
|
|
5150
5252
|
}
|
|
5151
5253
|
makeBezierEdge(points) {
|
|
5152
5254
|
return makeBezierEdge(this.k, this.Module, points);
|
|
@@ -5846,4 +5948,4 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
5846
5948
|
return getNurbsCurveData(this.k, edge);
|
|
5847
5949
|
}
|
|
5848
5950
|
};
|
|
5849
|
-
export {
|
|
5951
|
+
export { DEFAULT_CAPABILITIES as A, scaleCurve2d$1 as C, quickHull as D, translateCurve2d$1 as E, OCCT_CAPABILITIES as M, UnsupportedKernelOperationError as O, rotateCurve2d$1 as S, tangentCurve2d as T, makeCircle2d$1 as _, buildAsciiSTL as a, mirrorAcrossAxis as b, createBBox2d as c, deserializeCurve2d$1 as d, evaluateCurve2d$1 as f, makeBezier2d$1 as g, makeArc2dThreePoints$1 as h, DEFAULT_STL_TOLERANCE as i, EXACT_BREP_CAPABILITIES as j, isUnsupportedKernelOperationError as k, curveBounds as l, makeArc2dTangent$1 as m, faultyEdgeIndexesOf as n, buildBinarySTL as o, intersectCurves2dFn as p, DEFAULT_STL_ANGULAR_TOLERANCE as r, addCurveToBBox as s, OcctWasmAdapter as t, curveTypeName as u, makeEllipse2d$1 as v, serializeCurve2d$1 as w, mirrorAtPoint as x, makeLine2d$1 as y };
|
|
@@ -1225,6 +1225,27 @@ function buildAsciiSTL(vertices, triangles) {
|
|
|
1225
1225
|
lines.push("endsolid brepjs");
|
|
1226
1226
|
return lines.join("\n") + "\n";
|
|
1227
1227
|
}
|
|
1228
|
+
// src/kernel/faultyEdges.ts
|
|
1229
|
+
/**
|
|
1230
|
+
* A fillet or chamfer the kernel could not build, naming the edges it failed
|
|
1231
|
+
* on. The indexes point into the edges array passed to the kernel method, so
|
|
1232
|
+
* the caller can map them back to its own edge handles without retrying edge
|
|
1233
|
+
* by edge.
|
|
1234
|
+
*/
|
|
1235
|
+
var FAULTY_EDGES_MARKER = Symbol.for("brepjs.kernel.faultyEdgeIndexes");
|
|
1236
|
+
var FaultyEdgesError = class extends Error {
|
|
1237
|
+
constructor(message, faultyEdgeIndexes, options) {
|
|
1238
|
+
super(message, options);
|
|
1239
|
+
this.name = "FaultyEdgesError";
|
|
1240
|
+
Object.defineProperty(this, FAULTY_EDGES_MARKER, { value: faultyEdgeIndexes });
|
|
1241
|
+
}
|
|
1242
|
+
};
|
|
1243
|
+
/** The failing edges' indexes carried by a {@link FaultyEdgesError}, or `undefined`. */
|
|
1244
|
+
function faultyEdgeIndexesOf(error) {
|
|
1245
|
+
if (!(error instanceof Error)) return void 0;
|
|
1246
|
+
const indexes = Reflect.get(error, FAULTY_EDGES_MARKER);
|
|
1247
|
+
return Array.isArray(indexes) ? indexes : void 0;
|
|
1248
|
+
}
|
|
1228
1249
|
// src/kernel/occtWasm/helpers.ts
|
|
1229
1250
|
var noop = () => {};
|
|
1230
1251
|
/** Build an opaque kernel handle for an arena-allocated WASM shape. */
|
|
@@ -1251,6 +1272,21 @@ function unwrap(shape) {
|
|
|
1251
1272
|
if (typeof shape === "number") return shape;
|
|
1252
1273
|
throw new Error("occt-wasm: expected an OcctWasmHandle or number, got " + typeof shape);
|
|
1253
1274
|
}
|
|
1275
|
+
var FAULTY_EDGES_SUFFIX = /\[faulty edges: (\d+(?:,\d+)*)\]/;
|
|
1276
|
+
/**
|
|
1277
|
+
* Run a raw fillet/chamfer call, turning the facade's ` [faulty edges: 3,7]`
|
|
1278
|
+
* message suffix (arena ids, occt-wasm 5.8+) into indexes into `edges`.
|
|
1279
|
+
*/
|
|
1280
|
+
function reportingFaultyEdges(edges, run) {
|
|
1281
|
+
try {
|
|
1282
|
+
return run();
|
|
1283
|
+
} catch (e) {
|
|
1284
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
1285
|
+
const ids = FAULTY_EDGES_SUFFIX.exec(message)?.[1]?.split(",").map(Number);
|
|
1286
|
+
if (!ids) throw e;
|
|
1287
|
+
throw new FaultyEdgesError(message, edges.flatMap((edge, i) => ids.includes(unwrap(edge)) ? [i] : []), { cause: e });
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1254
1290
|
/** Map a WASM shape type string to our ShapeType enum. */
|
|
1255
1291
|
function mapShapeType(wasmType) {
|
|
1256
1292
|
switch (wasmType.toLowerCase()) {
|
|
@@ -2754,7 +2790,7 @@ function fillet(k, Module, shape, edges, radius) {
|
|
|
2754
2790
|
const r = resolveUniformRadius(edges, radius);
|
|
2755
2791
|
const vec = makeVecU32(Module, edges.map(unwrap));
|
|
2756
2792
|
try {
|
|
2757
|
-
return wrapResult(k, k.fillet(unwrap(shape), vec, r));
|
|
2793
|
+
return wrapResult(k, reportingFaultyEdges(edges, () => k.fillet(unwrap(shape), vec, r)));
|
|
2758
2794
|
} finally {
|
|
2759
2795
|
vec.delete();
|
|
2760
2796
|
}
|
|
@@ -2763,7 +2799,7 @@ function chamfer(k, Module, shape, edges, distance) {
|
|
|
2763
2799
|
const d = resolveUniformRadius(edges, distance);
|
|
2764
2800
|
const vec = makeVecU32(Module, edges.map(unwrap));
|
|
2765
2801
|
try {
|
|
2766
|
-
return wrapResult(k, k.chamfer(unwrap(shape), vec, d));
|
|
2802
|
+
return wrapResult(k, reportingFaultyEdges(edges, () => k.chamfer(unwrap(shape), vec, d)));
|
|
2767
2803
|
} finally {
|
|
2768
2804
|
vec.delete();
|
|
2769
2805
|
}
|
|
@@ -3740,11 +3776,77 @@ function makeCircleArc(k, center, normal, radius, startAngle, endAngle) {
|
|
|
3740
3776
|
function makeArcEdge(k, p1, p2, p3) {
|
|
3741
3777
|
return handle("edge", k.makeArcEdge(p1[0], p1[1], p1[2], p2[0], p2[1], p2[2], p3[0], p3[1], p3[2]));
|
|
3742
3778
|
}
|
|
3743
|
-
function
|
|
3744
|
-
return
|
|
3779
|
+
function rawEllipse(k, center, normal, major, minor) {
|
|
3780
|
+
return k.makeEllipseEdge(...center, ...normal, major, minor);
|
|
3745
3781
|
}
|
|
3746
|
-
|
|
3747
|
-
|
|
3782
|
+
/** Where OCCT puts the major axis for `normal` alone: the direction to parameter 0. */
|
|
3783
|
+
function defaultMajorAxis(k, ellipseId, center) {
|
|
3784
|
+
const vertices = k.getSubShapes(ellipseId, "vertex");
|
|
3785
|
+
try {
|
|
3786
|
+
const p = k.vertexPosition(vertices.get(0));
|
|
3787
|
+
try {
|
|
3788
|
+
return [
|
|
3789
|
+
p.get(0) - center[0],
|
|
3790
|
+
p.get(1) - center[1],
|
|
3791
|
+
p.get(2) - center[2]
|
|
3792
|
+
];
|
|
3793
|
+
} finally {
|
|
3794
|
+
p.delete();
|
|
3795
|
+
}
|
|
3796
|
+
} finally {
|
|
3797
|
+
for (let i = 0; i < vertices.size(); i++) k.release(vertices.get(i));
|
|
3798
|
+
vertices.delete();
|
|
3799
|
+
}
|
|
3800
|
+
}
|
|
3801
|
+
/** Angle about `normal` that turns `from` onto `xDir` projected into the ellipse plane. */
|
|
3802
|
+
function angleToXDir(from, normal, xDir) {
|
|
3803
|
+
const nLen = Math.hypot(...normal);
|
|
3804
|
+
const n = normal.map((v) => v / nLen);
|
|
3805
|
+
const along = xDir[0] * n[0] + xDir[1] * n[1] + xDir[2] * n[2];
|
|
3806
|
+
const xp = xDir.map((v, i) => v - along * (n[i] ?? 0));
|
|
3807
|
+
if (Math.hypot(...xp) < 1e-12 * Math.max(1, Math.hypot(...xDir))) throw new Error("occt-wasm: ellipse xDir is parallel to the normal");
|
|
3808
|
+
const cross = [
|
|
3809
|
+
from[1] * xp[2] - from[2] * xp[1],
|
|
3810
|
+
from[2] * xp[0] - from[0] * xp[2],
|
|
3811
|
+
from[0] * xp[1] - from[1] * xp[0]
|
|
3812
|
+
];
|
|
3813
|
+
const sin = cross[0] * n[0] + cross[1] * n[1] + cross[2] * n[2];
|
|
3814
|
+
const cos = from[0] * xp[0] + from[1] * xp[1] + from[2] * xp[2];
|
|
3815
|
+
return Math.atan2(sin, cos);
|
|
3816
|
+
}
|
|
3817
|
+
/** Rotate `id` about the ellipse axis, releasing it; returns the rotated id. */
|
|
3818
|
+
function turnAboutAxis(k, id, center, normal, angle) {
|
|
3819
|
+
if (Math.abs(angle) < 1e-12) return id;
|
|
3820
|
+
try {
|
|
3821
|
+
return k.rotate(id, ...center, ...normal, angle);
|
|
3822
|
+
} finally {
|
|
3823
|
+
k.release(id);
|
|
3824
|
+
}
|
|
3825
|
+
}
|
|
3826
|
+
function makeEllipseEdge(k, center, normal, majorRadius, minorRadius, xDir) {
|
|
3827
|
+
const id = rawEllipse(k, center, normal, majorRadius, minorRadius);
|
|
3828
|
+
if (!xDir) return handle("edge", id);
|
|
3829
|
+
let angle;
|
|
3830
|
+
try {
|
|
3831
|
+
angle = angleToXDir(defaultMajorAxis(k, id, center), normal, xDir);
|
|
3832
|
+
} catch (e) {
|
|
3833
|
+
k.release(id);
|
|
3834
|
+
throw e;
|
|
3835
|
+
}
|
|
3836
|
+
return handle("edge", turnAboutAxis(k, id, center, normal, angle));
|
|
3837
|
+
}
|
|
3838
|
+
function makeEllipseArc(k, center, normal, majorRadius, minorRadius, startAngle, endAngle, xDir) {
|
|
3839
|
+
const arc = () => k.makeEllipseArc(...center, ...normal, majorRadius, minorRadius, startAngle, endAngle);
|
|
3840
|
+
if (!xDir) return handle("edge", arc());
|
|
3841
|
+
if (k.makeEllipseArcOriented) return handle("edge", k.makeEllipseArcOriented(...center, ...normal, ...xDir, majorRadius, minorRadius, startAngle, endAngle));
|
|
3842
|
+
const probe = rawEllipse(k, center, normal, majorRadius, minorRadius);
|
|
3843
|
+
let angle;
|
|
3844
|
+
try {
|
|
3845
|
+
angle = angleToXDir(defaultMajorAxis(k, probe, center), normal, xDir);
|
|
3846
|
+
} finally {
|
|
3847
|
+
k.release(probe);
|
|
3848
|
+
}
|
|
3849
|
+
return handle("edge", turnAboutAxis(k, arc(), center, normal, angle));
|
|
3748
3850
|
}
|
|
3749
3851
|
function makeBezierEdge(k, Module, points) {
|
|
3750
3852
|
const flat = [];
|
|
@@ -4836,7 +4938,7 @@ function filletWithHistory(k, Module, shape, edges, radius, inputFaceHashes, has
|
|
|
4836
4938
|
const edgeVec = makeVecU32(Module, edges.map(unwrap));
|
|
4837
4939
|
const hashVec = makeVecInt(Module, inputFaceHashes);
|
|
4838
4940
|
try {
|
|
4839
|
-
const { id, evolution } = parseEvolution(k.filletWithHistory(unwrap(shape), edgeVec, r, hashVec, hashUpperBound));
|
|
4941
|
+
const { id, evolution } = parseEvolution(reportingFaultyEdges(edges, () => k.filletWithHistory(unwrap(shape), edgeVec, r, hashVec, hashUpperBound)));
|
|
4840
4942
|
return {
|
|
4841
4943
|
shape: wrapResult(k, id),
|
|
4842
4944
|
evolution
|
|
@@ -4851,7 +4953,7 @@ function chamferWithHistory(k, Module, shape, edges, distance, inputFaceHashes,
|
|
|
4851
4953
|
const edgeVec = makeVecU32(Module, edges.map(unwrap));
|
|
4852
4954
|
const hashVec = makeVecInt(Module, inputFaceHashes);
|
|
4853
4955
|
try {
|
|
4854
|
-
const { id, evolution } = parseEvolution(k.chamferWithHistory(unwrap(shape), edgeVec, d, hashVec, hashUpperBound));
|
|
4956
|
+
const { id, evolution } = parseEvolution(reportingFaultyEdges(edges, () => k.chamferWithHistory(unwrap(shape), edgeVec, d, hashVec, hashUpperBound)));
|
|
4855
4957
|
return {
|
|
4856
4958
|
shape: wrapResult(k, id),
|
|
4857
4959
|
evolution
|
|
@@ -5142,11 +5244,11 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
5142
5244
|
makeArcEdge(p1, p2, p3) {
|
|
5143
5245
|
return makeArcEdge(this.k, p1, p2, p3);
|
|
5144
5246
|
}
|
|
5145
|
-
makeEllipseEdge(center, normal, majorRadius, minorRadius,
|
|
5146
|
-
return makeEllipseEdge(this.k, center, normal, majorRadius, minorRadius);
|
|
5247
|
+
makeEllipseEdge(center, normal, majorRadius, minorRadius, xDir) {
|
|
5248
|
+
return makeEllipseEdge(this.k, center, normal, majorRadius, minorRadius, xDir);
|
|
5147
5249
|
}
|
|
5148
|
-
makeEllipseArc(center, normal, majorRadius, minorRadius, startAngle, endAngle,
|
|
5149
|
-
return makeEllipseArc(this.k, center, normal, majorRadius, minorRadius, startAngle, endAngle);
|
|
5250
|
+
makeEllipseArc(center, normal, majorRadius, minorRadius, startAngle, endAngle, xDir) {
|
|
5251
|
+
return makeEllipseArc(this.k, center, normal, majorRadius, minorRadius, startAngle, endAngle, xDir);
|
|
5150
5252
|
}
|
|
5151
5253
|
makeBezierEdge(points) {
|
|
5152
5254
|
return makeBezierEdge(this.k, this.Module, points);
|
|
@@ -5936,6 +6038,12 @@ Object.defineProperty(exports, "evaluateCurve2d", {
|
|
|
5936
6038
|
return evaluateCurve2d$1;
|
|
5937
6039
|
}
|
|
5938
6040
|
});
|
|
6041
|
+
Object.defineProperty(exports, "faultyEdgeIndexesOf", {
|
|
6042
|
+
enumerable: true,
|
|
6043
|
+
get: function() {
|
|
6044
|
+
return faultyEdgeIndexesOf;
|
|
6045
|
+
}
|
|
6046
|
+
});
|
|
5939
6047
|
Object.defineProperty(exports, "intersectCurves2dFn", {
|
|
5940
6048
|
enumerable: true,
|
|
5941
6049
|
get: function() {
|
package/dist/operations.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_threadFns = require("./threadFns-
|
|
3
|
-
const require_loftFns = require("./loftFns-
|
|
2
|
+
const require_threadFns = require("./threadFns-DO9SkBPb.cjs");
|
|
3
|
+
const require_loftFns = require("./loftFns-tGsV_hHY.cjs");
|
|
4
4
|
exports.addChild = require_threadFns.addChild;
|
|
5
5
|
exports.addJoint = require_threadFns.addJoint;
|
|
6
6
|
exports.addStep = require_threadFns.addStep;
|
package/dist/operations.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as setJointValue, B as walkAssembly, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, F as countNodes, H as circularPattern, I as createAssemblyNode, L as findNode, M as sphericalJoint, N as addChild, O as prismaticJoint, P as collectShapes, R as removeChild, S as addJoint, T as jointTransform, U as gridPattern, V as exportAssemblySTEP, W as linearPattern, Y as createAssembly, _ as exportURDF, b as inverseKinematics, c as modifyStep, d as replayFrom, f as replayHistory, g as undoLast, h as stepsFrom, i as createRegistry, j as setJointValues, k as revoluteJoint, l as registerOperation, m as stepCount, n as addStep, o as findStep, r as createHistory, s as getShape, t as thread, u as registerShape, v as importURDF, w as forwardKinematics, x as jointTrajectory, y as jointsFromDH, z as updateNode } from "./threadFns-
|
|
2
|
-
import { c as twistExtrude, o as supportExtrude, r as complexExtrude, s as sweep } from "./loftFns-
|
|
1
|
+
import { A as setJointValue, B as walkAssembly, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, F as countNodes, H as circularPattern, I as createAssemblyNode, L as findNode, M as sphericalJoint, N as addChild, O as prismaticJoint, P as collectShapes, R as removeChild, S as addJoint, T as jointTransform, U as gridPattern, V as exportAssemblySTEP, W as linearPattern, Y as createAssembly, _ as exportURDF, b as inverseKinematics, c as modifyStep, d as replayFrom, f as replayHistory, g as undoLast, h as stepsFrom, i as createRegistry, j as setJointValues, k as revoluteJoint, l as registerOperation, m as stepCount, n as addStep, o as findStep, r as createHistory, s as getShape, t as thread, u as registerShape, v as importURDF, w as forwardKinematics, x as jointTrajectory, y as jointsFromDH, z as updateNode } from "./threadFns-DWMumhmK.js";
|
|
2
|
+
import { c as twistExtrude, o as supportExtrude, r as complexExtrude, s as sweep } from "./loftFns-DIsFP0VL.js";
|
|
3
3
|
export { addChild, addJoint, addStep, circularPattern, collectShapes, complexExtrude, countNodes, createAssembly, createAssemblyNode, createHistory, createRegistry, cylindricalJoint, exportAssemblySTEP, exportURDF, findNode, findStep, forwardKinematics, getShape as getHistoryShape, gridPattern, importURDF, inverseKinematics, jointTrajectory, jointTransform, jointsFromDH, linearPattern, mechanismDOF, modifyStep, planarJoint, prismaticJoint, registerOperation, registerShape, removeChild, replayFrom, replayHistory, revoluteJoint, setJointValue, setJointValues, sphericalJoint, stepCount, stepsFrom, supportExtrude, sweep, thread, twistExtrude, undoLast, updateNode, walkAssembly };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { q as getKernel } from "./shapeTypes-
|
|
2
|
-
import { C as subShapeHashes, c as getFaces, l as getOrCreateCache, r as getCacheEntry } from "./topologyQueryFns-
|
|
1
|
+
import { q as getKernel } from "./shapeTypes-BCy8JI0O.js";
|
|
2
|
+
import { C as subShapeHashes, c as getFaces, l as getOrCreateCache, r as getCacheEntry } from "./topologyQueryFns-Clkdolgd.js";
|
|
3
3
|
import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
|
|
4
4
|
// src/topology/metadata/originTrackingFns.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CNQn1x5H.cjs");
|
|
2
|
+
const require_topologyQueryFns = require("./topologyQueryFns-BwhwOtxv.cjs");
|
|
3
3
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
4
4
|
// src/topology/metadata/originTrackingFns.ts
|
|
5
5
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CNQn1x5H.cjs");
|
|
2
2
|
const require_errors = require("./errors-B9r_Dzs1.cjs");
|
|
3
|
-
const require_validityTypes = require("./validityTypes-
|
|
3
|
+
const require_validityTypes = require("./validityTypes-B_6gRPPO.cjs");
|
|
4
4
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
|
-
const require_solidBuilders = require("./solidBuilders-
|
|
6
|
-
const require_surfaceBuilders = require("./surfaceBuilders-
|
|
5
|
+
const require_solidBuilders = require("./solidBuilders-BN1p303l.cjs");
|
|
6
|
+
const require_surfaceBuilders = require("./surfaceBuilders-C5lz2TNF.cjs");
|
|
7
7
|
// src/topology/transformFns.ts
|
|
8
8
|
/**
|
|
9
9
|
* Immutable shape transforms — translate, rotate, scale, mirror, applyMatrix.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { E as GeometryCleanupError, G as _usingCtx, d as createSolid, n as castResultShape, q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { E as GeometryCleanupError, G as _usingCtx, d as createSolid, n as castResultShape, q as getKernel } from "./shapeTypes-BCy8JI0O.js";
|
|
2
2
|
import { E as ok, d as validationError, g as err, m as andThen, t as BrepErrorCode } from "./errors-CUsZRWJ7.js";
|
|
3
|
-
import { n as isClosedWire } from "./validityTypes-
|
|
3
|
+
import { n as isClosedWire } from "./validityTypes-txYFYYN6.js";
|
|
4
4
|
import { n as HASH_CODE_MAX, t as DEG2RAD } from "./constants-iraOnb2p.js";
|
|
5
|
-
import { C as propagateAllMetadata, S as hasAnyMetadata, T as propagateMetadataThroughRelocation, a as makeOffset, c as makeTorus, i as makeEllipsoid, l as makeVertex, n as makeCone, o as makeSolid, r as makeCylinder, s as makeSphere, t as makeCompound, u as weldShellsAndFaces, w as propagateMetadataByHash, x as collectInputFaceHashes } from "./solidBuilders-
|
|
6
|
-
import { _ as makeThreePointArc, a as makeNonPlanarFace, c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, g as makeTangentArc, h as makeLine, i as makeNewFaceWithinFace, m as makeHelix, o as makePolygon, p as makeEllipseArc, r as makeFace, s as assembleWire, t as addHolesInFace, u as makeBezierCurve } from "./surfaceBuilders-
|
|
5
|
+
import { C as propagateAllMetadata, S as hasAnyMetadata, T as propagateMetadataThroughRelocation, a as makeOffset, c as makeTorus, i as makeEllipsoid, l as makeVertex, n as makeCone, o as makeSolid, r as makeCylinder, s as makeSphere, t as makeCompound, u as weldShellsAndFaces, w as propagateMetadataByHash, x as collectInputFaceHashes } from "./solidBuilders-YbLOfWIp.js";
|
|
6
|
+
import { _ as makeThreePointArc, a as makeNonPlanarFace, c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, g as makeTangentArc, h as makeLine, i as makeNewFaceWithinFace, m as makeHelix, o as makePolygon, p as makeEllipseArc, r as makeFace, s as assembleWire, t as addHolesInFace, u as makeBezierCurve } from "./surfaceBuilders-CaN-lye8.js";
|
|
7
7
|
// src/topology/transformFns.ts
|
|
8
8
|
/**
|
|
9
9
|
* Immutable shape transforms — translate, rotate, scale, mirror, applyMatrix.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CNQn1x5H.cjs");
|
|
2
2
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
3
3
|
const require_errors = require("./errors-B9r_Dzs1.cjs");
|
|
4
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-BwhwOtxv.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
|
6
|
-
const require_measureFns = require("./measureFns-
|
|
6
|
+
const require_measureFns = require("./measureFns-BoNCUOKe.cjs");
|
|
7
7
|
// src/measurement/principalBoxFns.ts
|
|
8
8
|
/**
|
|
9
9
|
* Principal-axes bounding box: a solid's extent measured in the frame of its
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { G as _usingCtx, n as castResultShape, q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { G as _usingCtx, n as castResultShape, q as getKernel } from "./shapeTypes-BCy8JI0O.js";
|
|
2
2
|
import { i as wasmIndex } from "./bug-ClMTAJhe.js";
|
|
3
3
|
import { E as ok, d as validationError, g as err, t as BrepErrorCode, u as unsupportedError } from "./errors-CUsZRWJ7.js";
|
|
4
|
-
import { E as kernelCallRaw, S as subShapeCount } from "./topologyQueryFns-
|
|
4
|
+
import { E as kernelCallRaw, S as subShapeCount } from "./topologyQueryFns-Clkdolgd.js";
|
|
5
5
|
import { r as vecCross } from "./vecOps-S-m9H_fe.js";
|
|
6
|
-
import { f as getCachedMeasurement, p as setCachedMeasurement } from "./measureFns-
|
|
6
|
+
import { f as getCachedMeasurement, p as setCachedMeasurement } from "./measureFns-eCuwj0im.js";
|
|
7
7
|
// src/measurement/principalBoxFns.ts
|
|
8
8
|
/**
|
|
9
9
|
* Principal-axes bounding box: a solid's extent measured in the frame of its
|
package/dist/projection.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_cameraFns = require("./cameraFns-
|
|
2
|
+
const require_cameraFns = require("./cameraFns-HpsMe1iL.cjs");
|
|
3
3
|
exports.PROJECTION_PLANES = require_cameraFns.PROJECTION_PLANES;
|
|
4
4
|
exports.cameraFromPlane = require_cameraFns.cameraFromPlane;
|
|
5
5
|
exports.cameraLookAt = require_cameraFns.cameraLookAt;
|
package/dist/projection.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { o as PROJECTION_PLANES, t as cameraFromPlane, n as cameraLookAt, r as createCamera, s as isProjectionPlane, a as makeProjectedEdges, i as projectEdges } from "./cameraFns-
|
|
1
|
+
export { o as PROJECTION_PLANES, t as cameraFromPlane, n as cameraLookAt, r as createCamera, s as isProjectionPlane, a as makeProjectedEdges, i as projectEdges } from "./cameraFns-CAjuoPKb.js";
|
package/dist/query.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_helpers = require("./helpers-
|
|
3
|
-
const require_cornerFinder = require("./cornerFinder-
|
|
2
|
+
const require_helpers = require("./helpers-BIpWypkW.cjs");
|
|
3
|
+
const require_cornerFinder = require("./cornerFinder-DVHtBOzM.cjs");
|
|
4
4
|
exports.cornerFinder = require_cornerFinder.cornerFinder;
|
|
5
5
|
exports.edgeFinder = require_helpers.edgeFinder;
|
|
6
6
|
exports.faceFinder = require_helpers.faceFinder;
|
package/dist/query.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-
|
|
2
|
-
import { t as cornerFinder } from "./cornerFinder-
|
|
1
|
+
import { n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-CcZp3tLI.js";
|
|
2
|
+
import { t as cornerFinder } from "./cornerFinder-DHg0ej_Q.js";
|
|
3
3
|
export { cornerFinder, edgeFinder, faceFinder, getSingleFace };
|
package/dist/quick.js
CHANGED
|
@@ -4,8 +4,9 @@ import { initFromOC, registerKernel, OcctWasmAdapter } from './brepjs.js';
|
|
|
4
4
|
// The specifier is passed through a variable so the import() argument is never a
|
|
5
5
|
// string literal: a computed dynamic import is unanalyzable to every bundler, so
|
|
6
6
|
// an uninstalled optional peer is left as a runtime import instead of breaking a
|
|
7
|
-
// consumer's Vite dep pre-bundling (#1726).
|
|
8
|
-
|
|
7
|
+
// consumer's Vite dep pre-bundling (#1726). webpackIgnore keeps webpack from
|
|
8
|
+
// reporting a "Critical dependency" and stubbing the import out.
|
|
9
|
+
const importBackend = (specifier) => import(/* webpackIgnore: true */ /* @vite-ignore */ specifier);
|
|
9
10
|
try {
|
|
10
11
|
const { OcctKernel } = await importBackend('occt-wasm');
|
|
11
12
|
const kernel = await OcctKernel.init();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { g as disposeTransientSubShape, o as castShapeWithKnownType, q as getKernel } from "./shapeTypes-
|
|
2
|
-
import { c as getFaces, w as vertexPosition } from "./topologyQueryFns-
|
|
3
|
-
import { i as faceGeomType, l as normalAt, r as faceCenter } from "./faceFns-
|
|
1
|
+
import { g as disposeTransientSubShape, o as castShapeWithKnownType, q as getKernel } from "./shapeTypes-BCy8JI0O.js";
|
|
2
|
+
import { c as getFaces, w as vertexPosition } from "./topologyQueryFns-Clkdolgd.js";
|
|
3
|
+
import { i as faceGeomType, l as normalAt, r as faceCenter } from "./faceFns-DKEm5U-p.js";
|
|
4
4
|
import { t as getFaceRoles } from "./faceRoleFns-BPxzQF-n.js";
|
|
5
|
-
import { n as getHashCode } from "./shapeFns-
|
|
6
|
-
import { n as measureArea, s as measureLength } from "./measureFns-
|
|
7
|
-
import { a as facesOfVertex, c as verticesOfFace, i as facesOfEdge, o as sharedEdges, s as verticesOfEdge, t as adjacentFaceHashes } from "./adjacencyFns-
|
|
5
|
+
import { n as getHashCode } from "./shapeFns-De7CbEeQ.js";
|
|
6
|
+
import { n as measureArea, s as measureLength } from "./measureFns-eCuwj0im.js";
|
|
7
|
+
import { a as facesOfVertex, c as verticesOfFace, i as facesOfEdge, o as sharedEdges, s as verticesOfEdge, t as adjacentFaceHashes } from "./adjacencyFns-DG9R99LR.js";
|
|
8
8
|
// src/topology/shapeRef/scoring.ts
|
|
9
9
|
/**
|
|
10
10
|
* Default face scorer combining surface type, normal alignment, centroid proximity,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
-
const require_faceFns = require("./faceFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CNQn1x5H.cjs");
|
|
2
|
+
const require_topologyQueryFns = require("./topologyQueryFns-BwhwOtxv.cjs");
|
|
3
|
+
const require_faceFns = require("./faceFns-vVGf6osa.cjs");
|
|
4
4
|
const require_faceRoleFns = require("./faceRoleFns-Db5bYj4Q.cjs");
|
|
5
|
-
const require_shapeFns = require("./shapeFns-
|
|
6
|
-
const require_measureFns = require("./measureFns-
|
|
7
|
-
const require_adjacencyFns = require("./adjacencyFns-
|
|
5
|
+
const require_shapeFns = require("./shapeFns-CJrIL2CG.cjs");
|
|
6
|
+
const require_measureFns = require("./measureFns-BoNCUOKe.cjs");
|
|
7
|
+
const require_adjacencyFns = require("./adjacencyFns-CS62XPcQ.cjs");
|
|
8
8
|
// src/topology/shapeRef/scoring.ts
|
|
9
9
|
/**
|
|
10
10
|
* Default face scorer combining surface type, normal alignment, centroid proximity,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CNQn1x5H.cjs");
|
|
2
2
|
const require_errors = require("./errors-B9r_Dzs1.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-BwhwOtxv.cjs");
|
|
4
4
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
5
|
// src/topology/shapeFns.ts
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { q as getKernel } from "./shapeTypes-
|
|
1
|
+
import { q as getKernel } from "./shapeTypes-BCy8JI0O.js";
|
|
2
2
|
import { t as BrepErrorCode } from "./errors-CUsZRWJ7.js";
|
|
3
|
-
import { E as kernelCallRaw, T as kernelCall } from "./topologyQueryFns-
|
|
3
|
+
import { E as kernelCallRaw, T as kernelCall } from "./topologyQueryFns-Clkdolgd.js";
|
|
4
4
|
import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
|
|
5
5
|
// src/topology/shapeFns.ts
|
|
6
6
|
/**
|
package/dist/shapeRef.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_refResolveFns = require("./refResolveFns-
|
|
2
|
+
const require_refResolveFns = require("./refResolveFns-DvDeMCVU.cjs");
|
|
3
3
|
exports.assignRoles = require_refResolveFns.assignRoles;
|
|
4
4
|
exports.captureHint = require_refResolveFns.captureHint;
|
|
5
5
|
exports.createDerivedFaceRef = require_refResolveFns.createDerivedFaceRef;
|
package/dist/shapeRef.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { h as assignRoles, g as captureHint, l as createDerivedFaceRef, p as createEdgeRef, _ as createRef, d as createVertexRef, b as defaultScorer, t as isDerivedFaceRef, n as isEdgeRef, r as isFaceRef, i as isLineageRef, a as isVertexRef, u as resolveDerivedFaceRef, m as resolveEdgeRef, o as resolveLineageRef, v as resolveRef, s as resolveRefIn, c as resolveRefParams, f as resolveVertexRef, y as updateRoles } from "./refResolveFns-
|
|
1
|
+
export { h as assignRoles, g as captureHint, l as createDerivedFaceRef, p as createEdgeRef, _ as createRef, d as createVertexRef, b as defaultScorer, t as isDerivedFaceRef, n as isEdgeRef, r as isFaceRef, i as isLineageRef, a as isVertexRef, u as resolveDerivedFaceRef, m as resolveEdgeRef, o as resolveLineageRef, v as resolveRef, s as resolveRefIn, c as resolveRefParams, f as resolveVertexRef, y as updateRoles } from "./refResolveFns-BxvibZPu.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as scaleCurve2d$2, D as quickHull, E as translateCurve2d$2, M as OCCT_CAPABILITIES, O as UnsupportedKernelOperationError, S as rotateCurve2d$2, T as tangentCurve2d, _ as makeCircle2d$2, a as buildAsciiSTL, b as mirrorAcrossAxis, c as createBBox2d, d as deserializeCurve2d$2, f as evaluateCurve2d$2, g as makeBezier2d$2, h as makeArc2dThreePoints, i as DEFAULT_STL_TOLERANCE, j as EXACT_BREP_CAPABILITIES, k as isUnsupportedKernelOperationError, l as curveBounds, m as makeArc2dTangent, o as buildBinarySTL, p as intersectCurves2dFn, r as DEFAULT_STL_ANGULAR_TOLERANCE, s as addCurveToBBox, t as OcctWasmAdapter, u as curveTypeName, v as makeEllipse2d$2, w as serializeCurve2d$2, x as mirrorAtPoint, y as makeLine2d$2 } from "./occtWasmAdapter-ClvPe3OJ.js";
|
|
2
2
|
import { i as wasmIndex, r as vec3At } from "./bug-ClMTAJhe.js";
|
|
3
3
|
// src/kernel/quality.ts
|
|
4
4
|
/**
|
|
@@ -16024,10 +16024,13 @@ var ManifoldAdapter = class {
|
|
|
16024
16024
|
* comment regresses the moment a consumer's Vite pre-bundles brepjs and reflows
|
|
16025
16025
|
* the comment off the specifier (#1726); the `@vite-ignore` here only suppresses
|
|
16026
16026
|
* Vite's "cannot be analyzed" dev warning and its placement no longer affects
|
|
16027
|
-
* correctness.
|
|
16027
|
+
* correctness. `webpackIgnore` does the same for webpack, which otherwise
|
|
16028
|
+
* reports a "Critical dependency" on every compile and replaces the import
|
|
16029
|
+
* with an empty context that can never resolve.
|
|
16028
16030
|
*/
|
|
16029
16031
|
function importOptionalBackend(specifier) {
|
|
16030
16032
|
return import(
|
|
16033
|
+
/* webpackIgnore: true */
|
|
16031
16034
|
/* @vite-ignore */
|
|
16032
16035
|
specifier
|
|
16033
16036
|
);
|