brepjs 20.8.0 → 20.10.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.cjs +7 -7
- package/dist/2d.js +7 -7
- package/dist/{adjacencyFns-_RTYhwtD.cjs → adjacencyFns-DaKzrm6n.cjs} +3 -3
- package/dist/{adjacencyFns-BgJQQjdt.js → adjacencyFns-QlyPpWhd.js} +3 -3
- package/dist/{blueprint-wq2TU1XP.cjs → blueprint-BwUhy-0u.cjs} +7 -7
- package/dist/{blueprint-Bth4EVaO.js → blueprint-T5IMurrv.js} +7 -7
- package/dist/{blueprintFns-DQmNe1p6.js → blueprintFns-CZ_RJTYB.js} +3 -3
- package/dist/{blueprintFns-Dd0gm1rX.cjs → blueprintFns-DCWiQOnn.cjs} +3 -3
- package/dist/{blueprintSketcher-CSDqr27-.cjs → blueprintSketcher-DDA1AcP5.cjs} +4 -4
- package/dist/{blueprintSketcher-DNp87aQZ.js → blueprintSketcher-ZHeS6RGQ.js} +4 -4
- package/dist/{boolean2D-BAb4SnIL.js → boolean2D-CCYpepZs.js} +5 -5
- package/dist/{boolean2D-BkgOjMRt.cjs → boolean2D-CVkehTYy.cjs} +5 -5
- package/dist/brepjs.cjs +59 -93
- package/dist/brepjs.js +59 -94
- package/dist/{cameraFns-CKUN90f_.cjs → cameraFns-C4vnJuVn.cjs} +4 -4
- package/dist/{cameraFns-9AGyuZVp.js → cameraFns-CYdit3jH.js} +4 -4
- package/dist/core/errors.d.ts +3 -0
- package/dist/core.cjs +4 -4
- package/dist/core.js +4 -4
- package/dist/{cornerFinder-DJWo6h1Z.cjs → cornerFinder-B6d-A7bA.cjs} +1 -1
- package/dist/{cornerFinder-Cr_04etw.js → cornerFinder-pBdrMPZ0.js} +1 -1
- package/dist/{curveFns-CkA2WJP2.js → curveFns-BEHgd_lK.js} +2 -2
- package/dist/{curveFns-U7srQ3ZA.cjs → curveFns-MO2zNRPy.cjs} +2 -2
- package/dist/{drawFns-DlCxozRP.cjs → drawFns-BqQWEJAY.cjs} +14 -14
- package/dist/{drawFns-C6bmFijD.js → drawFns-CxsE55au.js} +14 -14
- package/dist/{errors-GVyCnpi0.cjs → errors-B9r_Dzs1.cjs} +3 -0
- package/dist/{errors-vxP5FT8B.js → errors-CUsZRWJ7.js} +3 -0
- package/dist/{faceFns-DSRREV5G.cjs → faceFns-FpT-Ap5E.cjs} +3 -3
- package/dist/{faceFns-BBk6XKJO.js → faceFns-pZvWlzpX.js} +3 -3
- package/dist/{healingFns-CEr0afli.js → healingFns-DO4iNGRY.js} +134 -13
- package/dist/{healingFns-C9G3yjOe.cjs → healingFns-x0-D6Rh1.cjs} +139 -12
- package/dist/{helpers-sDialr0f.js → helpers-B4k3UskG.js} +7 -7
- package/dist/{helpers-JuPoaP_b.cjs → helpers-Dzq_vAO5.cjs} +7 -7
- package/dist/{importFns-ClqPJCFR.cjs → importFns-CeHEdOsm.cjs} +3 -3
- package/dist/{importFns-DSUfSQn2.js → importFns-CmZ-MW_q.js} +3 -3
- package/dist/index.d.ts +1 -1
- 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 +18 -2
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/kernel/occtWasm/occtWasmTypes.d.ts +2 -0
- package/dist/{loftFns-B8DSoG-F.js → loftFns--HPa9bzA.js} +2 -2
- package/dist/{loftFns-mkJeOaII.cjs → loftFns-BAdVToS1.cjs} +2 -2
- package/dist/{measureFns-PRM3gOjw.js → measureFns-BFUFjzym.js} +4 -4
- package/dist/{measureFns-BvNkzSR6.cjs → measureFns-DugGNpl1.cjs} +4 -4
- package/dist/measurement.cjs +2 -2
- package/dist/measurement.js +2 -2
- package/dist/{meshFns-CgbT3uuO.js → meshFns-U0q7DxYW.js} +4 -4
- package/dist/{meshFns-W7ZTKqiJ.cjs → meshFns-p-lwZsSo.cjs} +4 -4
- package/dist/ns/modifiers.d.ts +1 -1
- package/dist/{occtWasmAdapter-PzZJHUAd.js → occtWasmAdapter-ClvPe3OJ.js} +135 -13
- package/dist/{occtWasmAdapter-BSQeA69d.cjs → occtWasmAdapter-CsDULjij.cjs} +140 -12
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{originTrackingFns-DJDTRJh3.cjs → originTrackingFns-BisDJwJu.cjs} +2 -2
- package/dist/{originTrackingFns-D8SNCDKj.js → originTrackingFns-CIeKNLsH.js} +2 -2
- package/dist/{planeOps-C9d2Y56B.cjs → planeOps-C7sRqzno.cjs} +1 -1
- package/dist/{planeOps-Dp0YvuFE.js → planeOps-DgG0vHN7.js} +1 -1
- package/dist/{primitiveFns-EtHyTqhw.cjs → primitiveFns-Cw9q1eOL.cjs} +5 -5
- package/dist/{primitiveFns-W3RYNJcm.js → primitiveFns-DdSWvgfC.js} +5 -5
- package/dist/{principalBoxFns-Cbtty-2_.js → principalBoxFns-CjY_nvEs.js} +4 -4
- package/dist/{principalBoxFns-CmZa7qHi.cjs → principalBoxFns-TMr0eTjD.cjs} +4 -4
- 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-BkciKtNP.js → refResolveFns-0B1rrAx8.js} +6 -6
- package/dist/{refResolveFns-D99Vqe7a.cjs → refResolveFns-DAP4mI9C.cjs} +6 -6
- package/dist/result.cjs +1 -1
- package/dist/result.js +1 -1
- package/dist/{shapeFns-B54CsPyk.cjs → shapeFns-Bebgp5OO.cjs} +3 -3
- package/dist/{shapeFns-DB3l3ULC.js → shapeFns-ioHfSlPu.js} +3 -3
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-CgbUTASh.js → shapeTypes-Cj2qNze9.js} +1 -1
- package/dist/{shapeTypes-D_anqiRe.cjs → shapeTypes-ExC90tMw.cjs} +1 -1
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-DE_na4G3.js → solidBuilders-Ci8YWRBI.js} +7 -7
- package/dist/{solidBuilders-CUd-korS.cjs → solidBuilders-kq8rSMtF.cjs} +7 -7
- package/dist/{surfaceBuilders-wdGNiImD.js → surfaceBuilders-ANbHa5lb.js} +4 -4
- package/dist/{surfaceBuilders-DOn2jWkh.cjs → surfaceBuilders-BNU35xbA.cjs} +4 -4
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-B_jwMuej.js → textBlueprints-8cjvJO_y.js} +9 -9
- package/dist/{textBlueprints-BQ60Rc96.cjs → textBlueprints-v-gM2QiP.cjs} +9 -9
- package/dist/{textMetrics-Dj3yfZNQ.js → textMetrics-BXB9uWYC.js} +2 -2
- package/dist/{textMetrics-Bm0a4kh7.cjs → textMetrics-DwwRGGEU.cjs} +2 -2
- package/dist/{threadFns-BuRPVenB.cjs → threadFns-C9MTJubY.cjs} +8 -8
- package/dist/{threadFns-DlL5VnMf.js → threadFns-D6rqmZ3W.js} +8 -8
- package/dist/topology/api.d.ts +2 -0
- package/dist/topology/modifierFns.d.ts +14 -0
- package/dist/topology/wrapperFns.d.ts +1 -0
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-6M_dbT1R.js → topologyQueryFns-C552gkmo.js} +2 -2
- package/dist/{topologyQueryFns-ENxs8uu2.cjs → topologyQueryFns-DYbxJ2Hy.cjs} +2 -2
- package/dist/{validityTypes-BPamqRZ8.cjs → validityTypes-BDbTFKtx.cjs} +2 -2
- package/dist/{validityTypes-BTuI0vcR.js → validityTypes-C5Zt145z.js} +2 -2
- package/dist/vectors.cjs +1 -1
- package/dist/vectors.js +1 -1
- package/package.json +2 -2
|
@@ -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-ExC90tMw.cjs");
|
|
2
|
+
const require_errors = require("./errors-B9r_Dzs1.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-DYbxJ2Hy.cjs");
|
|
4
|
+
const require_faceFns = require("./faceFns-FpT-Ap5E.cjs");
|
|
5
5
|
// src/measurement/measureCache.ts
|
|
6
6
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function getCachedMeasurement(shape, key) {
|
package/dist/measurement.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_measureFns = require("./measureFns-
|
|
3
|
-
const require_principalBoxFns = require("./principalBoxFns-
|
|
2
|
+
const require_measureFns = require("./measureFns-DugGNpl1.cjs");
|
|
3
|
+
const require_principalBoxFns = require("./principalBoxFns-TMr0eTjD.cjs");
|
|
4
4
|
exports.createDistanceQuery = require_measureFns.createDistanceQuery;
|
|
5
5
|
exports.measureArea = require_measureFns.measureArea;
|
|
6
6
|
exports.measureDistance = require_measureFns.measureDistance;
|
package/dist/measurement.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
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-
|
|
2
|
-
import { t as principalBoundingBox } from "./principalBoxFns-
|
|
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-BFUFjzym.js";
|
|
2
|
+
import { t as principalBoundingBox } from "./principalBoxFns-CjY_nvEs.js";
|
|
3
3
|
export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps, principalBoundingBox };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { q as getKernel, ut as qualityDeflection } from "./shapeTypes-
|
|
2
|
-
import { E as ok, g as err, r as ioError } from "./errors-
|
|
3
|
-
import { d as getSolids, n as getBounds } from "./topologyQueryFns-
|
|
4
|
-
import { t as getFaceOrigins } from "./originTrackingFns-
|
|
1
|
+
import { q as getKernel, ut as qualityDeflection } from "./shapeTypes-Cj2qNze9.js";
|
|
2
|
+
import { E as ok, g as err, r as ioError } from "./errors-CUsZRWJ7.js";
|
|
3
|
+
import { d as getSolids, n as getBounds } from "./topologyQueryFns-C552gkmo.js";
|
|
4
|
+
import { t as getFaceOrigins } from "./originTrackingFns-CIeKNLsH.js";
|
|
5
5
|
// src/topology/meshCache.ts
|
|
6
6
|
/**
|
|
7
7
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
|
@@ -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_originTrackingFns = require("./originTrackingFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-ExC90tMw.cjs");
|
|
2
|
+
const require_errors = require("./errors-B9r_Dzs1.cjs");
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-DYbxJ2Hy.cjs");
|
|
4
|
+
const require_originTrackingFns = require("./originTrackingFns-BisDJwJu.cjs");
|
|
5
5
|
// src/topology/meshCache.ts
|
|
6
6
|
/**
|
|
7
7
|
* Build a parameter key for the inner cache map (excludes shape identity).
|
package/dist/ns/modifiers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Namespace: modifiers — shape modification operations
|
|
3
3
|
*/
|
|
4
|
-
export { fillet, chamfer, shell, offset, thicken, draft, heal, simplify } from '../topology/api.js';
|
|
4
|
+
export { fillet, chamfer, shell, removeFaces, offset, thicken, draft, heal, simplify, } from '../topology/api.js';
|
|
5
5
|
export { variableFillet } from '../topology/modifierFns.js';
|
|
@@ -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
|
|
@@ -5017,6 +5119,26 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
5017
5119
|
get retainedKernelOwner() {
|
|
5018
5120
|
return this.owner;
|
|
5019
5121
|
}
|
|
5122
|
+
/**
|
|
5123
|
+
* Bring a shape built through occt-wasm's own `OcctKernel` (the kernel this
|
|
5124
|
+
* adapter wraps) into brepjs without a BREP round trip:
|
|
5125
|
+
* `castShape(adapter.adoptShape(id))`.
|
|
5126
|
+
*
|
|
5127
|
+
* brepjs takes ownership of the arena slot and frees it when the shape is
|
|
5128
|
+
* disposed or collected, so do not also `release(id)` it through `OcctKernel`.
|
|
5129
|
+
*/
|
|
5130
|
+
adoptShape(id) {
|
|
5131
|
+
return wrapResult(this.k, id);
|
|
5132
|
+
}
|
|
5133
|
+
/**
|
|
5134
|
+
* The occt-wasm arena id behind a brepjs shape (`adapter.shapeId(solid.wrapped)`),
|
|
5135
|
+
* for passing it to `OcctKernel` calls. The id stays owned by brepjs: it is
|
|
5136
|
+
* valid until the brepjs shape is disposed, and must not be released through
|
|
5137
|
+
* `OcctKernel`.
|
|
5138
|
+
*/
|
|
5139
|
+
shapeId(shape) {
|
|
5140
|
+
return unwrap(shape);
|
|
5141
|
+
}
|
|
5020
5142
|
dispose(h) {
|
|
5021
5143
|
if (isOcctWasmHandle(h)) this.k.release(h.id);
|
|
5022
5144
|
else if (typeof h.delete === "function") h.delete();
|
|
@@ -5122,11 +5244,11 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
5122
5244
|
makeArcEdge(p1, p2, p3) {
|
|
5123
5245
|
return makeArcEdge(this.k, p1, p2, p3);
|
|
5124
5246
|
}
|
|
5125
|
-
makeEllipseEdge(center, normal, majorRadius, minorRadius,
|
|
5126
|
-
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);
|
|
5127
5249
|
}
|
|
5128
|
-
makeEllipseArc(center, normal, majorRadius, minorRadius, startAngle, endAngle,
|
|
5129
|
-
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);
|
|
5130
5252
|
}
|
|
5131
5253
|
makeBezierEdge(points) {
|
|
5132
5254
|
return makeBezierEdge(this.k, this.Module, points);
|
|
@@ -5826,4 +5948,4 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
5826
5948
|
return getNurbsCurveData(this.k, edge);
|
|
5827
5949
|
}
|
|
5828
5950
|
};
|
|
5829
|
-
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
|
|
@@ -5017,6 +5119,26 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
5017
5119
|
get retainedKernelOwner() {
|
|
5018
5120
|
return this.owner;
|
|
5019
5121
|
}
|
|
5122
|
+
/**
|
|
5123
|
+
* Bring a shape built through occt-wasm's own `OcctKernel` (the kernel this
|
|
5124
|
+
* adapter wraps) into brepjs without a BREP round trip:
|
|
5125
|
+
* `castShape(adapter.adoptShape(id))`.
|
|
5126
|
+
*
|
|
5127
|
+
* brepjs takes ownership of the arena slot and frees it when the shape is
|
|
5128
|
+
* disposed or collected, so do not also `release(id)` it through `OcctKernel`.
|
|
5129
|
+
*/
|
|
5130
|
+
adoptShape(id) {
|
|
5131
|
+
return wrapResult(this.k, id);
|
|
5132
|
+
}
|
|
5133
|
+
/**
|
|
5134
|
+
* The occt-wasm arena id behind a brepjs shape (`adapter.shapeId(solid.wrapped)`),
|
|
5135
|
+
* for passing it to `OcctKernel` calls. The id stays owned by brepjs: it is
|
|
5136
|
+
* valid until the brepjs shape is disposed, and must not be released through
|
|
5137
|
+
* `OcctKernel`.
|
|
5138
|
+
*/
|
|
5139
|
+
shapeId(shape) {
|
|
5140
|
+
return unwrap(shape);
|
|
5141
|
+
}
|
|
5020
5142
|
dispose(h) {
|
|
5021
5143
|
if (isOcctWasmHandle(h)) this.k.release(h.id);
|
|
5022
5144
|
else if (typeof h.delete === "function") h.delete();
|
|
@@ -5122,11 +5244,11 @@ var OcctWasmAdapter = class OcctWasmAdapter {
|
|
|
5122
5244
|
makeArcEdge(p1, p2, p3) {
|
|
5123
5245
|
return makeArcEdge(this.k, p1, p2, p3);
|
|
5124
5246
|
}
|
|
5125
|
-
makeEllipseEdge(center, normal, majorRadius, minorRadius,
|
|
5126
|
-
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);
|
|
5127
5249
|
}
|
|
5128
|
-
makeEllipseArc(center, normal, majorRadius, minorRadius, startAngle, endAngle,
|
|
5129
|
-
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);
|
|
5130
5252
|
}
|
|
5131
5253
|
makeBezierEdge(points) {
|
|
5132
5254
|
return makeBezierEdge(this.k, this.Module, points);
|
|
@@ -5916,6 +6038,12 @@ Object.defineProperty(exports, "evaluateCurve2d", {
|
|
|
5916
6038
|
return evaluateCurve2d$1;
|
|
5917
6039
|
}
|
|
5918
6040
|
});
|
|
6041
|
+
Object.defineProperty(exports, "faultyEdgeIndexesOf", {
|
|
6042
|
+
enumerable: true,
|
|
6043
|
+
get: function() {
|
|
6044
|
+
return faultyEdgeIndexesOf;
|
|
6045
|
+
}
|
|
6046
|
+
});
|
|
5919
6047
|
Object.defineProperty(exports, "intersectCurves2dFn", {
|
|
5920
6048
|
enumerable: true,
|
|
5921
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-C9MTJubY.cjs");
|
|
3
|
+
const require_loftFns = require("./loftFns-BAdVToS1.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-D6rqmZ3W.js";
|
|
2
|
+
import { c as twistExtrude, o as supportExtrude, r as complexExtrude, s as sweep } from "./loftFns--HPa9bzA.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
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-ExC90tMw.cjs");
|
|
2
|
+
const require_topologyQueryFns = require("./topologyQueryFns-DYbxJ2Hy.cjs");
|
|
3
3
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
4
4
|
// src/topology/metadata/originTrackingFns.ts
|
|
5
5
|
/**
|
|
@@ -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-Cj2qNze9.js";
|
|
2
|
+
import { C as subShapeHashes, c as getFaces, l as getOrCreateCache, r as getCacheEntry } from "./topologyQueryFns-C552gkmo.js";
|
|
3
3
|
import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
|
|
4
4
|
// src/topology/metadata/originTrackingFns.ts
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_errors = require("./errors-
|
|
1
|
+
const require_errors = require("./errors-B9r_Dzs1.cjs");
|
|
2
2
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
3
3
|
const require_types = require("./types-CjF9Rofr.cjs");
|
|
4
4
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as ok, P as unwrap, d as validationError, g as err } from "./errors-
|
|
1
|
+
import { E as ok, P as unwrap, d as validationError, g as err } from "./errors-CUsZRWJ7.js";
|
|
2
2
|
import { t as DEG2RAD } from "./constants-iraOnb2p.js";
|
|
3
3
|
import { r as toVec3 } from "./types-CKXsIm9-.js";
|
|
4
4
|
import { d as vecNormalize, h as vecScale, m as vecRotate, r as vecCross, s as vecIsZero, t as vecAdd } from "./vecOps-S-m9H_fe.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
2
|
-
const require_errors = require("./errors-
|
|
3
|
-
const require_validityTypes = require("./validityTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-ExC90tMw.cjs");
|
|
2
|
+
const require_errors = require("./errors-B9r_Dzs1.cjs");
|
|
3
|
+
const require_validityTypes = require("./validityTypes-BDbTFKtx.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-kq8rSMtF.cjs");
|
|
6
|
+
const require_surfaceBuilders = require("./surfaceBuilders-BNU35xbA.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-
|
|
2
|
-
import { E as ok, d as validationError, g as err, m as andThen, t as BrepErrorCode } from "./errors-
|
|
3
|
-
import { n as isClosedWire } from "./validityTypes-
|
|
1
|
+
import { E as GeometryCleanupError, G as _usingCtx, d as createSolid, n as castResultShape, q as getKernel } from "./shapeTypes-Cj2qNze9.js";
|
|
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-C5Zt145z.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-Ci8YWRBI.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-ANbHa5lb.js";
|
|
7
7
|
// src/topology/transformFns.ts
|
|
8
8
|
/**
|
|
9
9
|
* Immutable shape transforms — translate, rotate, scale, mirror, applyMatrix.
|
|
@@ -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-Cj2qNze9.js";
|
|
2
2
|
import { i as wasmIndex } from "./bug-ClMTAJhe.js";
|
|
3
|
-
import { E as ok, d as validationError, g as err, t as BrepErrorCode, u as unsupportedError } from "./errors-
|
|
4
|
-
import { E as kernelCallRaw, S as subShapeCount } from "./topologyQueryFns-
|
|
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-C552gkmo.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-BFUFjzym.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
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-ExC90tMw.cjs");
|
|
2
2
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
3
|
-
const require_errors = require("./errors-
|
|
4
|
-
const require_topologyQueryFns = require("./topologyQueryFns-
|
|
3
|
+
const require_errors = require("./errors-B9r_Dzs1.cjs");
|
|
4
|
+
const require_topologyQueryFns = require("./topologyQueryFns-DYbxJ2Hy.cjs");
|
|
5
5
|
const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
|
|
6
|
-
const require_measureFns = require("./measureFns-
|
|
6
|
+
const require_measureFns = require("./measureFns-DugGNpl1.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
|
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-C4vnJuVn.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-CYdit3jH.js";
|