brepjs 20.13.6 → 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.
Files changed (90) hide show
  1. package/dist/2d.cjs +6 -6
  2. package/dist/2d.js +6 -6
  3. package/dist/{adjacencyFns-BLtq-nUN.cjs → adjacencyFns-B6fMyAj0.cjs} +3 -3
  4. package/dist/{adjacencyFns-C1Hxy0tk.js → adjacencyFns-n6XWEyj1.js} +3 -3
  5. package/dist/{blueprint-BzI6waZa.js → blueprint-2j8szIQ6.js} +5 -5
  6. package/dist/{blueprint-DlpFhHbU.cjs → blueprint-Cfj9EupK.cjs} +5 -5
  7. package/dist/{blueprintFns-Cc9OyvKE.cjs → blueprintFns-7SWJcrSi.cjs} +2 -2
  8. package/dist/{blueprintFns-HFd0lu9A.js → blueprintFns-C4VacaAG.js} +2 -2
  9. package/dist/{blueprintSketcher-BrQee61I.js → blueprintSketcher-D81yS5Em.js} +3 -3
  10. package/dist/{blueprintSketcher-DUT3-Cuo.cjs → blueprintSketcher-zx0yhxOF.cjs} +3 -3
  11. package/dist/{boolean2D-BC0TwxyB.cjs → boolean2D-BMfzZ4n8.cjs} +4 -4
  12. package/dist/{boolean2D-CvBeghsg.js → boolean2D-DhW8iZoR.js} +4 -4
  13. package/dist/{booleanFns-Dti1CK1F.cjs → booleanFns-CaHF13T-.cjs} +5 -5
  14. package/dist/{booleanFns-Dtg2jqzi.js → booleanFns-DIqS3nBK.js} +5 -5
  15. package/dist/brepjs.cjs +30 -30
  16. package/dist/brepjs.js +30 -30
  17. package/dist/{cameraFns-CXONX5Da.js → cameraFns-DB_nPXR7.js} +3 -3
  18. package/dist/{cameraFns--Ab792oE.cjs → cameraFns-T60Qk0tk.cjs} +3 -3
  19. package/dist/core.cjs +2 -2
  20. package/dist/core.js +2 -2
  21. package/dist/{cornerFinder-DUzrQsfW.cjs → cornerFinder-CNuTBfRo.cjs} +1 -1
  22. package/dist/{cornerFinder-C7f43oKE.js → cornerFinder-GtiadLBr.js} +1 -1
  23. package/dist/{curveFns-Dzgl3_MC.js → curveFns-CGQCy_D5.js} +1 -1
  24. package/dist/{curveFns-QaNfJzko.cjs → curveFns-m73YVbFb.cjs} +1 -1
  25. package/dist/{drawFns-WvF0fehK.js → drawFns-D9GuLtRK.js} +12 -12
  26. package/dist/{drawFns-BRXk9fLg.cjs → drawFns-DCY1v4nI.cjs} +12 -12
  27. package/dist/{faceFns-BG1CBQUM.js → faceFns-BNv6thpF.js} +2 -2
  28. package/dist/{faceFns-dj_c8LVc.cjs → faceFns-CPGJ_cx6.cjs} +2 -2
  29. package/dist/{healingFns-BSNNLyXP.cjs → healingFns-D33MBaNA.cjs} +36 -21
  30. package/dist/{healingFns-CfkUEqcL.js → healingFns-w-PHd-Lj.js} +36 -21
  31. package/dist/{helpers-6Emek9dE.cjs → helpers-CCnN8-PY.cjs} +6 -6
  32. package/dist/{helpers-DolHn2_s.js → helpers-Ci_WZ5ou.js} +6 -6
  33. package/dist/{importFns-D1AxkVC3.js → importFns-DQgcQQCb.js} +5 -5
  34. package/dist/{importFns-CZb21dj7.cjs → importFns-zfbC3bIK.cjs} +5 -5
  35. package/dist/io.cjs +2 -2
  36. package/dist/io.js +2 -2
  37. package/dist/kernel/occtWasm/helpers.d.ts +12 -2
  38. package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
  39. package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
  40. package/dist/{loftFns-BD0na-M4.cjs → loftFns-DQJM-35I.cjs} +2 -2
  41. package/dist/{loftFns-Cua-MamP.js → loftFns-mrTzIf4_.js} +2 -2
  42. package/dist/{measureFns-FrNeGmXh.cjs → measureFns-CpoPgAZt.cjs} +4 -4
  43. package/dist/{measureFns-WGYWWnQ1.js → measureFns-MSr05_kf.js} +4 -4
  44. package/dist/measurement.cjs +2 -2
  45. package/dist/measurement.js +2 -2
  46. package/dist/{meshFns-Lie8oAac.js → meshFns-BIWD7IFN.js} +4 -4
  47. package/dist/{meshFns-Dy1a9wl_.cjs → meshFns-BxRKwY5z.cjs} +4 -4
  48. package/dist/{occtWasmAdapter-B9ZXx36v.cjs → occtWasmAdapter-BH1JcAgl.cjs} +12 -4
  49. package/dist/{occtWasmAdapter-CGkZIHyM.js → occtWasmAdapter-DD_6IAVj.js} +12 -4
  50. package/dist/operations.cjs +2 -2
  51. package/dist/operations.js +2 -2
  52. package/dist/{primitiveFns-w-ST-RDJ.js → primitiveFns-BaYEo9qN.js} +5 -5
  53. package/dist/{primitiveFns-Dpn3ZtUE.cjs → primitiveFns-D8D9dI_P.cjs} +5 -5
  54. package/dist/{principalBoxFns-CjfJnZfH.js → principalBoxFns-CBWLch1h.js} +3 -3
  55. package/dist/{principalBoxFns-3ZURcOFP.cjs → principalBoxFns-CNSK-z3k.cjs} +3 -3
  56. package/dist/projection.cjs +1 -1
  57. package/dist/projection.js +1 -1
  58. package/dist/query.cjs +2 -2
  59. package/dist/query.js +2 -2
  60. package/dist/{refResolveFns-ROMmhWfH.cjs → refResolveFns-CuewCIRB.cjs} +6 -6
  61. package/dist/{refResolveFns-Yy1n2BHJ.js → refResolveFns-DaZPev13.js} +6 -6
  62. package/dist/{shapeFns-BRRrZc1X.js → shapeFns-3NzCE2kz.js} +2 -2
  63. package/dist/{shapeFns-CljM3iMI.cjs → shapeFns-Cklw3p3S.cjs} +2 -2
  64. package/dist/shapeRef.cjs +1 -1
  65. package/dist/shapeRef.js +1 -1
  66. package/dist/{shapeTypes-DEe6gtTR.cjs → shapeTypes-CgayxMvX.cjs} +1 -1
  67. package/dist/{shapeTypes-w2wyXEis.js → shapeTypes-qhs8f2zx.js} +1 -1
  68. package/dist/sketching.cjs +3 -3
  69. package/dist/sketching.js +3 -3
  70. package/dist/{solidBuilders-yQFZe6jf.cjs → solidBuilders-BvIdZUkI.cjs} +3 -3
  71. package/dist/{solidBuilders-BxIYXIv-.js → solidBuilders-DhDGnOTQ.js} +3 -3
  72. package/dist/{surfaceBuilders-dWcQ_BpM.cjs → surfaceBuilders-BPAW6RbN.cjs} +3 -3
  73. package/dist/{surfaceBuilders-BZ7BW8I0.js → surfaceBuilders-D9WX9gHX.js} +3 -3
  74. package/dist/text.cjs +2 -2
  75. package/dist/text.js +2 -2
  76. package/dist/{textBlueprints-Tx73Xex5.cjs → textBlueprints-CTMykb_E.cjs} +8 -8
  77. package/dist/{textBlueprints-CxhhPEaF.js → textBlueprints-CxufM4VF.js} +8 -8
  78. package/dist/{textMetrics-B5dKPalE.js → textMetrics-CdvERXfK.js} +1 -1
  79. package/dist/{textMetrics-9q5S5II9.cjs → textMetrics-D51K9Ddx.cjs} +1 -1
  80. package/dist/{threadFns-Dfu2jV41.js → threadFns-BUy4gIG3.js} +7 -7
  81. package/dist/{threadFns-BnNo5eND.cjs → threadFns-zNevH3kU.cjs} +7 -7
  82. package/dist/topology/apiTypes.d.ts +2 -1
  83. package/dist/topology/modifierFns.d.ts +11 -0
  84. package/dist/topology.cjs +9 -9
  85. package/dist/topology.js +9 -9
  86. package/dist/{topologyQueryFns-CTl4cWYD.js → topologyQueryFns-CArmw9sE.js} +1 -1
  87. package/dist/{topologyQueryFns-I_m8o-s7.cjs → topologyQueryFns-EI-aso9K.cjs} +1 -1
  88. package/dist/{validityTypes-DgknRAAp.cjs → validityTypes-DFEPeAkV.cjs} +1 -1
  89. package/dist/{validityTypes-C2K0Eepw.js → validityTypes-DiOmm0sf.js} +1 -1
  90. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import { O as getOrQueryType, i as castShape, q as getKernel } from "./shapeTypes-w2wyXEis.js";
