brepjs 18.119.2 → 18.119.4

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 (100) hide show
  1. package/dist/2d/blueprints/blueprints.d.ts +3 -0
  2. package/dist/2d/blueprints/compoundBlueprint.d.ts +3 -0
  3. package/dist/2d/blueprints/lib.d.ts +6 -0
  4. package/dist/2d/lib/curve2D.d.ts +6 -1
  5. package/dist/2d/lib/curve2dFns.d.ts +6 -1
  6. package/dist/2d.cjs +7 -7
  7. package/dist/2d.js +7 -7
  8. package/dist/{adjacencyFns-BdM5p58J.js → adjacencyFns-DLityMyV.js} +2 -2
  9. package/dist/{adjacencyFns-Brrc7jlS.cjs → adjacencyFns-DSxuQYnb.cjs} +2 -2
  10. package/dist/{blueprint-DJJo8WkI.js → blueprint-DEMSX-hc.js} +37 -10
  11. package/dist/{blueprint-DTNT4qYJ.cjs → blueprint-DUnNPwQL.cjs} +43 -10
  12. package/dist/{blueprintFns-CcpboZ80.js → blueprintFns-DSj4RTjU.js} +9 -4
  13. package/dist/{blueprintFns-2XDZfCxX.cjs → blueprintFns-Dg8V99O9.cjs} +9 -4
  14. package/dist/{blueprintSketcher-DDPyypmC.js → blueprintSketcher-gMuUUPb-.js} +185 -54
  15. package/dist/{blueprintSketcher-C0EXFVb2.cjs → blueprintSketcher-gXVPrPlj.cjs} +192 -61
  16. package/dist/{boolean2D-Ddfo_dd0.cjs → boolean2D-BpmxQ1AH.cjs} +5 -5
  17. package/dist/{boolean2D-C_PVz8xT.js → boolean2D-DKT0BgZs.js} +5 -5
  18. package/dist/brepjs.cjs +105 -92
  19. package/dist/brepjs.js +39 -27
  20. package/dist/{cameraFns-Czr5vABD.cjs → cameraFns-2-haLzLi.cjs} +4 -4
  21. package/dist/{cameraFns-D9tdBYLM.js → cameraFns-CG_J66Hl.js} +4 -4
  22. package/dist/core.cjs +12 -11
  23. package/dist/core.js +4 -3
  24. package/dist/{cornerFinder-Cqg-Dz74.js → cornerFinder-CPFM7bA0.js} +1 -1
  25. package/dist/{cornerFinder-DETRDOMz.cjs → cornerFinder-mfsUMi5g.cjs} +1 -1
  26. package/dist/{curveFns-RENXKp64.js → curveFns-DX13KRh2.js} +2 -2
  27. package/dist/{curveFns-D7utcbnf.cjs → curveFns-GmFnqNo3.cjs} +2 -2
  28. package/dist/{drawFns-D9Rf4foW.cjs → drawFns-CI6CpqO8.cjs} +35 -16
  29. package/dist/{drawFns-B9HbtAoc.js → drawFns-CrfBz_wj.js} +35 -16
  30. package/dist/{errors-B3CDG537.js → errors-MHLiNE-C.js} +1 -92
  31. package/dist/{errors-CJU8CHng.cjs → errors-RHkKO5bZ.cjs} +0 -103
  32. package/dist/{faceFns-CPswi9Cm.cjs → faceFns-BK4r7Dxk.cjs} +3 -3
  33. package/dist/{faceFns-CB6uzvOg.js → faceFns-DJj9Nb6T.js} +3 -3
  34. package/dist/{healingFns-BFTYLiAm.js → healingFns-DxcRyVCG.js} +5 -6
  35. package/dist/{healingFns-bhMxTTqw.cjs → healingFns-Hx4oTlq8.cjs} +27 -28
  36. package/dist/{helpers-Cu4ag5bh.cjs → helpers-BfkBvokP.cjs} +8 -24
  37. package/dist/{helpers-BiN4qQZP.js → helpers-Du_OdHuy.js} +9 -25
  38. package/dist/{importFns-X8vBhZI2.js → importFns-DqxAZFb-.js} +3 -3
  39. package/dist/{importFns-DS4J1xLv.cjs → importFns-pr-r5qiV.cjs} +3 -3
  40. package/dist/io.cjs +2 -2
  41. package/dist/io.js +2 -2
  42. package/dist/{loftFns-ChHjzUK-.cjs → loftFns-BdpZ8FMN.cjs} +2 -125
  43. package/dist/{loftFns-BF5X7ltI.js → loftFns-BeGJ6dxx.js} +4 -109
  44. package/dist/{measureFns-B5Zzg1qM.cjs → measureFns-CJGrmhHT.cjs} +4 -4
  45. package/dist/{measureFns-CC7HhAH3.js → measureFns-CMnbcUZC.js} +4 -4
  46. package/dist/measurement.cjs +1 -1
  47. package/dist/measurement.js +1 -1
  48. package/dist/{meshFns-D57Fyqyf.js → meshFns-Cs5EBsf7.js} +4 -4
  49. package/dist/{meshFns-CaXmWmhe.cjs → meshFns-Dqf5QBhQ.cjs} +5 -5
  50. package/dist/operations.cjs +2 -2
  51. package/dist/operations.js +2 -2
  52. package/dist/originTrackingFns-DZmdiQ-O.js +203 -0
  53. package/dist/originTrackingFns-fpEgTIwV.cjs +226 -0
  54. package/dist/{planeOps-Cp6GQ23-.js → planeOps-CQahLrCx.js} +1 -1
  55. package/dist/{planeOps-Cr25KWWA.cjs → planeOps-VlFxtvzY.cjs} +1 -1
  56. package/dist/primitiveFns-B_rflH83.cjs +773 -0
  57. package/dist/primitiveFns-Cxo3xDKY.js +558 -0
  58. package/dist/projection.cjs +1 -1
  59. package/dist/projection.js +1 -1
  60. package/dist/query.cjs +2 -2
  61. package/dist/query.js +2 -2
  62. package/dist/{refResolveFns-3bw9-U-e.js → refResolveFns-BbRLD8LA.js} +6 -6
  63. package/dist/{refResolveFns-BxmgIhQM.cjs → refResolveFns-CVDLwh12.cjs} +6 -6
  64. package/dist/result.cjs +1 -1
  65. package/dist/result.js +1 -1
  66. package/dist/rolldown-runtime-DakpK96I.cjs +43 -0
  67. package/dist/shapeFns-BTFx-os7.js +43 -0
  68. package/dist/shapeFns-D_5TgiUi.cjs +84 -0
  69. package/dist/shapeRef.cjs +1 -1
  70. package/dist/shapeRef.js +1 -1
  71. package/dist/{shapeTypes-Bpsu5KJO.cjs → shapeTypes-CkcIL7zv.cjs} +1 -222
  72. package/dist/{shapeTypes-CnKFSfDT.js → shapeTypes-t49f64Dx.js} +2 -139
  73. package/dist/sketching/drawing.d.ts +9 -1
  74. package/dist/sketching.cjs +3 -3
  75. package/dist/sketching.js +3 -3
  76. package/dist/{solidBuilders-I8_V8qqU.js → solidBuilders-DTgqQC3W.js} +310 -8
  77. package/dist/{solidBuilders-Bp7lQW62.cjs → solidBuilders-IiIzjKAr.cjs} +401 -15
  78. package/dist/{surfaceBuilders-D8_08oOR.cjs → surfaceBuilders-Biqx51el.cjs} +6 -5
  79. package/dist/{surfaceBuilders-BNR7yMQO.js → surfaceBuilders-BryY-i0F.js} +4 -3
  80. package/dist/text.cjs +2 -2
  81. package/dist/text.js +2 -2
  82. package/dist/{textBlueprints-B5zcLGvJ.cjs → textBlueprints-BY0FEg59.cjs} +138 -51
  83. package/dist/{textBlueprints-igbNvKcd.js → textBlueprints-ZzYg3XTS.js} +116 -11
  84. package/dist/{textMetrics-CJvtpbc3.js → textMetrics-Diakbtem.js} +2 -2
  85. package/dist/{textMetrics-08fF0QNf.cjs → textMetrics-f5yXR4OG.cjs} +2 -2
  86. package/dist/{threadFns-CqSMNyTZ.js → threadFns-BOtXTHZ9.js} +8 -8
  87. package/dist/{threadFns-Co6vWEWx.cjs → threadFns-DRrk9Qod.cjs} +8 -8
  88. package/dist/topology.cjs +9 -9
  89. package/dist/topology.js +9 -9
  90. package/dist/{topologyQueryFns-C3fhJndG.cjs → topologyQueryFns-Bia7o8l_.cjs} +97 -6
  91. package/dist/{topologyQueryFns-DNqT88yx.js → topologyQueryFns-BkQ6Q7gN.js} +93 -2
  92. package/dist/validityTypes-DiTgeCD9.js +129 -0
  93. package/dist/validityTypes-ZGMVlv7b.cjs +200 -0
  94. package/dist/vectors.cjs +1 -1
  95. package/dist/vectors.js +1 -1
  96. package/package.json +8 -8
  97. package/dist/primitiveFns-CRy_CUVg.cjs +0 -492
  98. package/dist/primitiveFns-DCIH-SBm.js +0 -331
  99. package/dist/shapeFns-BrHFNLMA.js +0 -771
  100. package/dist/shapeFns-qm9VRo4i.cjs +0 -962
