brepjs 20.13.5 → 20.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/2d.cjs +6 -6
- package/dist/2d.js +6 -6
- package/dist/{adjacencyFns-B1ZWTkxw.cjs → adjacencyFns-B6fMyAj0.cjs} +3 -3
- package/dist/{adjacencyFns-XdjXKCXE.js → adjacencyFns-n6XWEyj1.js} +3 -3
- package/dist/{blueprint-WAucCqwY.js → blueprint-2j8szIQ6.js} +5 -5
- package/dist/{blueprint-DzhzGFy2.cjs → blueprint-Cfj9EupK.cjs} +5 -5
- package/dist/{blueprintFns-DnzHyTjv.cjs → blueprintFns-7SWJcrSi.cjs} +2 -2
- package/dist/{blueprintFns-C8gt4OYm.js → blueprintFns-C4VacaAG.js} +2 -2
- package/dist/{blueprintSketcher-CeMrC8k-.js → blueprintSketcher-D81yS5Em.js} +3 -3
- package/dist/{blueprintSketcher-JoLn4vSB.cjs → blueprintSketcher-zx0yhxOF.cjs} +3 -3
- package/dist/{boolean2D-Cwc_4mU8.cjs → boolean2D-BMfzZ4n8.cjs} +4 -4
- package/dist/{boolean2D-D8_6vKh_.js → boolean2D-DhW8iZoR.js} +4 -4
- package/dist/{booleanFns-BhW5eybV.cjs → booleanFns-CaHF13T-.cjs} +5 -5
- package/dist/{booleanFns-aGRfk4ud.js → booleanFns-DIqS3nBK.js} +5 -5
- package/dist/brepjs.cjs +30 -30
- package/dist/brepjs.js +30 -30
- package/dist/{cameraFns-CBc6tpRl.js → cameraFns-DB_nPXR7.js} +3 -3
- package/dist/{cameraFns-DhgM5-Nl.cjs → cameraFns-T60Qk0tk.cjs} +3 -3
- package/dist/core.cjs +2 -2
- package/dist/core.js +2 -2
- package/dist/{cornerFinder-xI6O0ZCv.cjs → cornerFinder-CNuTBfRo.cjs} +1 -1
- package/dist/{cornerFinder-ChkO3EOO.js → cornerFinder-GtiadLBr.js} +1 -1
- package/dist/{curveFns-Cnh0Hljx.js → curveFns-CGQCy_D5.js} +1 -1
- package/dist/{curveFns-Dz36SOE6.cjs → curveFns-m73YVbFb.cjs} +1 -1
- package/dist/{drawFns-RuUOUlSC.js → drawFns-D9GuLtRK.js} +12 -12
- package/dist/{drawFns-BrRyiHKp.cjs → drawFns-DCY1v4nI.cjs} +12 -12
- package/dist/{faceFns-Dz3eRgNR.js → faceFns-BNv6thpF.js} +2 -2
- package/dist/{faceFns-DfEUZlnf.cjs → faceFns-CPGJ_cx6.cjs} +2 -2
- package/dist/{healingFns-D7LTrPO8.cjs → healingFns-D33MBaNA.cjs} +41 -28
- package/dist/{healingFns-CCRPtrvE.js → healingFns-w-PHd-Lj.js} +41 -28
- package/dist/{helpers-C0MoldOO.cjs → helpers-CCnN8-PY.cjs} +6 -6
- package/dist/{helpers-D3oo0Zfs.js → helpers-Ci_WZ5ou.js} +6 -6
- package/dist/{importFns-BVcmm3T0.js → importFns-DQgcQQCb.js} +5 -5
- package/dist/{importFns-Sp5phi5Y.cjs → importFns-zfbC3bIK.cjs} +5 -5
- package/dist/io.cjs +2 -2
- package/dist/io.js +2 -2
- package/dist/kernel/brepkit/brepkitWasmTypes.d.ts +4 -8
- package/dist/kernel/brepkit/constructionOps.d.ts +1 -1
- package/dist/kernel/brepkit/modifierOps.d.ts +3 -3
- package/dist/kernel/occtWasm/helpers.d.ts +12 -2
- package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
- package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
- package/dist/{loftFns-BoGWrMPg.cjs → loftFns-DQJM-35I.cjs} +4 -4
- package/dist/{loftFns-oH6dldzO.js → loftFns-mrTzIf4_.js} +4 -4
- package/dist/{measureFns-CmKNZ0gC.cjs → measureFns-CpoPgAZt.cjs} +4 -4
- package/dist/{measureFns-6mHYvqUc.js → measureFns-MSr05_kf.js} +4 -4
- package/dist/measurement.cjs +2 -2
- package/dist/measurement.js +2 -2
- package/dist/{meshFns-D29JHTr6.js → meshFns-BIWD7IFN.js} +4 -4
- package/dist/{meshFns-BFgQZGty.cjs → meshFns-BxRKwY5z.cjs} +4 -4
- package/dist/{occtWasmAdapter-4YnvqZOW.cjs → occtWasmAdapter-BH1JcAgl.cjs} +13 -5
- package/dist/{occtWasmAdapter-CGsnjMOe.js → occtWasmAdapter-DD_6IAVj.js} +13 -5
- package/dist/operations/sweepFns.d.ts +3 -3
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +2 -2
- package/dist/{primitiveFns-uywjJ06V.js → primitiveFns-BaYEo9qN.js} +5 -5
- package/dist/{primitiveFns-Dovused4.cjs → primitiveFns-D8D9dI_P.cjs} +5 -5
- package/dist/{principalBoxFns-CTVc4f8W.js → principalBoxFns-CBWLch1h.js} +3 -3
- package/dist/{principalBoxFns-KvlaTxMs.cjs → principalBoxFns-CNSK-z3k.cjs} +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/{refResolveFns-BFws5K2t.cjs → refResolveFns-CuewCIRB.cjs} +6 -6
- package/dist/{refResolveFns-DZoPfglj.js → refResolveFns-DaZPev13.js} +6 -6
- package/dist/{shapeFns-CHsoXWeu.js → shapeFns-3NzCE2kz.js} +2 -2
- package/dist/{shapeFns-C9P1KmqH.cjs → shapeFns-Cklw3p3S.cjs} +2 -2
- package/dist/shapeRef.cjs +1 -1
- package/dist/shapeRef.js +1 -1
- package/dist/{shapeTypes-BK53GmLC.cjs → shapeTypes-CgayxMvX.cjs} +195 -37
- package/dist/{shapeTypes-Ckz9bpYW.js → shapeTypes-qhs8f2zx.js} +195 -37
- package/dist/sketching.cjs +3 -3
- package/dist/sketching.js +3 -3
- package/dist/{solidBuilders-CETSjBW2.cjs → solidBuilders-BvIdZUkI.cjs} +3 -3
- package/dist/{solidBuilders-DMfqtfIG.js → solidBuilders-DhDGnOTQ.js} +3 -3
- package/dist/{surfaceBuilders-vKXtKSqY.cjs → surfaceBuilders-BPAW6RbN.cjs} +3 -3
- package/dist/{surfaceBuilders-BeHgAqDx.js → surfaceBuilders-D9WX9gHX.js} +3 -3
- package/dist/text.cjs +2 -2
- package/dist/text.js +2 -2
- package/dist/{textBlueprints-DSiQKpe8.cjs → textBlueprints-CTMykb_E.cjs} +8 -8
- package/dist/{textBlueprints-CLwy1uWM.js → textBlueprints-CxufM4VF.js} +8 -8
- package/dist/{textMetrics-1e-VHhTX.js → textMetrics-CdvERXfK.js} +1 -1
- package/dist/{textMetrics-CzSpui4K.cjs → textMetrics-D51K9Ddx.cjs} +1 -1
- package/dist/{threadFns-DveRUJwK.js → threadFns-BUy4gIG3.js} +7 -7
- package/dist/{threadFns-BEopBSv3.cjs → threadFns-zNevH3kU.cjs} +7 -7
- package/dist/topology/apiTypes.d.ts +2 -4
- package/dist/topology/modifierFns.d.ts +15 -6
- package/dist/topology.cjs +9 -9
- package/dist/topology.js +9 -9
- package/dist/{topologyQueryFns-SINsBrMe.js → topologyQueryFns-CArmw9sE.js} +1 -1
- package/dist/{topologyQueryFns--p_-tywe.cjs → topologyQueryFns-EI-aso9K.cjs} +1 -1
- package/dist/{validityTypes-DPAkV5rC.cjs → validityTypes-DFEPeAkV.cjs} +1 -1
- package/dist/{validityTypes-BCZ8XRzO.js → validityTypes-DiOmm0sf.js} +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_occtWasmAdapter = require("./occtWasmAdapter-
|
|
1
|
+
const require_occtWasmAdapter = require("./occtWasmAdapter-BH1JcAgl.cjs");
|
|
2
2
|
const require_bug = require("./bug-CBcpIPuf.cjs");
|
|
3
3
|
// src/kernel/quality.ts
|
|
4
4
|
/**
|
|
@@ -7278,21 +7278,85 @@ function makeBezierEdge(bk, points) {
|
|
|
7278
7278
|
function makeTangentArc(bk, startPoint, startTangent, endPoint) {
|
|
7279
7279
|
return edgeHandle(bk.makeTangentArc3d(startPoint[0], startPoint[1], startPoint[2], startTangent[0], startTangent[1], startTangent[2], endPoint[0], endPoint[1], endPoint[2]));
|
|
7280
7280
|
}
|
|
7281
|
-
|
|
7281
|
+
/** The X axis occt's `gp_Ax3(P, V)` picks when given only a direction, so a helix starts where occt-wasm's does. */
|
|
7282
|
+
function occtDefaultXDir(a, b, c) {
|
|
7283
|
+
const [aa, ba, ca] = [
|
|
7284
|
+
Math.abs(a),
|
|
7285
|
+
Math.abs(b),
|
|
7286
|
+
Math.abs(c)
|
|
7287
|
+
];
|
|
7288
|
+
let x;
|
|
7289
|
+
if (ba <= aa && ba <= ca) x = aa > ca ? [
|
|
7290
|
+
-c,
|
|
7291
|
+
0,
|
|
7292
|
+
a
|
|
7293
|
+
] : [
|
|
7294
|
+
c,
|
|
7295
|
+
0,
|
|
7296
|
+
-a
|
|
7297
|
+
];
|
|
7298
|
+
else if (aa <= ba && aa <= ca) x = ba > ca ? [
|
|
7299
|
+
0,
|
|
7300
|
+
-c,
|
|
7301
|
+
b
|
|
7302
|
+
] : [
|
|
7303
|
+
0,
|
|
7304
|
+
c,
|
|
7305
|
+
-b
|
|
7306
|
+
];
|
|
7307
|
+
else x = aa > ba ? [
|
|
7308
|
+
-b,
|
|
7309
|
+
a,
|
|
7310
|
+
0
|
|
7311
|
+
] : [
|
|
7312
|
+
b,
|
|
7313
|
+
-a,
|
|
7314
|
+
0
|
|
7315
|
+
];
|
|
7316
|
+
const len = Math.hypot(x[0], x[1], x[2]);
|
|
7317
|
+
return [
|
|
7318
|
+
x[0] / len,
|
|
7319
|
+
x[1] / len,
|
|
7320
|
+
x[2] / len
|
|
7321
|
+
];
|
|
7322
|
+
}
|
|
7323
|
+
function makeHelixWire(bk, pitch, height, radius, center, direction, leftHanded) {
|
|
7282
7324
|
const turns = height / pitch;
|
|
7283
7325
|
const nSamples = Math.max(4, Math.ceil(turns * 16));
|
|
7284
|
-
const cx = center
|
|
7285
|
-
|
|
7286
|
-
|
|
7326
|
+
const [cx, cy, cz] = center ?? [
|
|
7327
|
+
0,
|
|
7328
|
+
0,
|
|
7329
|
+
0
|
|
7330
|
+
];
|
|
7331
|
+
const [dx, dy, dz] = direction ?? [
|
|
7332
|
+
0,
|
|
7333
|
+
0,
|
|
7334
|
+
1
|
|
7335
|
+
];
|
|
7336
|
+
const dLen = Math.hypot(dx, dy, dz);
|
|
7337
|
+
const z = [
|
|
7338
|
+
dx / dLen,
|
|
7339
|
+
dy / dLen,
|
|
7340
|
+
dz / dLen
|
|
7341
|
+
];
|
|
7342
|
+
const x = occtDefaultXDir(z[0], z[1], z[2]);
|
|
7343
|
+
const y = [
|
|
7344
|
+
z[1] * x[2] - z[2] * x[1],
|
|
7345
|
+
z[2] * x[0] - z[0] * x[2],
|
|
7346
|
+
z[0] * x[1] - z[1] * x[0]
|
|
7347
|
+
];
|
|
7287
7348
|
const sign = leftHanded ? -1 : 1;
|
|
7288
7349
|
const points = [];
|
|
7289
7350
|
for (let i = 0; i <= nSamples; i++) {
|
|
7290
7351
|
const t = i / nSamples;
|
|
7291
7352
|
const angle = sign * 2 * Math.PI * turns * t;
|
|
7353
|
+
const u = radius * Math.cos(angle);
|
|
7354
|
+
const v = radius * Math.sin(angle);
|
|
7355
|
+
const h = height * t;
|
|
7292
7356
|
points.push([
|
|
7293
|
-
cx +
|
|
7294
|
-
cy +
|
|
7295
|
-
cz +
|
|
7357
|
+
cx + u * x[0] + v * y[0] + h * z[0],
|
|
7358
|
+
cy + u * x[1] + v * y[1] + h * z[1],
|
|
7359
|
+
cz + u * x[2] + v * y[2] + h * z[2]
|
|
7296
7360
|
]);
|
|
7297
7361
|
}
|
|
7298
7362
|
return makeWire(bk, [interpolatePoints(bk, points)]);
|
|
@@ -7934,45 +7998,80 @@ function fillet(bk, shape, edges, radius) {
|
|
|
7934
7998
|
const solidId = unwrapSolidOrThrow(shape, "fillet");
|
|
7935
7999
|
const edgeIds = edges.map((e) => unwrap$1(e, "edge"));
|
|
7936
8000
|
if (typeof radius === "number") return solidHandle(bk.fillet(solidId, edgeIds, radius));
|
|
7937
|
-
const
|
|
7938
|
-
for (const edge of edges) {
|
|
8001
|
+
const laws = edges.map((edge, i) => {
|
|
7939
8002
|
const r = typeof radius === "function" ? radius(edge) : radius;
|
|
7940
8003
|
const [start, end] = Array.isArray(r) ? r : [r, r];
|
|
7941
|
-
|
|
7942
|
-
|
|
8004
|
+
return {
|
|
8005
|
+
edge: require_bug.wasmIndex(edgeIds, i),
|
|
8006
|
+
start,
|
|
8007
|
+
end
|
|
8008
|
+
};
|
|
8009
|
+
});
|
|
8010
|
+
const [first] = laws;
|
|
8011
|
+
if (!first) throw new Error("brepkit: fillet needs at least one edge");
|
|
8012
|
+
if (laws.every((l) => l.start === first.start && l.end === first.start)) return solidHandle(bk.fillet(solidId, edgeIds, first.start));
|
|
8013
|
+
return filletAlongLaws(bk, solidId, laws);
|
|
8014
|
+
}
|
|
8015
|
+
var lawProbes = /* @__PURE__ */ new WeakMap();
|
|
8016
|
+
/**
|
|
8017
|
+
* brepkit-wasm before 4.6.9 cuts a flat bevel along a radius law, and the peer
|
|
8018
|
+
* range still admits those builds. Rounding a 10 mm cube edge from 1 to 2 tells
|
|
8019
|
+
* them apart: a round removes 5.0 mm3 and a bevel 11.7. The probe runs once per
|
|
8020
|
+
* kernel, inside a checkpoint it restores and discards, so it leaves nothing behind.
|
|
8021
|
+
*/
|
|
8022
|
+
function roundsAlongLaws(bk) {
|
|
8023
|
+
const known = lawProbes.get(bk);
|
|
8024
|
+
if (known !== void 0) return known;
|
|
8025
|
+
let rounds;
|
|
8026
|
+
const mark = bk.checkpoint();
|
|
8027
|
+
try {
|
|
8028
|
+
const cube = bk.makeBox(10, 10, 10);
|
|
8029
|
+
const edge = require_bug.wasmIndex(bk.getSolidEdges(cube), 0);
|
|
8030
|
+
const spec = JSON.stringify([{
|
|
8031
|
+
edge,
|
|
8032
|
+
law: "linear",
|
|
8033
|
+
start: 1,
|
|
8034
|
+
end: 2
|
|
8035
|
+
}]);
|
|
8036
|
+
rounds = 1e3 - bk.volume(bk.filletVariable(cube, spec), DEFAULT_DEFLECTION) < 8;
|
|
8037
|
+
} catch {
|
|
8038
|
+
rounds = false;
|
|
8039
|
+
} finally {
|
|
8040
|
+
bk.restore(mark);
|
|
8041
|
+
bk.discardCheckpoint(mark);
|
|
7943
8042
|
}
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
if (only === void 0) throw new Error("brepkit: fillet needs at least one edge");
|
|
7947
|
-
return solidHandle(bk.fillet(solidId, edgeIds, only));
|
|
8043
|
+
lawProbes.set(bk, rounds);
|
|
8044
|
+
return rounds;
|
|
7948
8045
|
}
|
|
7949
8046
|
/**
|
|
7950
|
-
*
|
|
7951
|
-
*
|
|
7952
|
-
* a chamfer fails on them ("no manifold edges to chamfer"), and a fillet builds
|
|
7953
|
-
* the right body but leaves the input solid corrupt, so that filleting the
|
|
7954
|
-
* input's four vertical cube edges at 2 mm afterwards cuts a flat chamfer.
|
|
8047
|
+
* One filletVariable call for every edge, each along its own constant or
|
|
8048
|
+
* linear law, running from the edge's start vertex to its end.
|
|
7955
8049
|
*/
|
|
7956
|
-
function
|
|
7957
|
-
|
|
8050
|
+
function filletAlongLaws(bk, solidId, laws) {
|
|
8051
|
+
if (!roundsAlongLaws(bk)) throw new require_occtWasmAdapter.UnsupportedKernelOperationError("brepkit: a fillet along a radius law needs brepkit-wasm 4.6.9 or newer");
|
|
8052
|
+
const spec = laws.map(({ edge, start, end }) => ({
|
|
8053
|
+
edge,
|
|
8054
|
+
law: start === end ? "constant" : "linear",
|
|
8055
|
+
start,
|
|
8056
|
+
end
|
|
8057
|
+
}));
|
|
8058
|
+
return solidHandle(bk.filletVariable(solidId, JSON.stringify(spec)));
|
|
7958
8059
|
}
|
|
7959
8060
|
/**
|
|
7960
|
-
* brepkit
|
|
7961
|
-
*
|
|
7962
|
-
*
|
|
7963
|
-
* (the flat chamfer) where fillet removes 77.26. A radius that varies along an
|
|
7964
|
-
* edge is refused rather than built that way.
|
|
8061
|
+
* brepkit takes one distance for every edge of a chamfer call, and a second
|
|
8062
|
+
* call on the first one's result cannot name the input's other edges: it fails
|
|
8063
|
+
* on them ("no manifold edges to chamfer").
|
|
7965
8064
|
*/
|
|
7966
|
-
function
|
|
7967
|
-
return new require_occtWasmAdapter.UnsupportedKernelOperationError(
|
|
8065
|
+
function perEdgeUnsupported(what) {
|
|
8066
|
+
return new require_occtWasmAdapter.UnsupportedKernelOperationError(`brepkit: different ${what} on different edges in one call is not supported`);
|
|
7968
8067
|
}
|
|
7969
8068
|
/** occt's hashCode upper bound, which the kernel-agnostic filletVariable spec hashes edges with. */
|
|
7970
8069
|
var HASH_UPPER_BOUND = 2147483647;
|
|
7971
8070
|
/**
|
|
7972
8071
|
* A variable fillet spec on one edge: `{ edge: hashCode, radii: [{ param, radius }] }`
|
|
7973
|
-
* from variableFillet, or `{ edgeId, startRadius, endRadius }`.
|
|
7974
|
-
*
|
|
7975
|
-
*
|
|
8072
|
+
* from variableFillet, or `{ edgeId, startRadius, endRadius }`. Like occt-wasm, a
|
|
8073
|
+
* profile runs linearly from its first radius to its last, so one of more than two
|
|
8074
|
+
* points is unsupported rather than flattened to a line.
|
|
7976
8075
|
*/
|
|
7977
8076
|
function filletVariable$1(bk, shape, spec) {
|
|
7978
8077
|
const solidId = unwrapSolidOrThrow(shape, "filletVariable");
|
|
@@ -7988,9 +8087,15 @@ function filletVariable$1(bk, shape, spec) {
|
|
|
7988
8087
|
radii = [parsed.startRadius, parsed.endRadius];
|
|
7989
8088
|
} else throw new require_occtWasmAdapter.UnsupportedKernelOperationError("brepkit: filletVariable: unrecognized spec");
|
|
7990
8089
|
if (edgeId === void 0) throw new Error("brepkit: filletVariable: the edge is not an edge of the shape");
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
8090
|
+
if (radii.length > 2) throw new require_occtWasmAdapter.UnsupportedKernelOperationError("brepkit: filletVariable supports only a linear (<=2-point) radius profile");
|
|
8091
|
+
const start = require_bug.wasmIndex(radii, 0);
|
|
8092
|
+
const end = require_bug.wasmIndex(radii, radii.length - 1);
|
|
8093
|
+
if (start === end) return solidHandle(bk.fillet(solidId, [edgeId], start));
|
|
8094
|
+
return filletAlongLaws(bk, solidId, [{
|
|
8095
|
+
edge: edgeId,
|
|
8096
|
+
start,
|
|
8097
|
+
end
|
|
8098
|
+
}]);
|
|
7994
8099
|
}
|
|
7995
8100
|
/**
|
|
7996
8101
|
* A symmetric chamfer for two equal distances, brepkit's two-distance chamfer
|
|
@@ -10967,12 +11072,65 @@ function trySmoothPipeShell(bk, faceId, spine) {
|
|
|
10967
11072
|
return;
|
|
10968
11073
|
}
|
|
10969
11074
|
}
|
|
11075
|
+
/**
|
|
11076
|
+
* The curve a guided sweep runs along: one line, or one edge brepkit stores
|
|
11077
|
+
* as NURBS. brepkit gives no NURBS for a circle or an ellipse, and reading one
|
|
11078
|
+
* by its end points would sweep along the chord.
|
|
11079
|
+
*/
|
|
11080
|
+
function guideCurve(bk, shape, role) {
|
|
11081
|
+
const edges = shape.type === "edge" ? [shape] : iterShapes$1(bk, shape, "edge");
|
|
11082
|
+
const [edge] = edges;
|
|
11083
|
+
if (edges.length !== 1 || !edge) throw new require_occtWasmAdapter.UnsupportedKernelOperationError(`brepkit: a guided sweep takes a single-edge ${role}, got ${edges.length} edges`);
|
|
11084
|
+
const edgeId = unwrap$1(edge, "edge");
|
|
11085
|
+
const curveType = bk.getEdgeCurveType(edgeId);
|
|
11086
|
+
if (curveType !== "LINE" && bk.getEdgeNurbsData(edgeId) === null) throw new require_occtWasmAdapter.UnsupportedKernelOperationError(`brepkit: a guided sweep takes a line or NURBS ${role}, got ${curveType}`);
|
|
11087
|
+
const data = extractNurbsFromEdge(bk, edge);
|
|
11088
|
+
if (!data) throw new Error(`brepkit: guided sweep could not read the ${role}`);
|
|
11089
|
+
return data;
|
|
11090
|
+
}
|
|
11091
|
+
/**
|
|
11092
|
+
* brepkit places a guided sweep's sections at twice the spine's control points
|
|
11093
|
+
* (at least 4) and rules flat between them, so a straight spine twists through
|
|
11094
|
+
* 4 segments whatever the guide does: a square turned 90° comes out 2.5% light.
|
|
11095
|
+
* Splitting a straight spine into twice as many collinear spans as the guide
|
|
11096
|
+
* has control points samples the twist more finely than the guide is drawn.
|
|
11097
|
+
*/
|
|
11098
|
+
function densifyStraightSpine(path, spans) {
|
|
11099
|
+
if (path.degree !== 1 || path.controlPoints.length !== 6 || spans <= 1) return path;
|
|
11100
|
+
const start = require_bug.vec3At(path.controlPoints, 0);
|
|
11101
|
+
const end = require_bug.vec3At(path.controlPoints, 3);
|
|
11102
|
+
const controlPoints = [];
|
|
11103
|
+
const interior = [];
|
|
11104
|
+
for (let i = 0; i <= spans; i++) {
|
|
11105
|
+
const t = i / spans;
|
|
11106
|
+
controlPoints.push(...start.map((s, k) => s + (require_bug.wasmIndex(end, k) - s) * t));
|
|
11107
|
+
if (i > 0 && i < spans) interior.push(t);
|
|
11108
|
+
}
|
|
11109
|
+
return {
|
|
11110
|
+
degree: 1,
|
|
11111
|
+
knots: [
|
|
11112
|
+
0,
|
|
11113
|
+
0,
|
|
11114
|
+
...interior,
|
|
11115
|
+
1,
|
|
11116
|
+
1
|
|
11117
|
+
],
|
|
11118
|
+
controlPoints,
|
|
11119
|
+
weights: new Array(spans + 1).fill(1)
|
|
11120
|
+
};
|
|
11121
|
+
}
|
|
11122
|
+
function guidedPipeShell(bk, faceId, spine, auxiliary) {
|
|
11123
|
+
const aux = guideCurve(bk, auxiliary, "auxiliary spine");
|
|
11124
|
+
const path = densifyStraightSpine(guideCurve(bk, spine, "spine"), 2 * (aux.controlPoints.length / 3));
|
|
11125
|
+
return solidHandle(bk.guidedSweep(faceId, path.degree, path.knots, path.controlPoints, path.weights, aux.degree, aux.knots, aux.controlPoints, aux.weights));
|
|
11126
|
+
}
|
|
10970
11127
|
function sweepPipeShell(bk, profile, spine, options) {
|
|
10971
|
-
if (options?.["auxiliary"] !== void 0) throw new require_occtWasmAdapter.UnsupportedKernelOperationError("brepkit: sweepPipeShell has no auxiliary spine (twist or guided sweep)");
|
|
10972
11128
|
if (options?.["law"] !== void 0) throw new require_occtWasmAdapter.UnsupportedKernelOperationError("brepkit: sweepPipeShell has no scaling law");
|
|
10973
11129
|
const profileHandle = profile;
|
|
10974
11130
|
const faceId = profileHandle.type === "wire" ? bk.makeFaceFromWire(profileHandle.id) : unwrap$1(profile, "face");
|
|
10975
11131
|
const shellMode = !!(options && options["shellMode"]);
|
|
11132
|
+
const auxiliary = options?.["auxiliary"];
|
|
11133
|
+
if (auxiliary !== void 0) return wrapPipeShellResult(guidedPipeShell(bk, faceId, spine, auxiliary), profile, shellMode);
|
|
10976
11134
|
const transitionMode = options?.["transitionMode"];
|
|
10977
11135
|
const contactMode = transitionMode ? mapStringTransitionMode(transitionMode) : void 0;
|
|
10978
11136
|
if (contactMode) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as UnsupportedKernelOperationError, C as reverseCurve2d$2, D as tangentCurve2d, E as serializeCurve2d$2, N as EXACT_BREP_CAPABILITIES, O as translateCurve2d$2, P as OCCT_CAPABILITIES, S as offsetCurve2d$2, T as scaleCurve2d$2, _ 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 isUnsupportedKernelOperationError, k as quickHull, 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 rotateCurve2d$2, x as mirrorAtPoint, y as makeLine2d$2 } from "./occtWasmAdapter-
|
|
1
|
+
import { A as UnsupportedKernelOperationError, C as reverseCurve2d$2, D as tangentCurve2d, E as serializeCurve2d$2, N as EXACT_BREP_CAPABILITIES, O as translateCurve2d$2, P as OCCT_CAPABILITIES, S as offsetCurve2d$2, T as scaleCurve2d$2, _ 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 isUnsupportedKernelOperationError, k as quickHull, 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 rotateCurve2d$2, x as mirrorAtPoint, y as makeLine2d$2 } from "./occtWasmAdapter-DD_6IAVj.js";
|
|
2
2
|
import { i as wasmIndex, r as vec3At } from "./bug-ClMTAJhe.js";
|
|
3
3
|
// src/kernel/quality.ts
|
|
4
4
|
/**
|
|
@@ -7278,21 +7278,85 @@ function makeBezierEdge(bk, points) {
|
|
|
7278
7278
|
function makeTangentArc(bk, startPoint, startTangent, endPoint) {
|
|
7279
7279
|
return edgeHandle(bk.makeTangentArc3d(startPoint[0], startPoint[1], startPoint[2], startTangent[0], startTangent[1], startTangent[2], endPoint[0], endPoint[1], endPoint[2]));
|
|
7280
7280
|
}
|
|
7281
|
-
|
|
7281
|
+
/** The X axis occt's `gp_Ax3(P, V)` picks when given only a direction, so a helix starts where occt-wasm's does. */
|
|
7282
|
+
function occtDefaultXDir(a, b, c) {
|
|
7283
|
+
const [aa, ba, ca] = [
|
|
7284
|
+
Math.abs(a),
|
|
7285
|
+
Math.abs(b),
|
|
7286
|
+
Math.abs(c)
|
|
7287
|
+
];
|
|
7288
|
+
let x;
|
|
7289
|
+
if (ba <= aa && ba <= ca) x = aa > ca ? [
|
|
7290
|
+
-c,
|
|
7291
|
+
0,
|
|
7292
|
+
a
|
|
7293
|
+
] : [
|
|
7294
|
+
c,
|
|
7295
|
+
0,
|
|
7296
|
+
-a
|
|
7297
|
+
];
|
|
7298
|
+
else if (aa <= ba && aa <= ca) x = ba > ca ? [
|
|
7299
|
+
0,
|
|
7300
|
+
-c,
|
|
7301
|
+
b
|
|
7302
|
+
] : [
|
|
7303
|
+
0,
|
|
7304
|
+
c,
|
|
7305
|
+
-b
|
|
7306
|
+
];
|
|
7307
|
+
else x = aa > ba ? [
|
|
7308
|
+
-b,
|
|
7309
|
+
a,
|
|
7310
|
+
0
|
|
7311
|
+
] : [
|
|
7312
|
+
b,
|
|
7313
|
+
-a,
|
|
7314
|
+
0
|
|
7315
|
+
];
|
|
7316
|
+
const len = Math.hypot(x[0], x[1], x[2]);
|
|
7317
|
+
return [
|
|
7318
|
+
x[0] / len,
|
|
7319
|
+
x[1] / len,
|
|
7320
|
+
x[2] / len
|
|
7321
|
+
];
|
|
7322
|
+
}
|
|
7323
|
+
function makeHelixWire(bk, pitch, height, radius, center, direction, leftHanded) {
|
|
7282
7324
|
const turns = height / pitch;
|
|
7283
7325
|
const nSamples = Math.max(4, Math.ceil(turns * 16));
|
|
7284
|
-
const cx = center
|
|
7285
|
-
|
|
7286
|
-
|
|
7326
|
+
const [cx, cy, cz] = center ?? [
|
|
7327
|
+
0,
|
|
7328
|
+
0,
|
|
7329
|
+
0
|
|
7330
|
+
];
|
|
7331
|
+
const [dx, dy, dz] = direction ?? [
|
|
7332
|
+
0,
|
|
7333
|
+
0,
|
|
7334
|
+
1
|
|
7335
|
+
];
|
|
7336
|
+
const dLen = Math.hypot(dx, dy, dz);
|
|
7337
|
+
const z = [
|
|
7338
|
+
dx / dLen,
|
|
7339
|
+
dy / dLen,
|
|
7340
|
+
dz / dLen
|
|
7341
|
+
];
|
|
7342
|
+
const x = occtDefaultXDir(z[0], z[1], z[2]);
|
|
7343
|
+
const y = [
|
|
7344
|
+
z[1] * x[2] - z[2] * x[1],
|
|
7345
|
+
z[2] * x[0] - z[0] * x[2],
|
|
7346
|
+
z[0] * x[1] - z[1] * x[0]
|
|
7347
|
+
];
|
|
7287
7348
|
const sign = leftHanded ? -1 : 1;
|
|
7288
7349
|
const points = [];
|
|
7289
7350
|
for (let i = 0; i <= nSamples; i++) {
|
|
7290
7351
|
const t = i / nSamples;
|
|
7291
7352
|
const angle = sign * 2 * Math.PI * turns * t;
|
|
7353
|
+
const u = radius * Math.cos(angle);
|
|
7354
|
+
const v = radius * Math.sin(angle);
|
|
7355
|
+
const h = height * t;
|
|
7292
7356
|
points.push([
|
|
7293
|
-
cx +
|
|
7294
|
-
cy +
|
|
7295
|
-
cz +
|
|
7357
|
+
cx + u * x[0] + v * y[0] + h * z[0],
|
|
7358
|
+
cy + u * x[1] + v * y[1] + h * z[1],
|
|
7359
|
+
cz + u * x[2] + v * y[2] + h * z[2]
|
|
7296
7360
|
]);
|
|
7297
7361
|
}
|
|
7298
7362
|
return makeWire(bk, [interpolatePoints(bk, points)]);
|
|
@@ -7934,45 +7998,80 @@ function fillet(bk, shape, edges, radius) {
|
|
|
7934
7998
|
const solidId = unwrapSolidOrThrow(shape, "fillet");
|
|
7935
7999
|
const edgeIds = edges.map((e) => unwrap$1(e, "edge"));
|
|
7936
8000
|
if (typeof radius === "number") return solidHandle(bk.fillet(solidId, edgeIds, radius));
|
|
7937
|
-
const
|
|
7938
|
-
for (const edge of edges) {
|
|
8001
|
+
const laws = edges.map((edge, i) => {
|
|
7939
8002
|
const r = typeof radius === "function" ? radius(edge) : radius;
|
|
7940
8003
|
const [start, end] = Array.isArray(r) ? r : [r, r];
|
|
7941
|
-
|
|
7942
|
-
|
|
8004
|
+
return {
|
|
8005
|
+
edge: wasmIndex(edgeIds, i),
|
|
8006
|
+
start,
|
|
8007
|
+
end
|
|
8008
|
+
};
|
|
8009
|
+
});
|
|
8010
|
+
const [first] = laws;
|
|
8011
|
+
if (!first) throw new Error("brepkit: fillet needs at least one edge");
|
|
8012
|
+
if (laws.every((l) => l.start === first.start && l.end === first.start)) return solidHandle(bk.fillet(solidId, edgeIds, first.start));
|
|
8013
|
+
return filletAlongLaws(bk, solidId, laws);
|
|
8014
|
+
}
|
|
8015
|
+
var lawProbes = /* @__PURE__ */ new WeakMap();
|
|
8016
|
+
/**
|
|
8017
|
+
* brepkit-wasm before 4.6.9 cuts a flat bevel along a radius law, and the peer
|
|
8018
|
+
* range still admits those builds. Rounding a 10 mm cube edge from 1 to 2 tells
|
|
8019
|
+
* them apart: a round removes 5.0 mm3 and a bevel 11.7. The probe runs once per
|
|
8020
|
+
* kernel, inside a checkpoint it restores and discards, so it leaves nothing behind.
|
|
8021
|
+
*/
|
|
8022
|
+
function roundsAlongLaws(bk) {
|
|
8023
|
+
const known = lawProbes.get(bk);
|
|
8024
|
+
if (known !== void 0) return known;
|
|
8025
|
+
let rounds;
|
|
8026
|
+
const mark = bk.checkpoint();
|
|
8027
|
+
try {
|
|
8028
|
+
const cube = bk.makeBox(10, 10, 10);
|
|
8029
|
+
const edge = wasmIndex(bk.getSolidEdges(cube), 0);
|
|
8030
|
+
const spec = JSON.stringify([{
|
|
8031
|
+
edge,
|
|
8032
|
+
law: "linear",
|
|
8033
|
+
start: 1,
|
|
8034
|
+
end: 2
|
|
8035
|
+
}]);
|
|
8036
|
+
rounds = 1e3 - bk.volume(bk.filletVariable(cube, spec), DEFAULT_DEFLECTION) < 8;
|
|
8037
|
+
} catch {
|
|
8038
|
+
rounds = false;
|
|
8039
|
+
} finally {
|
|
8040
|
+
bk.restore(mark);
|
|
8041
|
+
bk.discardCheckpoint(mark);
|
|
7943
8042
|
}
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
if (only === void 0) throw new Error("brepkit: fillet needs at least one edge");
|
|
7947
|
-
return solidHandle(bk.fillet(solidId, edgeIds, only));
|
|
8043
|
+
lawProbes.set(bk, rounds);
|
|
8044
|
+
return rounds;
|
|
7948
8045
|
}
|
|
7949
8046
|
/**
|
|
7950
|
-
*
|
|
7951
|
-
*
|
|
7952
|
-
* a chamfer fails on them ("no manifold edges to chamfer"), and a fillet builds
|
|
7953
|
-
* the right body but leaves the input solid corrupt, so that filleting the
|
|
7954
|
-
* input's four vertical cube edges at 2 mm afterwards cuts a flat chamfer.
|
|
8047
|
+
* One filletVariable call for every edge, each along its own constant or
|
|
8048
|
+
* linear law, running from the edge's start vertex to its end.
|
|
7955
8049
|
*/
|
|
7956
|
-
function
|
|
7957
|
-
|
|
8050
|
+
function filletAlongLaws(bk, solidId, laws) {
|
|
8051
|
+
if (!roundsAlongLaws(bk)) throw new UnsupportedKernelOperationError("brepkit: a fillet along a radius law needs brepkit-wasm 4.6.9 or newer");
|
|
8052
|
+
const spec = laws.map(({ edge, start, end }) => ({
|
|
8053
|
+
edge,
|
|
8054
|
+
law: start === end ? "constant" : "linear",
|
|
8055
|
+
start,
|
|
8056
|
+
end
|
|
8057
|
+
}));
|
|
8058
|
+
return solidHandle(bk.filletVariable(solidId, JSON.stringify(spec)));
|
|
7958
8059
|
}
|
|
7959
8060
|
/**
|
|
7960
|
-
* brepkit
|
|
7961
|
-
*
|
|
7962
|
-
*
|
|
7963
|
-
* (the flat chamfer) where fillet removes 77.26. A radius that varies along an
|
|
7964
|
-
* edge is refused rather than built that way.
|
|
8061
|
+
* brepkit takes one distance for every edge of a chamfer call, and a second
|
|
8062
|
+
* call on the first one's result cannot name the input's other edges: it fails
|
|
8063
|
+
* on them ("no manifold edges to chamfer").
|
|
7965
8064
|
*/
|
|
7966
|
-
function
|
|
7967
|
-
return new UnsupportedKernelOperationError(
|
|
8065
|
+
function perEdgeUnsupported(what) {
|
|
8066
|
+
return new UnsupportedKernelOperationError(`brepkit: different ${what} on different edges in one call is not supported`);
|
|
7968
8067
|
}
|
|
7969
8068
|
/** occt's hashCode upper bound, which the kernel-agnostic filletVariable spec hashes edges with. */
|
|
7970
8069
|
var HASH_UPPER_BOUND = 2147483647;
|
|
7971
8070
|
/**
|
|
7972
8071
|
* A variable fillet spec on one edge: `{ edge: hashCode, radii: [{ param, radius }] }`
|
|
7973
|
-
* from variableFillet, or `{ edgeId, startRadius, endRadius }`.
|
|
7974
|
-
*
|
|
7975
|
-
*
|
|
8072
|
+
* from variableFillet, or `{ edgeId, startRadius, endRadius }`. Like occt-wasm, a
|
|
8073
|
+
* profile runs linearly from its first radius to its last, so one of more than two
|
|
8074
|
+
* points is unsupported rather than flattened to a line.
|
|
7976
8075
|
*/
|
|
7977
8076
|
function filletVariable$1(bk, shape, spec) {
|
|
7978
8077
|
const solidId = unwrapSolidOrThrow(shape, "filletVariable");
|
|
@@ -7988,9 +8087,15 @@ function filletVariable$1(bk, shape, spec) {
|
|
|
7988
8087
|
radii = [parsed.startRadius, parsed.endRadius];
|
|
7989
8088
|
} else throw new UnsupportedKernelOperationError("brepkit: filletVariable: unrecognized spec");
|
|
7990
8089
|
if (edgeId === void 0) throw new Error("brepkit: filletVariable: the edge is not an edge of the shape");
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
8090
|
+
if (radii.length > 2) throw new UnsupportedKernelOperationError("brepkit: filletVariable supports only a linear (<=2-point) radius profile");
|
|
8091
|
+
const start = wasmIndex(radii, 0);
|
|
8092
|
+
const end = wasmIndex(radii, radii.length - 1);
|
|
8093
|
+
if (start === end) return solidHandle(bk.fillet(solidId, [edgeId], start));
|
|
8094
|
+
return filletAlongLaws(bk, solidId, [{
|
|
8095
|
+
edge: edgeId,
|
|
8096
|
+
start,
|
|
8097
|
+
end
|
|
8098
|
+
}]);
|
|
7994
8099
|
}
|
|
7995
8100
|
/**
|
|
7996
8101
|
* A symmetric chamfer for two equal distances, brepkit's two-distance chamfer
|
|
@@ -10967,12 +11072,65 @@ function trySmoothPipeShell(bk, faceId, spine) {
|
|
|
10967
11072
|
return;
|
|
10968
11073
|
}
|
|
10969
11074
|
}
|
|
11075
|
+
/**
|
|
11076
|
+
* The curve a guided sweep runs along: one line, or one edge brepkit stores
|
|
11077
|
+
* as NURBS. brepkit gives no NURBS for a circle or an ellipse, and reading one
|
|
11078
|
+
* by its end points would sweep along the chord.
|
|
11079
|
+
*/
|
|
11080
|
+
function guideCurve(bk, shape, role) {
|
|
11081
|
+
const edges = shape.type === "edge" ? [shape] : iterShapes$1(bk, shape, "edge");
|
|
11082
|
+
const [edge] = edges;
|
|
11083
|
+
if (edges.length !== 1 || !edge) throw new UnsupportedKernelOperationError(`brepkit: a guided sweep takes a single-edge ${role}, got ${edges.length} edges`);
|
|
11084
|
+
const edgeId = unwrap$1(edge, "edge");
|
|
11085
|
+
const curveType = bk.getEdgeCurveType(edgeId);
|
|
11086
|
+
if (curveType !== "LINE" && bk.getEdgeNurbsData(edgeId) === null) throw new UnsupportedKernelOperationError(`brepkit: a guided sweep takes a line or NURBS ${role}, got ${curveType}`);
|
|
11087
|
+
const data = extractNurbsFromEdge(bk, edge);
|
|
11088
|
+
if (!data) throw new Error(`brepkit: guided sweep could not read the ${role}`);
|
|
11089
|
+
return data;
|
|
11090
|
+
}
|
|
11091
|
+
/**
|
|
11092
|
+
* brepkit places a guided sweep's sections at twice the spine's control points
|
|
11093
|
+
* (at least 4) and rules flat between them, so a straight spine twists through
|
|
11094
|
+
* 4 segments whatever the guide does: a square turned 90° comes out 2.5% light.
|
|
11095
|
+
* Splitting a straight spine into twice as many collinear spans as the guide
|
|
11096
|
+
* has control points samples the twist more finely than the guide is drawn.
|
|
11097
|
+
*/
|
|
11098
|
+
function densifyStraightSpine(path, spans) {
|
|
11099
|
+
if (path.degree !== 1 || path.controlPoints.length !== 6 || spans <= 1) return path;
|
|
11100
|
+
const start = vec3At(path.controlPoints, 0);
|
|
11101
|
+
const end = vec3At(path.controlPoints, 3);
|
|
11102
|
+
const controlPoints = [];
|
|
11103
|
+
const interior = [];
|
|
11104
|
+
for (let i = 0; i <= spans; i++) {
|
|
11105
|
+
const t = i / spans;
|
|
11106
|
+
controlPoints.push(...start.map((s, k) => s + (wasmIndex(end, k) - s) * t));
|
|
11107
|
+
if (i > 0 && i < spans) interior.push(t);
|
|
11108
|
+
}
|
|
11109
|
+
return {
|
|
11110
|
+
degree: 1,
|
|
11111
|
+
knots: [
|
|
11112
|
+
0,
|
|
11113
|
+
0,
|
|
11114
|
+
...interior,
|
|
11115
|
+
1,
|
|
11116
|
+
1
|
|
11117
|
+
],
|
|
11118
|
+
controlPoints,
|
|
11119
|
+
weights: new Array(spans + 1).fill(1)
|
|
11120
|
+
};
|
|
11121
|
+
}
|
|
11122
|
+
function guidedPipeShell(bk, faceId, spine, auxiliary) {
|
|
11123
|
+
const aux = guideCurve(bk, auxiliary, "auxiliary spine");
|
|
11124
|
+
const path = densifyStraightSpine(guideCurve(bk, spine, "spine"), 2 * (aux.controlPoints.length / 3));
|
|
11125
|
+
return solidHandle(bk.guidedSweep(faceId, path.degree, path.knots, path.controlPoints, path.weights, aux.degree, aux.knots, aux.controlPoints, aux.weights));
|
|
11126
|
+
}
|
|
10970
11127
|
function sweepPipeShell(bk, profile, spine, options) {
|
|
10971
|
-
if (options?.["auxiliary"] !== void 0) throw new UnsupportedKernelOperationError("brepkit: sweepPipeShell has no auxiliary spine (twist or guided sweep)");
|
|
10972
11128
|
if (options?.["law"] !== void 0) throw new UnsupportedKernelOperationError("brepkit: sweepPipeShell has no scaling law");
|
|
10973
11129
|
const profileHandle = profile;
|
|
10974
11130
|
const faceId = profileHandle.type === "wire" ? bk.makeFaceFromWire(profileHandle.id) : unwrap$1(profile, "face");
|
|
10975
11131
|
const shellMode = !!(options && options["shellMode"]);
|
|
11132
|
+
const auxiliary = options?.["auxiliary"];
|
|
11133
|
+
if (auxiliary !== void 0) return wrapPipeShellResult(guidedPipeShell(bk, faceId, spine, auxiliary), profile, shellMode);
|
|
10976
11134
|
const transitionMode = options?.["transitionMode"];
|
|
10977
11135
|
const contactMode = transitionMode ? mapStringTransitionMode(transitionMode) : void 0;
|
|
10978
11136
|
if (contactMode) {
|
package/dist/sketching.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_blueprintSketcher = require("./blueprintSketcher-
|
|
3
|
-
const require_drawFns = require("./drawFns-
|
|
4
|
-
const require_textBlueprints = require("./textBlueprints-
|
|
2
|
+
const require_blueprintSketcher = require("./blueprintSketcher-zx0yhxOF.cjs");
|
|
3
|
+
const require_drawFns = require("./drawFns-DCY1v4nI.cjs");
|
|
4
|
+
const require_textBlueprints = require("./textBlueprints-CTMykb_E.cjs");
|
|
5
5
|
// src/sketching.ts
|
|
6
6
|
/**
|
|
7
7
|
* brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
|
package/dist/sketching.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-
|
|
2
|
-
import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-
|
|
3
|
-
import { a as Sketches, c as compoundSketchFace, d as sketchExtrude, f as sketchFace, g as sketchWires, h as sketchSweep, l as compoundSketchLoft, m as sketchRevolve, o as Sketch, p as sketchLoft, s as compoundSketchExtrude, u as compoundSketchRevolve, y as CompoundSketch } from "./textBlueprints-
|
|
1
|
+
import { n as BaseSketcher2d, t as BlueprintSketcher } from "./blueprintSketcher-D81yS5Em.js";
|
|
2
|
+
import { A as sketchEllipse, C as DrawingPen, D as makeBaseBox, E as deserializeDrawing, F as sketchRectangle, I as sketchRoundedRectangle, L as FaceSketcher, M as sketchHelix, N as sketchParametricFunction, O as polysideInnerRadius, P as sketchPolysides, R as Sketcher, S as drawText, T as Drawing, _ as drawPolysides, a as drawingIntersect, b as drawSingleCircle, c as rotateDrawing, d as drawFaceOutline, f as drawProjection, g as drawPointsInterpolation, h as drawParametricFunction, i as drawingFuse, j as sketchFaceOffset, k as sketchCircle, l as scaleDrawing, m as drawEllipse, n as drawingCut, o as drawingToSketchOnPlane, p as drawCircle, r as drawingFillet, s as mirrorDrawing, t as drawingChamfer, u as translateDrawing, v as drawRectangle, w as draw, x as drawSingleEllipse, y as drawRoundedRectangle } from "./drawFns-D9GuLtRK.js";
|
|
3
|
+
import { a as Sketches, c as compoundSketchFace, d as sketchExtrude, f as sketchFace, g as sketchWires, h as sketchSweep, l as compoundSketchLoft, m as sketchRevolve, o as Sketch, p as sketchLoft, s as compoundSketchExtrude, u as compoundSketchRevolve, y as CompoundSketch } from "./textBlueprints-CxufM4VF.js";
|
|
4
4
|
// src/sketching.ts
|
|
5
5
|
/**
|
|
6
6
|
* brepjs/sketching — Sketcher, Drawing, and sketch-to-shape operations.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CgayxMvX.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
|
-
const require_topologyQueryFns = require("./topologyQueryFns
|
|
3
|
+
const require_topologyQueryFns = require("./topologyQueryFns-EI-aso9K.cjs");
|
|
4
4
|
const require_constants = require("./constants-oee0S_x6.cjs");
|
|
5
|
-
const require_faceFns = require("./faceFns-
|
|
5
|
+
const require_faceFns = require("./faceFns-CPGJ_cx6.cjs");
|
|
6
6
|
// src/topology/metadata/originTrackingFns.ts
|
|
7
7
|
/**
|
|
8
8
|
* Face origin tracking — tag faces with integer origins and propagate
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as isSolid, G as _usingCtx, S as isShell, d as createSolid, f as createVertex, h as disposeResultShape, n as castResultShape, q as getKernel, s as createCompound, x as isShape3D } from "./shapeTypes-
|
|
1
|
+
import { C as isSolid, G as _usingCtx, S as isShell, d as createSolid, f as createVertex, h as disposeResultShape, n as castResultShape, q as getKernel, s as createCompound, x as isShape3D } from "./shapeTypes-qhs8f2zx.js";
|
|
2
2
|
import { E as ok, g as err, l as typeCastError, m as andThen } from "./errors-BTccWbtE.js";
|
|
3
|
-
import { C as subShapeHashes, c as getFaces, l as getOrCreateCache, r as getCacheEntry } from "./topologyQueryFns-
|
|
3
|
+
import { C as subShapeHashes, c as getFaces, l as getOrCreateCache, r as getCacheEntry } from "./topologyQueryFns-CArmw9sE.js";
|
|
4
4
|
import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
|
|
5
|
-
import { _ as cast, y as downcast } from "./faceFns-
|
|
5
|
+
import { _ as cast, y as downcast } from "./faceFns-BNv6thpF.js";
|
|
6
6
|
// src/topology/metadata/originTrackingFns.ts
|
|
7
7
|
/**
|
|
8
8
|
* Face origin tracking — tag faces with integer origins and propagate
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_shapeTypes = require("./shapeTypes-
|
|
1
|
+
const require_shapeTypes = require("./shapeTypes-CgayxMvX.cjs");
|
|
2
2
|
const require_errors = require("./errors-O_blYTWT.cjs");
|
|
3
|
-
const require_validityTypes = require("./validityTypes-
|
|
4
|
-
const require_faceFns = require("./faceFns-
|
|
3
|
+
const require_validityTypes = require("./validityTypes-DFEPeAkV.cjs");
|
|
4
|
+
const require_faceFns = require("./faceFns-CPGJ_cx6.cjs");
|
|
5
5
|
// src/utils/range.ts
|
|
6
6
|
/** Generate an array of integers `[0, 1, …, len - 1]`. */
|
|
7
7
|
function range(len) {
|