1
+ import { O as getOrQueryType, i as castShape, q as getKernel } from "./shapeTypes-qhs8f2zx.js";
2
2
  import { E as ok, P as unwrap, g as err, l as typeCastError } from "./errors-BTccWbtE.js";
3
- import { a as getCachedSurfaceType } from "./topologyQueryFns-CTl4cWYD.js";
3
+ import { a as getCachedSurfaceType } from "./topologyQueryFns-CArmw9sE.js";
4
4
  import { r as toVec3 } from "./types-CKXsIm9-.js";
5
5
  // src/topology/cast.ts
6
6
  var TOPO_ENUM = {
@@ -1,6 +1,6 @@
1
- const require_shapeTypes = require("./shapeTypes-DEe6gtTR.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CgayxMvX.cjs");
2
2
  const require_errors = require("./errors-O_blYTWT.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-I_m8o-s7.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-EI-aso9K.cjs");
4
4
  const require_types = require("./types-CjF9Rofr.cjs");
5
5
  // src/topology/cast.ts
6
6
  var TOPO_ENUM = {
@@ -1,13 +1,13 @@
1
- const require_shapeTypes = require("./shapeTypes-DEe6gtTR.cjs");
2
- const require_occtWasmAdapter = require("./occtWasmAdapter-B9ZXx36v.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CgayxMvX.cjs");
2
+ const require_occtWasmAdapter = require("./occtWasmAdapter-BH1JcAgl.cjs");
3
3
  const require_errors = require("./errors-O_blYTWT.cjs");
4
- const require_topologyQueryFns = require("./topologyQueryFns-I_m8o-s7.cjs");
4
+ const require_topologyQueryFns = require("./topologyQueryFns-EI-aso9K.cjs");
5
5
  const require_constants = require("./constants-oee0S_x6.cjs");
6
- const require_faceFns = require("./faceFns-dj_c8LVc.cjs");
7
- const require_booleanFns = require("./booleanFns-Dti1CK1F.cjs");
8
- const require_shapeFns = require("./shapeFns-CljM3iMI.cjs");
6
+ const require_faceFns = require("./faceFns-CPGJ_cx6.cjs");
7
+ const require_booleanFns = require("./booleanFns-CaHF13T-.cjs");
8
+ const require_shapeFns = require("./shapeFns-Cklw3p3S.cjs");
9
9
  const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
10
- const require_adjacencyFns = require("./adjacencyFns-BLtq-nUN.cjs");
10
+ const require_adjacencyFns = require("./adjacencyFns-B6fMyAj0.cjs");
11
11
  // src/topology/threeHelpers.ts
12
12
  /**
13
13
  * Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
@@ -213,28 +213,41 @@ function validateNotNull$1(shape, label) {
213
213
  if (require_shapeTypes.getKernel().isNull(shape.wrapped)) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.NULL_SHAPE_INPUT, `${label} is a null shape`));
214
214
  return require_errors.ok(void 0);
215
215
  }
216
+ function isPositivePair([a, b]) {
217
+ return a > 0 && b > 0;
218
+ }
216
219
  /**
217
- * Validate that a scalar or `[a, b]` pair is positive.
220
+ * A fillet's start and end radius: one may be 0, so the fillet runs out to
221
+ * nothing at that end of the edge, but not both, and neither below 0.
222
+ */
223
+ function isFilletRadiusPair([start, end]) {
224
+ return start >= 0 && end >= 0 && (start > 0 || end > 0);
225
+ }
226
+ var FILLET_PAIR_MESSAGE = "Fillet radii must not be negative, and one must be positive";
227
+ var FILLET_PAIR_HINT = "A radius may run to 0 at one end of the edge, but the other must be greater than 0";
228
+ /**
229
+ * Validate that a scalar is positive and that an `[a, b]` pair passes
230
+ * `isValidPair` (both positive by default).
218
231
  * Returns an Err Result on failure, `undefined` on success.
219
232
  *
220
233
  * Function-type values (per-edge callbacks) are intentionally skipped here --
221
234
  * they are validated lazily in {@link resolveEdgeCallback} when each edge is processed.
222
235
  */
223
- function validatePositiveParam(value, msgs) {
236
+ function validatePositiveParam(value, msgs, isValidPair = isPositivePair) {
224
237
  if (typeof value === "number" && value <= 0) return require_errors.err(require_errors.validationError(msgs.code, msgs.scalar, void 0, void 0, msgs.scalarHint));
225
- if (Array.isArray(value) && (value[0] <= 0 || value[1] <= 0)) return require_errors.err(require_errors.validationError(msgs.code, msgs.pair, void 0, void 0, msgs.pairHint));
238
+ if (Array.isArray(value) && !isValidPair(value)) return require_errors.err(require_errors.validationError(msgs.code, msgs.pair, void 0, void 0, msgs.pairHint));
226
239
  }
227
240
  /**
228
241
  * When the user supplies a per-edge callback, pre-filter edges and build a
229
242
  * hash-indexed lookup for the kernel. Returns `null` if no edges survive.
230
243
  */
231
- function resolveEdgeCallback$1(selectedEdges, callbackFn) {
244
+ function resolveEdgeCallback$1(selectedEdges, callbackFn, isValidPair = isPositivePair) {
232
245
  const filteredEdges = [];
233
246
  const hashToValue = /* @__PURE__ */ new Map();
234
247
  for (const edge of selectedEdges) {
235
248
  const val = callbackFn(edge) ?? 0;
236
249
  if (typeof val === "number" && val <= 0) continue;
237
- if (Array.isArray(val) && (val[0] <= 0 || val[1] <= 0)) continue;
250
+ if (Array.isArray(val) && !isValidPair(val)) continue;
238
251
  filteredEdges.push(edge);
239
252
  hashToValue.set(require_shapeTypes.getKernel().hashCode(edge.wrapped, require_constants.HASH_CODE_MAX), val);
240
253
  }
@@ -320,15 +333,15 @@ function normalizeFilletInputs(shape, edges, radius) {
320
333
  const paramErr = validatePositiveParam(radius, {
321
334
  code: "INVALID_FILLET_RADIUS",
322
335
  scalar: "Fillet radius must be positive",
323
- pair: "Fillet radii must both be positive",
336
+ pair: FILLET_PAIR_MESSAGE,
324
337
  scalarHint: "Provide a positive radius value greater than 0",
325
- pairHint: "Both radius values must be greater than 0"
326
- });
338
+ pairHint: FILLET_PAIR_HINT
339
+ }, isFilletRadiusPair);
327
340
  if (paramErr) return paramErr;
328
341
  const selectedEdges = edges ?? require_topologyQueryFns.getEdges(shape);
329
342
  if (selectedEdges.length === 0) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.FILLET_NO_EDGES, "No edges found for fillet", void 0, void 0, "Check that the shape has edges, or adjust your edge finder criteria"));
330
343
  if (typeof radius === "function") {
331
- const resolved = resolveEdgeCallback$1(selectedEdges, radius);
344
+ const resolved = resolveEdgeCallback$1(selectedEdges, radius, isFilletRadiusPair);
332
345
  if (!resolved) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.FILLET_NO_EDGES, "No edges with positive radius for fillet", void 0, void 0, "Check that the radius callback returns positive values"));
333
346
  return require_errors.ok({
334
347
  filteredEdges: resolved.edges,
@@ -594,6 +607,8 @@ function draft(shape, faces, pullDirection, neutralPlane, angle) {
594
607
  *
595
608
  * The radius varies along the edge according to the provided spec points.
596
609
  * Each point specifies a normalized parameter (0 = start, 1 = end) and radius.
610
+ * A radius may be 0, so the fillet runs out to nothing there, as long as one
611
+ * is positive.
597
612
  *
598
613
  * **Cross-kernel note:** occt-wasm and brepkit build a constant or linear
599
614
  * (start/end, <=2-point) profile and return `UNSUPPORTED_CAPABILITY` for one of
@@ -601,7 +616,7 @@ function draft(shape, faces, pullDirection, neutralPlane, angle) {
601
616
  */
602
617
  function variableFillet(shape, edge, radii) {
603
618
  if (radii.length === 0) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.VARIABLE_FILLET_FAILED, "radii must contain at least one radius spec"));
604
- for (const r of radii) if (r.radius <= 0) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.VARIABLE_FILLET_FAILED, "All radius values must be positive"));
619
+ if (radii.some((r) => r.radius < 0) || radii.every((r) => r.radius === 0)) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.VARIABLE_FILLET_FAILED, "Radius values must not be negative, and one must be positive"));
605
620
  const kernel = require_shapeTypes.getKernel();