@@ -165,97 +165,6 @@ function pipeline(input) {
165
165
  return makePipeline(initial);
166
166
  }
167
167
  //#endregion
168
- //#region src/core/kernelErrorTranslation.ts
169
- /**
170
- * Kernel error translation — maps cryptic kernel messages to user-friendly explanations.
171
- *
172
- * Extracted from errors.ts to separate pure type/constructor definitions
173
- * from OCCT-specific regex matching logic.
174
- */
175
- /**
176
- * Common kernel error patterns and their user-friendly translations.
177
- * Used by kernelCall to provide actionable error messages.
178
- */
179
- var kernel_ERROR_PATTERNS = [
180
- {
181
- pattern: /invalid edge configuration|edges?.*(not|fail|invalid)/i,
182
- translation: "The edges may not form a continuous loop. Check that edges connect end-to-end without gaps."
183
- },
184
- {
185
- pattern: /BRepAlgoAPI.*failed|boolean.*operation.*failed/i,
186
- translation: "Boolean operation failed. Common causes: overlapping faces, zero-thickness geometry, or degenerate shapes. Try healing input shapes first."
187
- },
188
- {
189
- pattern: /fillet.*radius.*too.*large|fillet.*failed/i,
190
- translation: "Fillet operation failed. The radius may be too large for the selected edges. Try reducing the radius or check that edges have enough room."
191
- },
192
- {
193
- pattern: /chamfer.*failed|chamfer.*distance.*too.*large/i,
194
- translation: "Chamfer operation failed. The distance may be too large for the selected edges. Try reducing the distance or check edge geometry."
195
- },
196
- {
197
- pattern: /shell.*failed|offset.*failed/i,
198
- translation: "Shell/offset operation failed. The thickness may be too large, or the shape may have complex geometry. Try reducing thickness."
199
- },
200
- {
201
- pattern: /sweep.*failed|pipe.*failed/i,
202
- translation: "Sweep operation failed. Check that the profile and spine are compatible, and that the spine has no sharp twists or self-intersections."
203
- },
204
- {
205
- pattern: /loft.*failed/i,
206
- translation: "Loft operation failed. Profiles may be incompatible or have different orientations. Ensure profiles are ordered consistently."
207
- },
208
- {
209
- pattern: /extrude.*failed|prism.*failed/i,
210
- translation: "Extrusion failed. The profile may be invalid or self-intersecting. Check that the profile forms a valid closed wire."
211
- },
212
- {
213
- pattern: /revolve.*failed|revolution.*failed/i,
214
- translation: "Revolution operation failed. The profile may intersect the axis of revolution, or the angle may be invalid."
215
- },
216
- {
217
- pattern: /self.*intersect|self-intersect/i,
218
- translation: "Shape has self-intersections. The operation resulted in overlapping geometry. Simplify the input or adjust parameters."
219
- },
220
- {
221
- pattern: /degener|degenerat/i,
222
- translation: "Degenerate geometry detected. The shape has edges or faces with zero length/area. Check input geometry for collapsed elements."
223
- },
224
- {
225
- pattern: /BRepCheck.*fail|shape.*invalid|shape.*not.*valid/i,
226
- translation: "Shape validation failed. The resulting shape has invalid topology. Try healing the shape or checking input geometry."
227
- }
228
- ];
229
- var ERROR_CODE_SUGGESTIONS = {
230
- FUSE_FAILED: "Try autoHeal() on both operands before the boolean operation. Check for overlapping faces or zero-thickness geometry.",
231
- CUT_FAILED: "Try autoHeal() on both operands before the boolean operation. Check for overlapping faces or zero-thickness geometry.",
232
- FUSE_NOT_3D: "The boolean result was not a 3D solid. Ensure both input shapes are valid 3D solids, not shells or open surfaces.",
233
- CUT_NOT_3D: "The boolean result was not a 3D solid. Ensure both input shapes are valid 3D solids, not shells or open surfaces.",
234
- INTERSECT_NOT_3D: "The boolean result was not a 3D solid. Ensure both input shapes are valid 3D solids, not shells or open surfaces.",
235
- SWEEP_FAILED: "Ensure the spine curve has no sharp corners or self-intersections. Try simplifying the profile or using a smoother path.",
236
- LOFT_FAILED: "Check that all profiles have the same number of edges and consistent orientation. Try reordering profiles.",
237
- FILLET_NOT_3D: "The fillet radius may be too large for the selected edges. Try a smaller radius or check that adjacent faces have enough room.",
238
- CHAMFER_NOT_3D: "The chamfer distance may be too large. Try a smaller distance or check edge geometry.",
239
- SHELL_NOT_3D: "The shell thickness may be too large for the shape. Try reducing thickness or removing problematic faces.",
240
- OFFSET_NOT_3D: "The offset distance may be too large for the shape geometry. Try a smaller distance.",
241
- DRAFT_FAILED: "The draft angle may be too large or the selected faces incompatible. Try a smaller angle or different faces."
242
- };
243
- /** Look up an actionable suggestion for a given error code. */
244
- function getSuggestionForCode(code) {
245
- return ERROR_CODE_SUGGESTIONS[code];
246
- }
247
- /**
248
- * Translate an kernel error message into a user-friendly explanation.
249
- * If no pattern matches, returns the original message.
250
- *
251
- * @param kernelMessage - The raw error message from kernel
252
- * @returns User-friendly error message with actionable guidance
253
- */
254
- function translateKernelError(kernelMessage) {
255
- for (const { pattern, translation } of kernel_ERROR_PATTERNS) if (pattern.test(kernelMessage)) return `${translation} (kernel: ${kernelMessage})`;
256
- return kernelMessage;
257
- }
258
- //#endregion
259
168
  //#region src/core/errors.ts