606
621
  try {
607
622
  const spec = JSON.stringify({
@@ -1153,13 +1168,13 @@ function castToShape3D(shape, errorCode, errorMsg, suggestion) {
1153
1168
  require_shapeTypes.disposeDowncastSource(shape, wrapped);
1154
1169
  return require_errors.ok(wrapped);
1155
1170
  }
1156
- function resolveEdgeCallback(selectedEdges, callbackFn) {
1171
+ function resolveEdgeCallback(selectedEdges, callbackFn, isValidPair = ([a, b]) => a > 0 && b > 0) {
1157
1172
  const filteredEdges = [];
1158
1173
  const hashToValue = /* @__PURE__ */ new Map();
1159
1174
  for (const edge of selectedEdges) {
1160
1175
  const val = callbackFn(edge) ?? 0;
1161
1176
  if (typeof val === "number" && val <= 0) continue;
1162
- if (Array.isArray(val) && (val[0] <= 0 || val[1] <= 0)) continue;
1177
+ if (Array.isArray(val) && !isValidPair(val)) continue;
1163
1178
  filteredEdges.push(edge);
1164
1179
  hashToValue.set(require_shapeTypes.getKernel().hashCode(edge.wrapped, require_constants.HASH_CODE_MAX), val);
1165
1180
  }
@@ -1249,14 +1264,14 @@ function filletWithEvolution(shape, edges, radius) {
1249
1264
  const check = validateNotNull(shape, "filletWithEvolution: shape");
1250
1265
  if (require_errors.isErr(check)) return check;
1251
1266
  if (typeof radius === "number" && radius <= 0) return require_errors.err(require_errors.validationError("INVALID_FILLET_RADIUS", "Fillet radius must be positive", void 0, void 0, "Provide a positive radius value greater than 0"));
1252
- if (Array.isArray(radius) && (radius[0] <= 0 || radius[1] <= 0)) return require_errors.err(require_errors.validationError("INVALID_FILLET_RADIUS", "Fillet radii must both be positive", void 0, void 0, "Both radius values must be greater than 0"));
1267
+ if (Array.isArray(radius) && !isFilletRadiusPair(radius)) return require_errors.err(require_errors.validationError("INVALID_FILLET_RADIUS", FILLET_PAIR_MESSAGE, void 0, void 0, FILLET_PAIR_HINT));
1253
1268
  const selectedEdges = edges ?? require_topologyQueryFns.getEdges(shape);
1254
1269
  if (selectedEdges.length === 0) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.FILLET_NO_EDGES, "No edges found for fillet", void 0, void 0, "Check that the shape has edges, or adjust your edge finder criteria"));
1255
1270
  try {
1256
1271
  let filteredEdges;
1257
1272
  let kernelRadius;
1258
1273
  if (typeof radius === "function") {
1259
- const resolved = resolveEdgeCallback(selectedEdges, radius);
1274
+ const resolved = resolveEdgeCallback(selectedEdges, radius, isFilletRadiusPair);
1260
1275
  if (!resolved) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.FILLET_NO_EDGES, "No edges with positive radius for fillet", void 0, void 0, "Check that the radius callback returns positive values"));
1261
1276
  filteredEdges = resolved.edges;
1262
1277
  kernelRadius = resolved.kernelParam;
@@ -1,13 +1,13 @@
1
- import { C as isSolid, D as getShapeKind, T as isWire, Y as getKernelCapabilities, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, q as getKernel, r as castResultShapeWithKnownType, x as isShape3D, y as isFace } from "./shapeTypes-w2wyXEis.js";
2
- import { j as isUnsupportedKernelOperationError, n as faultyEdgeIndexesOf } from "./occtWasmAdapter-CGkZIHyM.js";
1
+ import { C as isSolid, D as getShapeKind, T as isWire, Y as getKernelCapabilities, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, q as getKernel, r as castResultShapeWithKnownType, x as isShape3D, y as isFace } from "./shapeTypes-qhs8f2zx.js";
2
+ import { j as isUnsupportedKernelOperationError, n as faultyEdgeIndexesOf } from "./occtWasmAdapter-DD_6IAVj.js";
3
3
  import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode, u as unsupportedError, x as isOk } from "./errors-BTccWbtE.js";
4
- import { C as subShapeHashes, O as getSuggestionForCode, c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-CTl4cWYD.js";
4
+ import { C as subShapeHashes, O as getSuggestionForCode, c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-CArmw9sE.js";
5
5
  import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
6
- import { y as downcast } from "./faceFns-BG1CBQUM.js";
7
- import { a as fuse, f as collectInputFaceHashes, h as propagateMetadataByHash, i as cutAll, m as propagateAllMetadata, n as copyAsBooleanResult, o as fuseAll, r as cut } from "./booleanFns-Dtg2jqzi.js";
8
- import { a as isSameShape } from "./shapeFns-BRRrZc1X.js";
6
+ import { y as downcast } from "./faceFns-BNv6thpF.js";
7
+ import { a as fuse, f as collectInputFaceHashes, h as propagateMetadataByHash, i as cutAll, m as propagateAllMetadata, n as copyAsBooleanResult, o as fuseAll, r as cut } from "./booleanFns-DIqS3nBK.js";
8
+ import { a as isSameShape } from "./shapeFns-3NzCE2kz.js";
9
9
  import { t as firstOrThrow } from "./arrayAccess-BpgouNir.js";
10
- import { i as facesOfEdge } from "./adjacencyFns-C1Hxy0tk.js";
10
+ import { i as facesOfEdge } from "./adjacencyFns-n6XWEyj1.js";
11
11
  // src/topology/threeHelpers.ts
12
12
  /**
13
13
  * Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
@@ -213,28 +213,41 @@ function validateNotNull$1(shape, label) {
213
213
  if (getKernel().isNull(shape.wrapped)) return err(validationError(BrepErrorCode.NULL_SHAPE_INPUT, `${label} is a null shape`));
214
214
  return ok(void 0);
215
215
  }
216
+ function isPositivePair([a, b]) {
217
+ return a > 0 && b > 0;
218
+ }
216
219
  /**
217
- * Validate that a scalar or `[a, b]` pair is positive.
220
+ * A fillet's start and end radius: one may be 0, so the fillet runs out to
221
+ * nothing at that end of the edge, but not both, and neither below 0.
222
+ */
223
+ function isFilletRadiusPair([start, end]) {
224
+ return start >= 0 && end >= 0 && (start > 0 || end > 0);
225
+ }
226
+ var FILLET_PAIR_MESSAGE = "Fillet radii must not be negative, and one must be positive";
227
+ var FILLET_PAIR_HINT = "A radius may run to 0 at one end of the edge, but the other must be greater than 0";
228
+ /**
229
+ * Validate that a scalar is positive and that an `[a, b]` pair passes
230
+ * `isValidPair` (both positive by default).
218
231
  * Returns an Err Result on failure, `undefined` on success.
219
232
  *
220
233
  * Function-type values (per-edge callbacks) are intentionally skipped here --
221
234
  * they are validated lazily in {@link resolveEdgeCallback} when each edge is processed.
222
235
  */
223
- function validatePositiveParam(value, msgs) {
236
+ function validatePositiveParam(value, msgs, isValidPair = isPositivePair) {
224
237
  if (typeof value === "number" && value <= 0) return err(validationError(msgs.code, msgs.scalar, void 0, void 0, msgs.scalarHint));
225
- if (Array.isArray(value) && (value[0] <= 0 || value[1] <= 0)) return err(validationError(msgs.code, msgs.pair, void 0, void 0, msgs.pairHint));
238
+ if (Array.isArray(value) && !isValidPair(value)) return err(validationError(msgs.code, msgs.pair, void 0, void 0, msgs.pairHint));
226
239
  }
227
240
  /**
228
241
  * When the user supplies a per-edge callback, pre-filter edges and build a
229
242
  * hash-indexed lookup for the kernel. Returns `null` if no edges survive.
230
243
  */
231
- function resolveEdgeCallback$1(selectedEdges, callbackFn) {
244
+ function resolveEdgeCallback$1(selectedEdges, callbackFn, isValidPair = isPositivePair) {
232
245
  const filteredEdges = [];
233
246
  const hashToValue = /* @__PURE__ */ new Map();
234
247
  for (const edge of selectedEdges) {
235
248
  const val = callbackFn(edge) ?? 0;
236
249
  if (typeof val === "number" && val <= 0) continue;
237
- if (Array.isArray(val) && (val[0] <= 0 || val[1] <= 0)) continue;
250
+ if (Array.isArray(val) && !isValidPair(val)) continue;
238
251
  filteredEdges.push(edge);
239
252
  hashToValue.set(getKernel().hashCode(edge.wrapped, HASH_CODE_MAX), val);
240
253
  }
@@ -320,15 +333,15 @@ function normalizeFilletInputs(shape, edges, radius) {
320
333
  const paramErr = validatePositiveParam(radius, {
321
334
  code: "INVALID_FILLET_RADIUS",
322
335
  scalar: "Fillet radius must be positive",
323
- pair: "Fillet radii must both be positive",
336
+ pair: FILLET_PAIR_MESSAGE,
324
337
  scalarHint: "Provide a positive radius value greater than 0",
325
- pairHint: "Both radius values must be greater than 0"
326
- });
338
+ pairHint: FILLET_PAIR_HINT
339
+ }, isFilletRadiusPair);
327
340
  if (paramErr) return paramErr;
328
341
  const selectedEdges = edges ?? getEdges(shape);
329
342
  if (selectedEdges.length === 0) return err(validationError(BrepErrorCode.FILLET_NO_EDGES, "No edges found for fillet", void 0, void 0, "Check that the shape has edges, or adjust your edge finder criteria"));
330
343
  if (typeof radius === "function") {
331
- const resolved = resolveEdgeCallback$1(selectedEdges, radius);
344
+ const resolved = resolveEdgeCallback$1(selectedEdges, radius, isFilletRadiusPair);
332
345
  if (!resolved) return err(validationError(BrepErrorCode.FILLET_NO_EDGES, "No edges with positive radius for fillet", void 0, void 0, "Check that the radius callback returns positive values"));
333
346
  return ok({
334
347
  filteredEdges: resolved.edges,
@@ -594,6 +607,8 @@ function draft(shape, faces, pullDirection, neutralPlane, angle) {
594
607
  *
595
608
  * The radius varies along the edge according to the provided spec points.
596
609
  * Each point specifies a normalized parameter (0 = start, 1 = end) and radius.
610
+ * A radius may be 0, so the fillet runs out to nothing there, as long as one
611
+ * is positive.
597
612
  *
598
613
  * **Cross-kernel note:** occt-wasm and brepkit build a constant or linear
599
614
  * (start/end, <=2-point) profile and return `UNSUPPORTED_CAPABILITY` for one of
@@ -601,7 +616,7 @@ function draft(shape, faces, pullDirection, neutralPlane, angle) {
601
616
  */
602
617
  function variableFillet(shape, edge, radii) {
603
618
  if (radii.length === 0) return err(validationError(BrepErrorCode.VARIABLE_FILLET_FAILED, "radii must contain at least one radius spec"));
604
- for (const r of radii) if (r.radius <= 0) return err(validationError(BrepErrorCode.VARIABLE_FILLET_FAILED, "All radius values must be positive"));
619
+ if (radii.some((r) => r.radius < 0) || radii.every((r) => r.radius === 0)) return err(validationError(BrepErrorCode.VARIABLE_FILLET_FAILED, "Radius values must not be negative, and one must be positive"));
605
620
  const kernel = getKernel();
606
621
  try {
607
622
  const spec = JSON.stringify({
@@ -1153,13 +1168,13 @@ function castToShape3D(shape, errorCode, errorMsg, suggestion) {
1153
1168
  disposeDowncastSource(shape, wrapped);
1154
1169
  return ok(wrapped);
1155
1170
  }
1156
- function resolveEdgeCallback(selectedEdges, callbackFn) {
1171
+ function resolveEdgeCallback(selectedEdges, callbackFn, isValidPair = ([a, b]) => a > 0 && b > 0) {
1157
1172
  const filteredEdges = [];
1158
1173
  const hashToValue = /* @__PURE__ */ new Map();
1159
1174
  for (const edge of selectedEdges) {
1160
1175
  const val = callbackFn(edge) ?? 0;
1161
1176
  if (typeof val === "number" && val <= 0) continue;
1162
- if (Array.isArray(val) && (val[0] <= 0 || val[1] <= 0)) continue;
1177
+ if (Array.isArray(val) && !isValidPair(val)) continue;
1163
1178
  filteredEdges.push(edge);
1164
1179
  hashToValue.set(getKernel().hashCode(edge.wrapped, HASH_CODE_MAX), val);
1165
1180
  }
@@ -1249,14 +1264,14 @@ function filletWithEvolution(shape, edges, radius) {
1249
1264
  const check = validateNotNull(shape, "filletWithEvolution: shape");
1250
1265
  if (isErr(check)) return check;
1251
1266
  if (typeof radius === "number" && radius <= 0) return err(validationError("INVALID_FILLET_RADIUS", "Fillet radius must be positive", void 0, void 0, "Provide a positive radius value greater than 0"));
1252
- if (Array.isArray(radius) && (radius[0] <= 0 || radius[1] <= 0)) return err(validationError("INVALID_FILLET_RADIUS", "Fillet radii must both be positive", void 0, void 0, "Both radius values must be greater than 0"));
1267
+ if (Array.isArray(radius) && !isFilletRadiusPair(radius)) return err(validationError("INVALID_FILLET_RADIUS", FILLET_PAIR_MESSAGE, void 0, void 0, FILLET_PAIR_HINT));
1253
1268
  const selectedEdges = edges ?? getEdges(shape);
1254
1269
  if (selectedEdges.length === 0) return err(validationError(BrepErrorCode.FILLET_NO_EDGES, "No edges found for fillet", void 0, void 0, "Check that the shape has edges, or adjust your edge finder criteria"));
1255
1270
  try {
1256
1271
  let filteredEdges;
1257
1272
  let kernelRadius;
1258
1273
  if (typeof radius === "function") {
1259
- const resolved = resolveEdgeCallback(selectedEdges, radius);
1274
+ const resolved = resolveEdgeCallback(selectedEdges, radius, isFilletRadiusPair);
1260
1275
  if (!resolved) return err(validationError(BrepErrorCode.FILLET_NO_EDGES, "No edges with positive radius for fillet", void 0, void 0, "Check that the radius callback returns positive values"));
1261
1276
  filteredEdges = resolved.edges;
1262
1277
  kernelRadius = resolved.kernelParam;
@@ -1,12 +1,12 @@
1
- const require_shapeTypes = require("./shapeTypes-DEe6gtTR.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CgayxMvX.cjs");
2
2
  const require_errors = require("./errors-O_blYTWT.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-I_m8o-s7.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-EI-aso9K.cjs");
4
4
  const require_constants = require("./constants-oee0S_x6.cjs");
5
5
  const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
6
- const require_faceFns = require("./faceFns-dj_c8LVc.cjs");
7
- const require_shapeFns = require("./shapeFns-CljM3iMI.cjs");
8
- const require_curveFns = require("./curveFns-QaNfJzko.cjs");
9
- const require_measureFns = require("./measureFns-FrNeGmXh.cjs");
6
+ const require_faceFns = require("./faceFns-CPGJ_cx6.cjs");
7
+ const require_shapeFns = require("./shapeFns-Cklw3p3S.cjs");
8
+ const require_curveFns = require("./curveFns-m73YVbFb.cjs");
9
+ const require_measureFns = require("./measureFns-CpoPgAZt.cjs");
10
10
  // src/utils/vec2d.ts
11
11
  /** Precision for curve intersection and parameter operations. */
12
12
  var PRECISION_INTERSECTION = 1e-9;
@@ -1,12 +1,12 @@
1
- import { q as getKernel, y as isFace } from "./shapeTypes-w2wyXEis.js";
1
+ import { q as getKernel, y as isFace } from "./shapeTypes-qhs8f2zx.js";
2
2
  import { E as ok, g as err, o as queryError, x as isOk } from "./errors-BTccWbtE.js";
3
- import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-CTl4cWYD.js";
3
+ import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-CArmw9sE.js";
4
4
  import { t as DEG2RAD } from "./constants-iraOnb2p.js";
5
5
  import { a as vecDot, d as vecNormalize } from "./vecOps-S-m9H_fe.js";
6
- import { l as normalAt, s as getSurfaceType } from "./faceFns-BG1CBQUM.js";
7
- import { a as isSameShape, n as getHashCode } from "./shapeFns-BRRrZc1X.js";
8
- import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-Dzgl3_MC.js";
9
- import { r as measureArea } from "./measureFns-WGYWWnQ1.js";
6
+ import { l as normalAt, s as getSurfaceType } from "./faceFns-BNv6thpF.js";
7
+ import { a as isSameShape, n as getHashCode } from "./shapeFns-3NzCE2kz.js";
8
+ import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-CGQCy_D5.js";
9
+ import { r as measureArea } from "./measureFns-MSr05_kf.js";
10
10
  // src/utils/vec2d.ts
11
11
  /** Precision for curve intersection and parameter operations. */
12
12
  var PRECISION_INTERSECTION = 1e-9;
@@ -1,12 +1,12 @@
1
- import { C as isSolid, G as _usingCtx, S as isShell, _ as isCompound, n as castResultShape, q as getKernel } from "./shapeTypes-w2wyXEis.js";
1
+ import { C as isSolid, G as _usingCtx, S as isShell, _ as isCompound, n as castResultShape, q as getKernel } from "./shapeTypes-qhs8f2zx.js";
2
2
  import { i as wasmIndex, r as vec3At$1 } from "./bug-ClMTAJhe.js";
3
3
  import { E as ok, g as err, r as ioError, t as BrepErrorCode } from "./errors-BTccWbtE.js";
4
- import { S as subShapeCount, c as getFaces, u as getShells } from "./topologyQueryFns-CTl4cWYD.js";
4
+ import { S as subShapeCount, c as getFaces, u as getShells } from "./topologyQueryFns-CArmw9sE.js";
5
5
  import { n as HASH_CODE_MAX } from "./constants-iraOnb2p.js";
6
- import { t as makeCompound } from "./solidBuilders-BxIYXIv-.js";
7
- import { u as igesUnsupportedError } from "./meshFns-Lie8oAac.js";
6
+ import { t as makeCompound } from "./solidBuilders-DhDGnOTQ.js";
7
+ import { u as igesUnsupportedError } from "./meshFns-BIWD7IFN.js";
8
8
  import { n as getAtOrThrow } from "./arrayAccess-BpgouNir.js";
9
- import { c as make2dBezierCurve, h as make2dThreePointArc, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-BzI6waZa.js";
9
+ import { c as make2dBezierCurve, h as make2dThreePointArc, p as make2dSegmentCurve, t as Blueprint } from "./blueprint-2j8szIQ6.js";
10
10
  // src/io/objExportFns.ts
11
11
  /** Read a vec3 from a typed array at the given vertex index. */
12
12
  function vec3At(arr, i) {
@@ -1,12 +1,12 @@
1
- const require_shapeTypes = require("./shapeTypes-DEe6gtTR.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CgayxMvX.cjs");
2
2
  const require_bug = require("./bug-CBcpIPuf.cjs");
3
3
  const require_errors = require("./errors-O_blYTWT.cjs");
4
- const require_topologyQueryFns = require("./topologyQueryFns-I_m8o-s7.cjs");
4
+ const require_topologyQueryFns = require("./topologyQueryFns-EI-aso9K.cjs");
5
5
  const require_constants = require("./constants-oee0S_x6.cjs");
6
- const require_solidBuilders = require("./solidBuilders-yQFZe6jf.cjs");
7
- const require_meshFns = require("./meshFns-Dy1a9wl_.cjs");
6
+ const require_solidBuilders = require("./solidBuilders-BvIdZUkI.cjs");
7
+ const require_meshFns = require("./meshFns-BxRKwY5z.cjs");
8
8
  const require_arrayAccess = require("./arrayAccess-DpJYARwv.cjs");
9
- const require_blueprint = require("./blueprint-DlpFhHbU.cjs");
9
+ const require_blueprint = require("./blueprint-Cfj9EupK.cjs");
10
10
  // src/io/objExportFns.ts
11
11
  /** Read a vec3 from a typed array at the given vertex index. */
12
12
  function vec3At(arr, i) {
package/dist/io.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_meshFns = require("./meshFns-Dy1a9wl_.cjs");
3
- const require_importFns = require("./importFns-CZb21dj7.cjs");
2
+ const require_meshFns = require("./meshFns-BxRKwY5z.cjs");
3
+ const require_importFns = require("./importFns-zfbC3bIK.cjs");
4
4
  exports.blueprintToDXF = require_importFns.blueprintToDXF;
5
5
  exports.exportDXF = require_importFns.exportDXF;
6
6
  exports.exportGlb = require_importFns.exportGlb;
package/dist/io.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-Lie8oAac.js";
2
- import { a as exportSTEPConfigured, c as exportThreeMF, d as exportGlb, f as exportGltf, l as blueprintToDXF, n as importSTEP, o as importSVG, p as exportOBJ, r as importSTL, s as importSVGPathD, t as importIGES, u as exportDXF } from "./importFns-D1AxkVC3.js";
1
+ import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-BIWD7IFN.js";
2
+ import { a as exportSTEPConfigured, c as exportThreeMF, d as exportGlb, f as exportGltf, l as blueprintToDXF, n as importSTEP, o as importSVG, p as exportOBJ, r as importSTL, s as importSVGPathD, t as importIGES, u as exportDXF } from "./importFns-DQgcQQCb.js";
3
3
  export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
@@ -28,13 +28,23 @@ export declare function multiplyMatrices4x4(a: number[], b: number[]): number[];
28
28
  /** A fillet's start and end radius, or a chamfer's two setbacks. A number is both. */
29
29
  type EdgeValue = number | [number, number];
30
30
  export type EdgeValueSpec = EdgeValue | ((edge: KernelShape) => EdgeValue);
31
+ /** Per-edge values as parallel arrays, one entry per edge. */
32
+ interface EdgeValues {
33
+ readonly first: number[];
34
+ readonly second: number[];
35
+ }
36
+ /**
37
+ * occt-wasm's fillet entry points take only positive radii, though its
38
+ * single-edge filletVariable builds a fillet that runs out to a radius of 0.
39
+ */
40
+ export declare function refuseVanishingFilletRadius({ first, second }: EdgeValues): void;
31
41
  /**
32
42
  * Run a fillet or chamfer over `edges`, naming the edges it fails on. Edges
33
43
  * that all take one value go to `uniform`, the single-value entry point every
34
44
  * occt-wasm build has; otherwise `perEdge` gets each edge's pair as `first`
35
- * and `second`.
45
+ * and `second`. `check` sees the resolved values first and throws to refuse them.
36
46
  */
37
- export declare function runEdgeTreatment<T>(Module: OcctWasmModule, edges: KernelShape[], value: EdgeValueSpec, uniform: (edgeVec: EmVectorUint32, value: number) => T, perEdge: (edgeVec: EmVectorUint32, first: EmVectorDouble, second: EmVectorDouble) => T): T;
47
+ export declare function runEdgeTreatment<T>(Module: OcctWasmModule, edges: KernelShape[], value: EdgeValueSpec, uniform: (edgeVec: EmVectorUint32, value: number) => T, perEdge: (edgeVec: EmVectorUint32, first: EmVectorDouble, second: EmVectorDouble) => T, check?: (values: EdgeValues) => void): T;
38
48
  /**
39
49
  * A per-edge chamfer's `referenceFaceIds`: empty when no edge names its
40
50
  * reference face, else one id per edge, 0 where the facade picks the face.
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_occtWasmAdapter = require("../../occtWasmAdapter-B9ZXx36v.cjs");
2
+ const require_occtWasmAdapter = require("../../occtWasmAdapter-BH1JcAgl.cjs");
3
3
  exports.OcctWasmAdapter = require_occtWasmAdapter.OcctWasmAdapter;
@@ -1 +1 @@
1
- export { t as OcctWasmAdapter } from "../../occtWasmAdapter-CGkZIHyM.js";
1
+ export { t as OcctWasmAdapter } from "../../occtWasmAdapter-DD_6IAVj.js";
@@ -1,5 +1,5 @@
1
- const require_shapeTypes = require("./shapeTypes-DEe6gtTR.cjs");
2
- const require_occtWasmAdapter = require("./occtWasmAdapter-B9ZXx36v.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CgayxMvX.cjs");
2
+ const require_occtWasmAdapter = require("./occtWasmAdapter-BH1JcAgl.cjs");
3
3
  const require_errors = require("./errors-O_blYTWT.cjs");
4
4
  const require_types = require("./types-CjF9Rofr.cjs");
5
5
  const require_vecOps = require("./vecOps-CrGEPPQM.cjs");
@@ -1,5 +1,5 @@
1
- import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-w2wyXEis.js";
2
- import { j as isUnsupportedKernelOperationError } from "./occtWasmAdapter-CGkZIHyM.js";
1
+ import { G as _usingCtx, T as isWire, h as disposeResultShape, n as castResultShape, q as getKernel, x as isShape3D } from "./shapeTypes-qhs8f2zx.js";
2
+ import { j as isUnsupportedKernelOperationError } from "./occtWasmAdapter-DD_6IAVj.js";
3
3
  import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode, u as unsupportedError } from "./errors-BTccWbtE.js";
4
4
  import { r as toVec3 } from "./types-CKXsIm9-.js";
5
5
  import { c as vecLength, t as vecAdd } from "./vecOps-S-m9H_fe.js";
@@ -1,8 +1,8 @@
1
- const require_shapeTypes = require("./shapeTypes-DEe6gtTR.cjs");
2
- const require_occtWasmAdapter = require("./occtWasmAdapter-B9ZXx36v.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CgayxMvX.cjs");
2
+ const require_occtWasmAdapter = require("./occtWasmAdapter-BH1JcAgl.cjs");
3
3
  const require_errors = require("./errors-O_blYTWT.cjs");
4
- const require_topologyQueryFns = require("./topologyQueryFns-I_m8o-s7.cjs");
5
- const require_faceFns = require("./faceFns-dj_c8LVc.cjs");
4
+ const require_topologyQueryFns = require("./topologyQueryFns-EI-aso9K.cjs");
5
+ const require_faceFns = require("./faceFns-CPGJ_cx6.cjs");
6
6
  // src/measurement/measureCache.ts
7
7
  var cache = /* @__PURE__ */ new WeakMap();
8
8
  function getCachedMeasurement(shape, key) {
@@ -1,8 +1,8 @@
1
- import { q as getKernel } from "./shapeTypes-w2wyXEis.js";
2
- import { j as isUnsupportedKernelOperationError } from "./occtWasmAdapter-CGkZIHyM.js";
1
+ import { q as getKernel } from "./shapeTypes-qhs8f2zx.js";
2
+ import { j as isUnsupportedKernelOperationError } from "./occtWasmAdapter-DD_6IAVj.js";
3
3
  import { E as ok, d as validationError, g as err, t as BrepErrorCode, u as unsupportedError } from "./errors-BTccWbtE.js";
4
- import { E as kernelCallRaw } from "./topologyQueryFns-CTl4cWYD.js";
5
- import { m as uvBounds } from "./faceFns-BG1CBQUM.js";
4
+ import { E as kernelCallRaw } from "./topologyQueryFns-CArmw9sE.js";
5
+ import { m as uvBounds } from "./faceFns-BNv6thpF.js";
6
6
  // src/measurement/measureCache.ts
7
7
  var cache = /* @__PURE__ */ new WeakMap();
8
8
  function getCachedMeasurement(shape, key) {
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_measureFns = require("./measureFns-FrNeGmXh.cjs");
3
- const require_principalBoxFns = require("./principalBoxFns-3ZURcOFP.cjs");
2
+ const require_measureFns = require("./measureFns-CpoPgAZt.cjs");
3
+ const require_principalBoxFns = require("./principalBoxFns-CNSK-z3k.cjs");
4
4
  exports.createDistanceQuery = require_measureFns.createDistanceQuery;
5
5
  exports.measureArea = require_measureFns.measureArea;
6
6
  exports.measureDistance = require_measureFns.measureDistance;
@@ -1,3 +1,3 @@
1
- import { c as measureLength, d as measureVolume, f as measureVolumeProps, l as measureLinearProps, o as measureDistance, r as measureArea, s as measureDistanceProps, t as createDistanceQuery, u as measureSurfaceProps } from "./measureFns-WGYWWnQ1.js";
2
- import { t as principalBoundingBox } from "./principalBoxFns-CjfJnZfH.js";
1
+ import { c as measureLength, d as measureVolume, f as measureVolumeProps, l as measureLinearProps, o as measureDistance, r as measureArea, s as measureDistanceProps, t as createDistanceQuery, u as measureSurfaceProps } from "./measureFns-MSr05_kf.js";
2
+ import { t as principalBoundingBox } from "./principalBoxFns-CBWLch1h.js";
3
3
  export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps, principalBoundingBox };
@@ -1,8 +1,8 @@
1
- import { q as getKernel, ut as qualityDeflection } from "./shapeTypes-w2wyXEis.js";
2
- import { j as isUnsupportedKernelOperationError } from "./occtWasmAdapter-CGkZIHyM.js";
1
+ import { q as getKernel, ut as qualityDeflection } from "./shapeTypes-qhs8f2zx.js";
2
+ import { j as isUnsupportedKernelOperationError } from "./occtWasmAdapter-DD_6IAVj.js";
3
3
  import { E as ok, g as err, r as ioError, t as BrepErrorCode, u as unsupportedError } from "./errors-BTccWbtE.js";
4
- import { d as getSolids, n as getBounds } from "./topologyQueryFns-CTl4cWYD.js";
5
- import { d as getFaceOrigins } from "./solidBuilders-BxIYXIv-.js";
4
+ import { d as getSolids, n as getBounds } from "./topologyQueryFns-CArmw9sE.js";
5
+ import { d as getFaceOrigins } from "./solidBuilders-DhDGnOTQ.js";
6
6
  // src/topology/meshCache.ts
7
7
  /**
8
8
  * Build a parameter key for the inner cache map (excludes shape identity).
@@ -1,8 +1,8 @@
1
- const require_shapeTypes = require("./shapeTypes-DEe6gtTR.cjs");
2
- const require_occtWasmAdapter = require("./occtWasmAdapter-B9ZXx36v.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CgayxMvX.cjs");
2
+ const require_occtWasmAdapter = require("./occtWasmAdapter-BH1JcAgl.cjs");
3
3
  const require_errors = require("./errors-O_blYTWT.cjs");
4
- const require_topologyQueryFns = require("./topologyQueryFns-I_m8o-s7.cjs");
5
- const require_solidBuilders = require("./solidBuilders-yQFZe6jf.cjs");
4
+ const require_topologyQueryFns = require("./topologyQueryFns-EI-aso9K.cjs");
5
+ const require_solidBuilders = require("./solidBuilders-BvIdZUkI.cjs");
6
6
  // src/topology/meshCache.ts
7
7
  /**
8
8
  * Build a parameter key for the inner cache map (excludes shape identity).
@@ -2313,6 +2313,13 @@ function resolveEdgeValues(edges, value) {
2313
2313
  second
2314
2314
  };
2315
2315
  }
2316
+ /**
2317
+ * occt-wasm's fillet entry points take only positive radii, though its
2318
+ * single-edge filletVariable builds a fillet that runs out to a radius of 0.
2319
+ */
2320
+ function refuseVanishingFilletRadius({ first, second }) {
2321
+ if (first.includes(0) || second.includes(0)) throw new UnsupportedKernelOperationError("occt-wasm: a fillet radius that runs to 0 is built only by variableFillet");
2322
+ }
2316
2323
  /** The value every edge takes on both sides, or `undefined` when they differ. */
2317
2324
  function uniformEdgeValue({ first, second }) {
2318
2325
  const [value] = first;
@@ -2323,10 +2330,11 @@ function uniformEdgeValue({ first, second }) {
2323
2330
  * Run a fillet or chamfer over `edges`, naming the edges it fails on. Edges
2324
2331
  * that all take one value go to `uniform`, the single-value entry point every
2325
2332
  * occt-wasm build has; otherwise `perEdge` gets each edge's pair as `first`
2326
- * and `second`.
2333
+ * and `second`. `check` sees the resolved values first and throws to refuse them.
2327
2334
  */
2328
- function runEdgeTreatment(Module, edges, value, uniform, perEdge) {
2335
+ function runEdgeTreatment(Module, edges, value, uniform, perEdge, check) {
2329
2336
  const values = resolveEdgeValues(edges, value);
2337
+ check?.(values);
2330
2338
  const shared = uniformEdgeValue(values);
2331
2339
  const edgeVec = makeVecU32(Module, edges.map(unwrap));
2332
2340
  try {
@@ -3813,7 +3821,7 @@ function fillet(k, Module, shape, edges, radius) {
3813
3821
  return wrapResult(k, runEdgeTreatment(Module, edges, radius, (edgeVec, r) => k.fillet(id, edgeVec, r), (edgeVec, startRadii, endRadii) => {
3814
3822
  if (!k.filletRadii) throw needsOcctWasm59("per-edge or tapered fillet radii");
3815
3823
  return k.filletRadii(id, edgeVec, startRadii, endRadii);
3816
- }));
3824
+ }, refuseVanishingFilletRadius));
3817
3825
  }
3818
3826
  function chamfer(k, Module, shape, edges, distance) {
3819
3827
  const id = unwrap(shape);
@@ -6259,7 +6267,7 @@ function filletWithHistory(k, Module, shape, edges, radius, inputFaceHashes, has
6259
6267
  const { id, evolution } = parseEvolution(runEdgeTreatment(Module, edges, radius, (edgeVec, r) => k.filletWithHistory(shapeId, edgeVec, r, hashVec, hashUpperBound), (edgeVec, startRadii, endRadii) => {
6260
6268
  if (!k.filletRadiiWithHistory) throw needsOcctWasm59("per-edge or tapered fillet radii");
6261
6269
  return k.filletRadiiWithHistory(shapeId, edgeVec, startRadii, endRadii, hashVec, hashUpperBound);
6262
- }));
6270
+ }, refuseVanishingFilletRadius));
6263
6271
  return {
6264
6272
  shape: wrapResult(k, id),
6265
6273
  evolution