260
169
  /**
261
170
  * Domain error types and constructors for brepjs.
@@ -528,12 +437,6 @@ Object.defineProperty(exports, "fromNullable", {
528
437
  return fromNullable;
529
438
  }
530
439
  });
531
- Object.defineProperty(exports, "getSuggestionForCode", {
532
- enumerable: true,
533
- get: function() {
534
- return getSuggestionForCode;
535
- }
536
- });
537
440
  Object.defineProperty(exports, "ioError", {
538
441
  enumerable: true,
539
442
  get: function() {
@@ -642,12 +545,6 @@ Object.defineProperty(exports, "tapErr", {
642
545
  return tapErr;
643
546
  }
644
547
  });
645
- Object.defineProperty(exports, "translateKernelError", {
646
- enumerable: true,
647
- get: function() {
648
- return translateKernelError;
649
- }
650
- });
651
548
  Object.defineProperty(exports, "tryCatch", {
652
549
  enumerable: true,
653
550
  get: function() {
@@ -1,6 +1,6 @@
1
- const require_shapeTypes = require("./shapeTypes-Bpsu5KJO.cjs");
2
- const require_errors = require("./errors-CJU8CHng.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-C3fhJndG.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CkcIL7zv.cjs");
2
+ const require_errors = require("./errors-RHkKO5bZ.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-Bia7o8l_.cjs");
4
4
  const require_types = require("./types-KjA8tY4Y.cjs");
5
5
  //#region src/topology/cast.ts
6
6
  var TOPO_ENUM = {
@@ -1,6 +1,6 @@
1
- import { i as castShape, it as getKernel } from "./shapeTypes-CnKFSfDT.js";
2
- import { I as unwrap, O as ok, l as typeCastError, v as err } from "./errors-B3CDG537.js";
3
- import { a as getCachedSurfaceType } from "./topologyQueryFns-DNqT88yx.js";
1
+ import { K as getKernel, i as castShape } from "./shapeTypes-t49f64Dx.js";
2
+ import { E as ok, P as unwrap, g as err, l as typeCastError } from "./errors-MHLiNE-C.js";
3
+ import { a as getCachedSurfaceType } from "./topologyQueryFns-BkQ6Q7gN.js";
4
4
  import { r as toVec3 } from "./types-D24Y27N0.js";
5
5
  //#region src/topology/cast.ts
6
6
  var TOPO_ENUM = {
@@ -1,11 +1,10 @@
1
- import { C as isSolid, R as getShapeKind, T as isWire, h as disposeResultShape, i as castShape, it as getKernel, m as disposeDowncastSource, n as castResultShape, x as isShape3D, y as isFace } from "./shapeTypes-CnKFSfDT.js";
2
- import { C as isOk, O as ok, S as isErr, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, v as err } from "./errors-B3CDG537.js";
3
- import { c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-DNqT88yx.js";
1
+ import { C as isSolid, E as getShapeKind, K as getKernel, T as isWire, h as disposeResultShape, i as castShape, m as disposeDowncastSource, n as castResultShape, x as isShape3D, y as isFace } from "./shapeTypes-t49f64Dx.js";
2
+ import { E as ok, b as isErr, d as validationError, g as err, i as kernelError, l as typeCastError, t as BrepErrorCode, x as isOk } from "./errors-MHLiNE-C.js";
3
+ import { c as getFaces, i as getCachedIsValid, m as invalidateShapeCache, p as getWires, s as getEdges } from "./topologyQueryFns-BkQ6Q7gN.js";
4
4
  import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
5
- import { y as downcast } from "./faceFns-CB6uzvOg.js";
6
- import { _ as collectInputFaceHashes, y as propagateAllMetadata } from "./shapeFns-BrHFNLMA.js";
5
+ import { y as downcast } from "./faceFns-DJj9Nb6T.js";
6
+ import { C as propagateAllMetadata, f as cut, h as fuseAll, m as fuse, p as cutAll, x as collectInputFaceHashes } from "./solidBuilders-DTgqQC3W.js";
7
7
  import { t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
8
- import { f as cut, h as fuseAll, m as fuse, p as cutAll } from "./solidBuilders-I8_V8qqU.js";
9
8
  //#region src/topology/threeHelpers.ts
10
9
  /**
11
10
  * Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
@@ -1,11 +1,10 @@
1
- const require_shapeTypes = require("./shapeTypes-Bpsu5KJO.cjs");
2
- const require_errors = require("./errors-CJU8CHng.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-C3fhJndG.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CkcIL7zv.cjs");
2
+ const require_errors = require("./errors-RHkKO5bZ.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-Bia7o8l_.cjs");
4
4
  const require_constants = require("./constants-BOVyEYGH.cjs");
5
- const require_faceFns = require("./faceFns-CPswi9Cm.cjs");
6
- const require_shapeFns = require("./shapeFns-qm9VRo4i.cjs");
5
+ const require_faceFns = require("./faceFns-BK4r7Dxk.cjs");
6
+ const require_solidBuilders = require("./solidBuilders-IiIzjKAr.cjs");
7
7
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
8
- const require_solidBuilders = require("./solidBuilders-Bp7lQW62.cjs");
9
8
  //#region src/topology/threeHelpers.ts
10
9
  /**
11
10
  * Convert a ShapeMesh into BufferGeometry-compatible typed arrays.
@@ -376,7 +375,7 @@ function fuseWithEvolution(a, b, { optimisation = "none", simplify = false, sign
376
375
  if (require_errors.isErr(checkA)) return checkA;
377
376
  const checkB = validateShape3D(b, "fuseWithEvolution: second operand");
378
377
  if (require_errors.isErr(checkB)) return checkB;
379
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([a, b]);
378
+ const inputFaceHashes = require_solidBuilders.collectInputFaceHashes([a, b]);
380
379
  const { shape: resultShape, evolution } = require_shapeTypes.getKernel().fuseWithHistory(a.wrapped, b.wrapped, inputFaceHashes, require_constants.HASH_CODE_MAX, {
381
380
  optimisation,
382
381
  simplify,
@@ -384,7 +383,7 @@ function fuseWithEvolution(a, b, { optimisation = "none", simplify = false, sign
384
383
  });
385
384
  const fuseResult = castToShape3D(resultShape, "FUSE_NOT_3D", "Fuse did not produce a 3D shape", "Common causes: overlapping coplanar faces, zero-thickness geometry, or non-manifold input. Try autoHeal() on inputs first.");
386
385
  if (fuseResult.ok) {
387
- require_shapeFns.propagateAllMetadata(evolution, [a, b], fuseResult.value);
386
+ require_solidBuilders.propagateAllMetadata(evolution, [a, b], fuseResult.value);
388
387
  return require_errors.ok({
389
388
  shape: fuseResult.value,
390
389
  evolution
@@ -398,7 +397,7 @@ function cutWithEvolution(base, tool, { optimisation = "none", simplify = false,
398
397
  if (require_errors.isErr(checkBase)) return checkBase;
399
398
  const checkTool = validateShape3D(tool, "cutWithEvolution: tool");
400
399
  if (require_errors.isErr(checkTool)) return checkTool;
401
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([base, tool]);
400
+ const inputFaceHashes = require_solidBuilders.collectInputFaceHashes([base, tool]);
402
401
  const { shape: resultShape, evolution } = require_shapeTypes.getKernel().cutWithHistory(base.wrapped, tool.wrapped, inputFaceHashes, require_constants.HASH_CODE_MAX, {
403
402
  optimisation,
404
403
  simplify,
@@ -406,7 +405,7 @@ function cutWithEvolution(base, tool, { optimisation = "none", simplify = false,
406
405
  });
407
406
  const cutResult = castToShape3D(resultShape, "CUT_NOT_3D", "Cut did not produce a 3D shape", "Common causes: tool does not fully intersect the base, or produces a zero-thickness sliver. Ensure the tool extends through the shape.");
408
407
  if (cutResult.ok) {
409
- require_shapeFns.propagateAllMetadata(evolution, [base, tool], cutResult.value);
408
+ require_solidBuilders.propagateAllMetadata(evolution, [base, tool], cutResult.value);
410
409
  return require_errors.ok({
411
410
  shape: cutResult.value,
412
411
  evolution
@@ -420,14 +419,14 @@ function intersectWithEvolution(a, b, { simplify = false, signal, fuzzyValue } =
420
419
  if (require_errors.isErr(checkA)) return checkA;
421
420
  const checkB = validateShape3D(b, "intersectWithEvolution: second operand");
422
421
  if (require_errors.isErr(checkB)) return checkB;
423
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([a, b]);
422
+ const inputFaceHashes = require_solidBuilders.collectInputFaceHashes([a, b]);
424
423
  const { shape: resultShape, evolution } = require_shapeTypes.getKernel().intersectWithHistory(a.wrapped, b.wrapped, inputFaceHashes, require_constants.HASH_CODE_MAX, {
425
424
  simplify,
426
425
  fuzzyValue
427
426
  });
428
427
  const intResult = castToShape3D(resultShape, "INTERSECT_NOT_3D", "Intersect did not produce a 3D shape", "Shapes may not overlap. Verify they share a common volume before intersecting.");
429
428
  if (intResult.ok) {
430
- require_shapeFns.propagateAllMetadata(evolution, [a, b], intResult.value);
429
+ require_solidBuilders.propagateAllMetadata(evolution, [a, b], intResult.value);
431
430
  return require_errors.ok({
432
431
  shape: intResult.value,
433
432
  evolution
@@ -462,14 +461,14 @@ function filletWithEvolution(shape, edges, radius) {
462
461
  filteredEdges = [...selectedEdges];
463
462
  kernelRadius = radius;
464
463
  }
465
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([shape]);
464
+ const inputFaceHashes = require_solidBuilders.collectInputFaceHashes([shape]);
466
465
  const { shape: resultShape, evolution } = require_shapeTypes.getKernel().filletWithHistory(shape.wrapped, filteredEdges.map((e) => e.wrapped), kernelRadius, inputFaceHashes, require_constants.HASH_CODE_MAX);
467
466
  const cast = require_shapeTypes.castResultShape(resultShape);
468
467
  if (!require_shapeTypes.isShape3D(cast)) {
469
468
  require_shapeTypes.disposeResultShape(cast);
470
469
  return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.FILLET_NOT_3D, "Fillet result is not a 3D shape"));
471
470
  }
472
- require_shapeFns.propagateAllMetadata(evolution, [shape], cast);
471
+ require_solidBuilders.propagateAllMetadata(evolution, [shape], cast);
473
472
  return require_errors.ok({
474
473
  shape: cast,
475
474
  evolution
@@ -509,14 +508,14 @@ function chamferWithEvolution(shape, edges, distance) {
509
508
  filteredEdges = [...selectedEdges];
510
509
  kernelDistance = distance;
511
510
  }
512
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([shape]);
511
+ const inputFaceHashes = require_solidBuilders.collectInputFaceHashes([shape]);
513
512
  const { shape: resultShape, evolution } = require_shapeTypes.getKernel().chamferWithHistory(shape.wrapped, filteredEdges.map((e) => e.wrapped), kernelDistance, inputFaceHashes, require_constants.HASH_CODE_MAX);
514
513
  const cast = require_shapeTypes.castResultShape(resultShape);
515
514
  if (!require_shapeTypes.isShape3D(cast)) {
516
515
  require_shapeTypes.disposeResultShape(cast);
517
516
  return require_errors.err(require_errors.kernelError(require_errors.BrepErrorCode.CHAMFER_NOT_3D, "Chamfer result is not a 3D shape"));
518
517
  }
519
- require_shapeFns.propagateAllMetadata(evolution, [shape], cast);
518
+ require_solidBuilders.propagateAllMetadata(evolution, [shape], cast);
520
519
  return require_errors.ok({
521
520
  shape: cast,
522
521
  evolution
@@ -544,14 +543,14 @@ function shellWithEvolution(shape, faces, thickness, tolerance = .001) {
544
543
  if (thickness <= 0) return require_errors.err(require_errors.validationError("INVALID_THICKNESS", "Shell thickness must be positive"));
545
544
  if (faces.length === 0) return require_errors.err(require_errors.validationError("NO_FACES", "At least one face must be specified for shell"));
546
545
  try {
547
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([shape]);
546
+ const inputFaceHashes = require_solidBuilders.collectInputFaceHashes([shape]);
548
547
  const { shape: resultShape, evolution } = require_shapeTypes.getKernel().shellWithHistory(shape.wrapped, faces.map((f) => f.wrapped), thickness, inputFaceHashes, require_constants.HASH_CODE_MAX, tolerance);
549
548
  const cast = require_shapeTypes.castResultShape(resultShape);
550
549
  if (!require_shapeTypes.isShape3D(cast)) {
551
550
  require_shapeTypes.disposeResultShape(cast);
552
551
  return require_errors.err(require_errors.kernelError("SHELL_RESULT_NOT_3D", "Shell result is not a 3D shape"));
553
552
  }
554
- require_shapeFns.propagateAllMetadata(evolution, [shape], cast);
553
+ require_solidBuilders.propagateAllMetadata(evolution, [shape], cast);
555
554
  return require_errors.ok({
556
555
  shape: cast,
557
556
  evolution
@@ -650,7 +649,7 @@ function finalizeShape3D(evolution, resultShape, inputs, not3dCode, not3dMessage
650
649
  require_shapeTypes.disposeResultShape(cast);
651
650
  return require_errors.err(require_errors.kernelError(not3dCode, not3dMessage));
652
651
  }
653
- require_shapeFns.propagateAllMetadata(evolution, inputs, cast);
652
+ require_solidBuilders.propagateAllMetadata(evolution, inputs, cast);
654
653
  return require_errors.ok(cast);
655
654
  }
656
655
  /**
@@ -691,10 +690,10 @@ function thicken(shape, thickness) {
691
690
  const check = validateNotNull(shape, "thicken: shape");
692
691
  if (require_errors.isErr(check)) return check;
693
692
  try {
694
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([shape]);
693
+ const inputFaceHashes = require_solidBuilders.collectInputFaceHashes([shape]);
695
694
  const { shape: resultShape, evolution } = require_shapeTypes.getKernel().thickenWithHistory(shape.wrapped, thickness, inputFaceHashes, require_constants.HASH_CODE_MAX);
696
695
  const cast = require_shapeTypes.castResultShape(resultShape);
697
- require_shapeFns.propagateAllMetadata(evolution, [shape], cast);
696
+ require_solidBuilders.propagateAllMetadata(evolution, [shape], cast);
698
697
  return require_errors.ok(cast);
699
698
  } catch (e) {
700
699
  return require_errors.err(require_errors.kernelError("THICKEN_FAILED", `Thicken operation failed: ${e instanceof Error ? e.message : String(e)}`, e));
@@ -753,7 +752,7 @@ function fillet(shape, edges, radius, { trackEvolution = true } = {}) {
753
752
  }
754
753
  return require_errors.ok(cast);
755
754
  }
756
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([shape]);
755
+ const inputFaceHashes = require_solidBuilders.collectInputFaceHashes([shape]);
757
756
  const { shape: resultShape, evolution } = require_shapeTypes.getKernel().filletWithHistory(shape.wrapped, edgeShapes, kernelRadius, inputFaceHashes, require_constants.HASH_CODE_MAX);
758
757
  return finalizeShape3D(evolution, resultShape, [shape], require_errors.BrepErrorCode.FILLET_NOT_3D, "Fillet result is not a 3D shape");
759
758
  } catch (e) {
@@ -796,7 +795,7 @@ function chamfer(shape, edges, distance) {
796
795
  filteredEdges = [...selectedEdges];
797
796
  kernelDistance = distance;
798
797
  }
799
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([shape]);
798
+ const inputFaceHashes = require_solidBuilders.collectInputFaceHashes([shape]);
800
799
  const { shape: resultShape, evolution } = require_shapeTypes.getKernel().chamferWithHistory(shape.wrapped, filteredEdges.map((e) => e.wrapped), kernelDistance, inputFaceHashes, require_constants.HASH_CODE_MAX);
801
800
  return finalizeShape3D(evolution, resultShape, [shape], require_errors.BrepErrorCode.CHAMFER_NOT_3D, "Chamfer result is not a 3D shape");
802
801
  } catch (e) {
@@ -829,14 +828,14 @@ function shell(shape, faces, thickness, tolerance = .001, { trackEvolution = tru
829
828
  }
830
829
  return require_errors.ok(cast);
831
830
  }
832
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([shape]);
831
+ const inputFaceHashes = require_solidBuilders.collectInputFaceHashes([shape]);
833
832
  const { shape: resultShape, evolution } = require_shapeTypes.getKernel().shellWithHistory(shape.wrapped, faces.map((f) => f.wrapped), thickness, inputFaceHashes, require_constants.HASH_CODE_MAX, tolerance);
834
833
  const cast = require_shapeTypes.castResultShape(resultShape);
835
834
  if (!require_shapeTypes.isShape3D(cast)) {
836
835
  require_shapeTypes.disposeResultShape(cast);
837
836
  return require_errors.err(require_errors.kernelError("SHELL_RESULT_NOT_3D", "Shell result is not a 3D shape"));
838
837
  }
839
- require_shapeFns.propagateAllMetadata(evolution, [shape], cast);
838
+ require_solidBuilders.propagateAllMetadata(evolution, [shape], cast);
840
839
  return require_errors.ok(cast);
841
840
  } catch (e) {
842
841
  return require_errors.err(require_errors.kernelError("SHELL_FAILED", `Shell operation failed: ${e instanceof Error ? e.message : String(e)}`, e, {
@@ -858,14 +857,14 @@ function offset(shape, distance, tolerance = 1e-6) {
858
857
  if (require_errors.isErr(check)) return check;
859
858
  if (Math.abs(distance) < 1e-10) return require_errors.err(require_errors.validationError("ZERO_OFFSET", "Offset distance cannot be zero"));
860
859
  try {
861
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([shape]);
860
+ const inputFaceHashes = require_solidBuilders.collectInputFaceHashes([shape]);
862
861
  const { shape: resultShape, evolution } = require_shapeTypes.getKernel().offsetWithHistory(shape.wrapped, distance, inputFaceHashes, require_constants.HASH_CODE_MAX, tolerance);
863
862
  const cast = require_shapeTypes.castResultShape(resultShape);
864
863
  if (!require_shapeTypes.isShape3D(cast)) {
865
864
  require_shapeTypes.disposeResultShape(cast);
866
865
  return require_errors.err(require_errors.kernelError("OFFSET_RESULT_NOT_3D", "Offset result is not a 3D shape"));
867
866
  }
868
- require_shapeFns.propagateAllMetadata(evolution, [shape], cast);
867
+ require_solidBuilders.propagateAllMetadata(evolution, [shape], cast);
869
868
  return require_errors.ok(cast);
870
869
  } catch (e) {
871
870
  return require_errors.err(require_errors.kernelError("OFFSET_FAILED", `Offset operation failed: ${e instanceof Error ? e.message : String(e)}`, e));
@@ -903,7 +902,7 @@ function draft(shape, faces, pullDirection, neutralPlane, angle) {
903
902
  try {
904
903
  const { filteredFaces, kernelAngle } = resolveDraftCallback(faces, angle);
905
904
  if (filteredFaces.length === 0) return require_errors.err(require_errors.validationError(require_errors.BrepErrorCode.DRAFT_NO_FACES, "No faces with valid draft angle", void 0, void 0, "Check that the angle callback returns non-zero values between -90 and 90 degrees"));
906
- const inputFaceHashes = require_shapeFns.collectInputFaceHashes([shape]);
905
+ const inputFaceHashes = require_solidBuilders.collectInputFaceHashes([shape]);
907
906
  const { shape: resultShape, evolution } = require_shapeTypes.getKernel().draftWithHistory(shape.wrapped, filteredFaces.map((f) => f.wrapped), [
908
907
  pullDirection[0],
909
908
  pullDirection[1],
@@ -1,13 +1,12 @@
1
- const require_shapeTypes = require("./shapeTypes-Bpsu5KJO.cjs");
2
- const require_bug = require("./bug-O02CsAmt.cjs");
3
- const require_errors = require("./errors-CJU8CHng.cjs");
4
- const require_topologyQueryFns = require("./topologyQueryFns-C3fhJndG.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CkcIL7zv.cjs");
2
+ const require_errors = require("./errors-RHkKO5bZ.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-Bia7o8l_.cjs");
5
4
  const require_constants = require("./constants-BOVyEYGH.cjs");
6
5
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
7
- const require_faceFns = require("./faceFns-CPswi9Cm.cjs");
8
- const require_shapeFns = require("./shapeFns-qm9VRo4i.cjs");
9
- const require_curveFns = require("./curveFns-D7utcbnf.cjs");
10
- const require_measureFns = require("./measureFns-B5Zzg1qM.cjs");
6
+ const require_faceFns = require("./faceFns-BK4r7Dxk.cjs");
7
+ const require_shapeFns = require("./shapeFns-D_5TgiUi.cjs");
8
+ const require_curveFns = require("./curveFns-GmFnqNo3.cjs");
9
+ const require_measureFns = require("./measureFns-CJGrmhHT.cjs");
11
10
  //#region src/utils/vec2d.ts
12
11
  /** Precision for curve intersection and parameter operations. */
13
12
  var PRECISION_INTERSECTION = 1e-9;
@@ -74,7 +73,7 @@ var rotate2d = (point, angle, center = [0, 0]) => {
74
73
  * Normalize a 2D vector to unit length.
75
74
  * Returns `[0, 0]` for zero-length vectors (within epsilon).
76
75
  */
77
- function normalize2d$1([x, y]) {
76
+ function normalize2d([x, y]) {
78
77
  const l = Math.sqrt(x * x + y * y);
79
78
  return l < 1e-12 ? [0, 0] : [x / l, y / l];
80
79
  }
@@ -91,21 +90,6 @@ var cartesianToPolar = ([x, y]) => {
91
90
  return [Math.sqrt(x * x + y * y), Math.atan2(y, x)];
92
91
  };
93
92
  //#endregion
94
- //#region src/2d/lib/vectorOperations.ts
95
- /**
96
- * Normalize a 2D vector to unit length.
97
- *
98
- * Unlike the Layer 0 version (which returns [0,0] for zero-length vectors),
99
- * this throws a BrepBugError — Layer 2 code should never pass zero-length vectors.
100
- *
101
- * @throws When the vector has near-zero length.
102
- */
103
- var normalize2d = ([x, y]) => {
104
- const result = normalize2d$1([x, y]);
105
- if (result[0] === 0 && result[1] === 0) require_bug.bug("normalize2d", "Cannot normalize zero-length vector");
106
- return result;
107
- };
108
- //#endregion
109
93
  //#region src/query/finderCore.ts
110
94
  /**
111
95
  * Find exactly one element matching all predicates. Returns an error Result
@@ -1,13 +1,12 @@
1
- import { it as getKernel, y as isFace } from "./shapeTypes-CnKFSfDT.js";
2
- import { n as bug } from "./bug-BdOHwn_e.js";
3
- import { C as isOk, O as ok, o as queryError, v as err } from "./errors-B3CDG537.js";
4
- import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-DNqT88yx.js";
1
+ import { K as getKernel, y as isFace } from "./shapeTypes-t49f64Dx.js";
2
+ import { E as ok, g as err, o as queryError, x as isOk } from "./errors-MHLiNE-C.js";
3
+ import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-BkQ6Q7gN.js";
5
4
  import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
6
5
  import { a as vecDot, d as vecNormalize } from "./vecOps-SKPRvPH-.js";
7
- import { l as normalAt, s as getSurfaceType } from "./faceFns-CB6uzvOg.js";
8
- import { a as isSameShape, n as getHashCode } from "./shapeFns-BrHFNLMA.js";
9
- import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-RENXKp64.js";
10
- import { n as measureArea } from "./measureFns-CC7HhAH3.js";
6
+ import { l as normalAt, s as getSurfaceType } from "./faceFns-DJj9Nb6T.js";
7
+ import { a as isSameShape, n as getHashCode } from "./shapeFns-BTFx-os7.js";
8
+ import { f as getCurveType, i as curveIsClosed, o as curveLength } from "./curveFns-DX13KRh2.js";
9
+ import { n as measureArea } from "./measureFns-CMnbcUZC.js";
11
10
  //#region src/utils/vec2d.ts
12
11
  /** Precision for curve intersection and parameter operations. */
13
12
  var PRECISION_INTERSECTION = 1e-9;
@@ -74,7 +73,7 @@ var rotate2d = (point, angle, center = [0, 0]) => {
74
73
  * Normalize a 2D vector to unit length.
75
74
  * Returns `[0, 0]` for zero-length vectors (within epsilon).
76
75
  */
77
- function normalize2d$1([x, y]) {
76
+ function normalize2d([x, y]) {
78
77
  const l = Math.sqrt(x * x + y * y);
79
78
  return l < 1e-12 ? [0, 0] : [x / l, y / l];
80
79
  }
@@ -91,21 +90,6 @@ var cartesianToPolar = ([x, y]) => {
91
90
  return [Math.sqrt(x * x + y * y), Math.atan2(y, x)];
92
91
  };
93
92
  //#endregion
94
- //#region src/2d/lib/vectorOperations.ts
95
- /**
96
- * Normalize a 2D vector to unit length.
97
- *
98
- * Unlike the Layer 0 version (which returns [0,0] for zero-length vectors),
99
- * this throws a BrepBugError — Layer 2 code should never pass zero-length vectors.
100
- *
101
- * @throws When the vector has near-zero length.
102
- */
103
- var normalize2d = ([x, y]) => {
104
- const result = normalize2d$1([x, y]);
105
- if (result[0] === 0 && result[1] === 0) bug("normalize2d", "Cannot normalize zero-length vector");
106
- return result;
107
- };
108
- //#endregion
109
93
  //#region src/query/finderCore.ts
110
94
  /**
111
95
  * Find exactly one element matching all predicates. Returns an error Result
@@ -324,4 +308,4 @@ function getSingleFace(f, shape) {
324
308
  return f(faceFinder()).findUnique(shape);
325
309
  }
326
310
  //#endregion
327
- export { samePoint as _, createTypedFinder as a, subtract2d as b, PRECISION_OFFSET as c, cartesianToPolar as d, crossProduct2d as f, rotate2d as g, polarToCartesian as h, wireFinder as i, add2d as l, polarAngle2d as m, edgeFinder as n, normalize2d as o, distance2d as p, faceFinder as r, PRECISION_INTERSECTION as s, getSingleFace as t, angle2d as u, scalarMultiply2d as v, squareDistance2d as y };
311
+ export { samePoint as _, createTypedFinder as a, subtract2d as b, add2d as c, crossProduct2d as d, distance2d as f, rotate2d as g, polarToCartesian as h, wireFinder as i, angle2d as l, polarAngle2d as m, edgeFinder as n, PRECISION_INTERSECTION as o, normalize2d as p, faceFinder as r, PRECISION_OFFSET as s, getSingleFace as t, cartesianToPolar as u, scalarMultiply2d as v, squareDistance2d as y };
@@ -1,8 +1,8 @@
1
- import { it as getKernel, n as castResultShape } from "./shapeTypes-CnKFSfDT.js";
1
+ import { K as getKernel, n as castResultShape } from "./shapeTypes-t49f64Dx.js";
2
2
  import { i as wasmIndex, r as vec3At$1 } from "./bug-BdOHwn_e.js";
3
- import { O as ok, r as ioError, t as BrepErrorCode, v as err } from "./errors-B3CDG537.js";
3
+ import { E as ok, g as err, r as ioError, t as BrepErrorCode } from "./errors-MHLiNE-C.js";
4
4
  import { n as getAtOrThrow } from "./arrayAccess-DrUGPADn.js";
5
- import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-DJJo8WkI.js";
5
+ import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-DEMSX-hc.js";
6
6
  //#region src/io/objExportFns.ts
7
7
  /** Read a vec3 from a typed array at the given vertex index. */
8
8
  function vec3At(arr, i) {
@@ -1,8 +1,8 @@
1
- const require_shapeTypes = require("./shapeTypes-Bpsu5KJO.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-CkcIL7zv.cjs");
2
2
  const require_bug = require("./bug-O02CsAmt.cjs");
3
- const require_errors = require("./errors-CJU8CHng.cjs");
3
+ const require_errors = require("./errors-RHkKO5bZ.cjs");
4
4
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
5
- const require_blueprint = require("./blueprint-DTNT4qYJ.cjs");
5
+ const require_blueprint = require("./blueprint-DUnNPwQL.cjs");
6
6
  //#region src/io/objExportFns.ts
7
7
  /** Read a vec3 from a typed array at the given vertex index. */
8
8
  function vec3At(arr, i) {
package/dist/io.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_meshFns = require("./meshFns-CaXmWmhe.cjs");
3
- const require_importFns = require("./importFns-DS4J1xLv.cjs");
2
+ const require_meshFns = require("./meshFns-Dqf5QBhQ.cjs");
3
+ const require_importFns = require("./importFns-pr-r5qiV.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-D57Fyqyf.js";
2
- import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-X8vBhZI2.js";
1
+ import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-Cs5EBsf7.js";
2
+ import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-DqxAZFb-.js";
3
3
  export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };