brepjs 12.7.3 → 12.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/2d/blueprints/boolean2D.d.ts.map +1 -1
  2. package/dist/2d/blueprints/lib.d.ts.map +1 -1
  3. package/dist/2d/blueprints/offset.d.ts.map +1 -1
  4. package/dist/2d.cjs +2 -2
  5. package/dist/2d.js +3 -3
  6. package/dist/{Blueprint-CnDVffSX.cjs → Blueprint-CQ28WJhz.cjs} +29 -30
  7. package/dist/{Blueprint-C3lWY1Jf.js → Blueprint-DbVaf6k7.js} +7 -8
  8. package/dist/{boolean2D-DyQJt8Na.cjs → boolean2D-0blbVtJ8.cjs} +70 -61
  9. package/dist/{boolean2D-CwZAIJDS.js → boolean2D-y3E92F0u.js} +37 -28
  10. package/dist/{booleanFns-CcNUsgI8.js → booleanFns-BCTjYZAg.js} +4 -4
  11. package/dist/{booleanFns-D7HmkpYt.cjs → booleanFns-gmsX3Cv2.cjs} +59 -59
  12. package/dist/brepjs.cjs +319 -372
  13. package/dist/brepjs.js +358 -411
  14. package/dist/core/errors.d.ts +14 -5
  15. package/dist/core/errors.d.ts.map +1 -1
  16. package/dist/core.cjs +30 -31
  17. package/dist/core.js +19 -20
  18. package/dist/{cornerFinder-BV-l1BCw.js → cornerFinder-Ckz-mPHE.js} +1 -1
  19. package/dist/{cornerFinder-3zfbQvXg.cjs → cornerFinder-ZmOyOOsh.cjs} +1 -1
  20. package/dist/{curveFns-Ch87sD5O.cjs → curveFns-BZngcnQ1.cjs} +17 -17
  21. package/dist/{curveFns-CloOqAQ_.js → curveFns-mROFhiuG.js} +1 -1
  22. package/dist/{drawFns-5myJTgtX.js → drawFns-Bwakrq7w.js} +24 -25
  23. package/dist/{drawFns-CDNafQhv.cjs → drawFns-CjRc1NfQ.cjs} +51 -52
  24. package/dist/{faceFns-B6ebRh5I.js → faceFns-B8GnxjdY.js} +1 -1
  25. package/dist/{faceFns-BLTEPBKq.cjs → faceFns-DB1Fc5gy.cjs} +20 -20
  26. package/dist/{helpers-6kn30cSD.cjs → helpers-C8NoT0Wu.cjs} +14 -14
  27. package/dist/{helpers-C9KvE1RW.js → helpers-X0juxnwj.js} +4 -4
  28. package/dist/io.cjs +26 -26
  29. package/dist/io.js +3 -3
  30. package/dist/kernel/brepkitAdapter.d.ts +8 -8
  31. package/dist/kernel/brepkitAdapter.d.ts.map +1 -1
  32. package/dist/kernel/brepkitWasmTypes.d.ts +6 -0
  33. package/dist/kernel/brepkitWasmTypes.d.ts.map +1 -1
  34. package/dist/kernel/historyOps.d.ts +3 -3
  35. package/dist/kernel/historyOps.d.ts.map +1 -1
  36. package/dist/kernel/types.d.ts +8 -8
  37. package/dist/kernel/types.d.ts.map +1 -1
  38. package/dist/{loft-BcZUCGKi.js → loft-Bhw-FMoL.js} +4 -4
  39. package/dist/{loft-DR1UN5uN.cjs → loft-hp3pc1M7.cjs} +43 -43
  40. package/dist/{measurement-DoYXRaKI.cjs → measurement-BoNTUBAp.cjs} +1 -1
  41. package/dist/{measurement-oWvhSVZG.js → measurement-D8EJ694A.js} +1 -1
  42. package/dist/measurement.cjs +1 -1
  43. package/dist/measurement.js +1 -1
  44. package/dist/{meshFns-3gy0empP.cjs → meshFns-BnV0ZR8w.cjs} +17 -17
  45. package/dist/{meshFns-DsLRd3tA.js → meshFns-nQjK38EC.js} +2 -2
  46. package/dist/{operations-Dcz6YlOt.js → operations-BfbkK6DU.js} +5 -5
  47. package/dist/{operations-DLFzmdFX.cjs → operations-CYpmLSC4.cjs} +75 -75
  48. package/dist/operations.cjs +2 -2
  49. package/dist/operations.js +2 -2
  50. package/dist/query.cjs +3 -3
  51. package/dist/query.js +4 -4
  52. package/dist/{errors-B7kgv0cd.js → result-BaSD1fqR.js} +43 -23
  53. package/dist/{errors-9fDehDNc.cjs → result-fAX0OZzI.cjs} +20 -0
  54. package/dist/result.cjs +30 -41
  55. package/dist/result.js +18 -29
  56. package/dist/{shapeFns-D-MOoqJd.cjs → shapeFns-C2SnNvdH.cjs} +39 -39
  57. package/dist/{shapeFns-D2PlLFE6.js → shapeFns-FDuKkrDR.js} +4 -4
  58. package/dist/sketching.cjs +2 -2
  59. package/dist/sketching.js +2 -2
  60. package/dist/{solidBuilders-BzfRBizW.cjs → solidBuilders-994_MQwB.cjs} +12 -12
  61. package/dist/{solidBuilders-BXhh5hP2.js → solidBuilders-DmwhTCCd.js} +2 -2
  62. package/dist/{surfaceBuilders-Be_ENWSA.cjs → surfaceBuilders-5VA34a3_.cjs} +27 -27
  63. package/dist/{surfaceBuilders-D6iDVPIM.js → surfaceBuilders-nQdJ56fe.js} +2 -2
  64. package/dist/{topology-CKtCGLmb.cjs → topology-ANwCzGL8.cjs} +54 -54
  65. package/dist/{topology-DxD58iQ6.js → topology-C7x98OVn.js} +8 -8
  66. package/dist/topology.cjs +6 -6
  67. package/dist/topology.js +6 -6
  68. package/dist/{vectors-CESkzEm6.js → vectors-Bx8wkNui.js} +1 -1
  69. package/dist/{vectors-BafmMf96.cjs → vectors-D_IiZx0q.cjs} +6 -6
  70. package/dist/vectors.cjs +1 -1
  71. package/dist/vectors.js +1 -1
  72. package/package.json +5 -8
@@ -34,8 +34,8 @@ var __callDispose = (stack, error, hasError) => {
34
34
  var next = (it) => {
35
35
  while (it = stack.pop()) {
36
36
  try {
37
- var result = it[1] && it[1].call(it[2]);
38
- if (it[0]) return Promise.resolve(result).then(next, (e) => (fail(e), next()));
37
+ var result2 = it[1] && it[1].call(it[2]);
38
+ if (it[0]) return Promise.resolve(result2).then(next, (e) => (fail(e), next()));
39
39
  } catch (e) {
40
40
  fail(e);
41
41
  }
@@ -47,18 +47,18 @@ var __callDispose = (stack, error, hasError) => {
47
47
  const shapeTypes = require("./shapeTypes-7xEam9Ri.cjs");
48
48
  const types = require("./types-CA_xrgDq.cjs");
49
49
  const vecOps = require("./vecOps-CjRL1jau.cjs");
50
- const faceFns = require("./faceFns-BLTEPBKq.cjs");
51
- const errors = require("./errors-9fDehDNc.cjs");
52
- const surfaceBuilders = require("./surfaceBuilders-Be_ENWSA.cjs");
53
- const solidBuilders = require("./solidBuilders-BzfRBizW.cjs");
50
+ const faceFns = require("./faceFns-DB1Fc5gy.cjs");
51
+ const result = require("./result-fAX0OZzI.cjs");
52
+ const surfaceBuilders = require("./surfaceBuilders-5VA34a3_.cjs");
53
+ const solidBuilders = require("./solidBuilders-994_MQwB.cjs");
54
54
  function buildLawFromProfile(extrusionLength, { profile, endFactor = 1 }) {
55
55
  if (profile !== "s-curve" && profile !== "linear") {
56
- return errors.err(
57
- errors.validationError("UNSUPPORTED_PROFILE", `Unsupported extrusion profile: ${String(profile)}`)
56
+ return result.err(
57
+ result.validationError("UNSUPPORTED_PROFILE", `Unsupported extrusion profile: ${String(profile)}`)
58
58
  );
59
59
  }
60
60
  const law = shapeTypes.getKernel().buildExtrusionLaw(profile, extrusionLength, endFactor);
61
- return errors.ok(law.Trim(0, extrusionLength, 1e-6));
61
+ return result.ok(law.Trim(0, extrusionLength, 1e-6));
62
62
  }
63
63
  const basicFaceExtrusion = (face, extrusionVec) => {
64
64
  const kernel = shapeTypes.getKernel();
@@ -66,7 +66,7 @@ const basicFaceExtrusion = (face, extrusionVec) => {
66
66
  const len = vecOps.vecLength(vec);
67
67
  const dir = len > 0 ? [vec[0] / len, vec[1] / len, vec[2] / len] : [0, 0, 1];
68
68
  const shape = kernel.extrude(face.wrapped, dir, len);
69
- const solid = shapeTypes.createSolid(errors.unwrap(faceFns.downcast(shape)));
69
+ const solid = shapeTypes.createSolid(result.unwrap(faceFns.downcast(shape)));
70
70
  return solid;
71
71
  };
72
72
  const revolution = (face, center = [0, 0, 0], direction = [0, 0, 1], angle = 360) => {
@@ -79,12 +79,12 @@ const revolution = (face, center = [0, 0, 0], direction = [0, 0, 1], angle = 360
79
79
  [...directionVec],
80
80
  angle * vecOps.DEG2RAD
81
81
  );
82
- const result = errors.andThen(faceFns.cast(revolShape), (shape) => {
82
+ const result$1 = result.andThen(faceFns.cast(revolShape), (shape) => {
83
83
  if (!faceFns.isShape3D(shape))
84
- return errors.err(errors.typeCastError("REVOLUTION_NOT_3D", "Revolution did not produce a 3D shape"));
85
- return errors.ok(shape);
84
+ return result.err(result.typeCastError("REVOLUTION_NOT_3D", "Revolution did not produce a 3D shape"));
85
+ return result.ok(shape);
86
86
  });
87
- return result;
87
+ return result$1;
88
88
  };
89
89
  function genericSweep(wire, spine, {
90
90
  frenet = false,
@@ -104,16 +104,16 @@ function genericSweep(wire, spine, {
104
104
  if (sweepMode === "simple" && !shellMode) {
105
105
  const kernel2 = shapeTypes.getKernel();
106
106
  const resultOc = kernel2.simplePipe(wire.wrapped, spine.wrapped);
107
- const result2 = errors.andThen(faceFns.cast(resultOc), (shape2) => {
107
+ const result2 = result.andThen(faceFns.cast(resultOc), (shape2) => {
108
108
  if (!faceFns.isShape3D(shape2))
109
- return errors.err(errors.typeCastError("SWEEP_NOT_3D", "Simple pipe did not produce a 3D shape"));
110
- return errors.ok(shape2);
109
+ return result.err(result.typeCastError("SWEEP_NOT_3D", "Simple pipe did not produce a 3D shape"));
110
+ return result.ok(shape2);
111
111
  });
112
112
  return result2;
113
113
  }
114
114
  const kernel = shapeTypes.getKernel();
115
115
  const withCorrection = transitionMode === "round" ? true : !!forceProfileSpineOthogonality;
116
- const result = kernel.sweepPipeShell(wire.wrapped, spine.wrapped, {
116
+ const result$1 = kernel.sweepPipeShell(wire.wrapped, spine.wrapped, {
117
117
  transitionMode,
118
118
  contact: !!withContact,
119
119
  correction: withCorrection,
@@ -128,26 +128,26 @@ function genericSweep(wire, spine, {
128
128
  maxDegree,
129
129
  maxSegments
130
130
  });
131
- if (shellMode && typeof result === "object" && "firstShape" in result) {
132
- const shape2 = errors.unwrap(faceFns.cast(result.shape));
131
+ if (shellMode && typeof result$1 === "object" && "firstShape" in result$1) {
132
+ const shape2 = result.unwrap(faceFns.cast(result$1.shape));
133
133
  if (!faceFns.isShape3D(shape2)) {
134
- return errors.err(errors.typeCastError("SWEEP_NOT_3D", "Sweep did not produce a 3D shape"));
134
+ return result.err(result.typeCastError("SWEEP_NOT_3D", "Sweep did not produce a 3D shape"));
135
135
  }
136
- const startWire = errors.unwrap(faceFns.cast(result.firstShape));
137
- const endWire = errors.unwrap(faceFns.cast(result.lastShape));
136
+ const startWire = result.unwrap(faceFns.cast(result$1.firstShape));
137
+ const endWire = result.unwrap(faceFns.cast(result$1.lastShape));
138
138
  if (!faceFns.isWire(startWire)) {
139
- return errors.err(errors.typeCastError("SWEEP_START_NOT_WIRE", "Sweep did not produce a start Wire"));
139
+ return result.err(result.typeCastError("SWEEP_START_NOT_WIRE", "Sweep did not produce a start Wire"));
140
140
  }
141
141
  if (!faceFns.isWire(endWire)) {
142
- return errors.err(errors.typeCastError("SWEEP_END_NOT_WIRE", "Sweep did not produce an end Wire"));
142
+ return result.err(result.typeCastError("SWEEP_END_NOT_WIRE", "Sweep did not produce an end Wire"));
143
143
  }
144
- return errors.ok([shape2, startWire, endWire]);
144
+ return result.ok([shape2, startWire, endWire]);
145
145
  }
146
- const shape = errors.unwrap(faceFns.cast(result));
146
+ const shape = result.unwrap(faceFns.cast(result$1));
147
147
  if (!faceFns.isShape3D(shape)) {
148
- return errors.err(errors.typeCastError("SWEEP_NOT_3D", "Sweep did not produce a 3D shape"));
148
+ return result.err(result.typeCastError("SWEEP_NOT_3D", "Sweep did not produce a 3D shape"));
149
149
  }
150
- return errors.ok(shape);
150
+ return result.ok(shape);
151
151
  }
152
152
  function complexExtrude(wire, center, normal, profileShape, shellMode = false) {
153
153
  var _stack = [];
@@ -157,10 +157,10 @@ function complexExtrude(wire, center, normal, profileShape, shellMode = false) {
157
157
  const normalVec = types.toVec3(normal);
158
158
  const endVec = vecOps.vecAdd(centerVec, normalVec);
159
159
  const mainSpineEdge = scope.register(surfaceBuilders.makeLine(centerVec, endVec));
160
- const spine = scope.register(errors.unwrap(surfaceBuilders.assembleWire([mainSpineEdge])));
161
- const law = profileShape ? scope.register(errors.unwrap(buildLawFromProfile(vecOps.vecLength(normalVec), profileShape))) : null;
162
- const result = shellMode ? genericSweep(wire, spine, { law }, shellMode) : genericSweep(wire, spine, { law });
163
- return result;
160
+ const spine = scope.register(result.unwrap(surfaceBuilders.assembleWire([mainSpineEdge])));
161
+ const law = profileShape ? scope.register(result.unwrap(buildLawFromProfile(vecOps.vecLength(normalVec), profileShape))) : null;
162
+ const result$1 = shellMode ? genericSweep(wire, spine, { law }, shellMode) : genericSweep(wire, spine, { law });
163
+ return result$1;
164
164
  } catch (_) {
165
165
  var _error = _, _hasError = true;
166
166
  } finally {
@@ -175,16 +175,16 @@ function twistExtrude(wire, angleDegrees, center, normal, profileShape, shellMod
175
175
  const normalVec = types.toVec3(normal);
176
176
  const endVec = vecOps.vecAdd(centerVec, normalVec);
177
177
  const mainSpineEdge = scope.register(surfaceBuilders.makeLine(centerVec, endVec));
178
- const spine = scope.register(errors.unwrap(surfaceBuilders.assembleWire([mainSpineEdge])));
178
+ const spine = scope.register(result.unwrap(surfaceBuilders.assembleWire([mainSpineEdge])));
179
179
  const extrusionLength = vecOps.vecLength(normalVec);
180
180
  const pitch = 360 / angleDegrees * extrusionLength;
181
181
  const radius = 1;
182
182
  const auxiliarySpine = scope.register(
183
183
  surfaceBuilders.makeHelix(pitch, extrusionLength, radius, centerVec, normalVec)
184
184
  );
185
- const law = profileShape ? scope.register(errors.unwrap(buildLawFromProfile(extrusionLength, profileShape))) : null;
186
- const result = shellMode ? genericSweep(wire, spine, { auxiliarySpine, law }, shellMode) : genericSweep(wire, spine, { auxiliarySpine, law });
187
- return result;
185
+ const law = profileShape ? scope.register(result.unwrap(buildLawFromProfile(extrusionLength, profileShape))) : null;
186
+ const result$1 = shellMode ? genericSweep(wire, spine, { auxiliarySpine, law }, shellMode) : genericSweep(wire, spine, { auxiliarySpine, law });
187
+ return result$1;
188
188
  } catch (_) {
189
189
  var _error = _, _hasError = true;
190
190
  } finally {
@@ -193,7 +193,7 @@ function twistExtrude(wire, angleDegrees, center, normal, profileShape, shellMod
193
193
  }
194
194
  const loft = (wires, { ruled = true, startPoint, endPoint } = {}, returnShell = false) => {
195
195
  if (wires.length === 0 && !startPoint && !endPoint) {
196
- return errors.err(errors.validationError("LOFT_EMPTY", "Loft requires at least one wire or start/end point"));
196
+ return result.err(result.validationError("LOFT_EMPTY", "Loft requires at least one wire or start/end point"));
197
197
  }
198
198
  const kernel = shapeTypes.getKernel();
199
199
  const startVertex = startPoint ? solidBuilders.makeVertex(types.toVec3(startPoint)).wrapped : void 0;
@@ -208,14 +208,14 @@ const loft = (wires, { ruled = true, startPoint, endPoint } = {}, returnShell =
208
208
  ...endVertex ? { endVertex } : {}
209
209
  }
210
210
  );
211
- const result = errors.andThen(faceFns.cast(shape), (s) => {
211
+ const result$1 = result.andThen(faceFns.cast(shape), (s) => {
212
212
  if (!faceFns.isShape3D(s))
213
- return errors.err(errors.typeCastError("LOFT_NOT_3D", "Loft did not produce a 3D shape"));
214
- return errors.ok(s);
213
+ return result.err(result.typeCastError("LOFT_NOT_3D", "Loft did not produce a 3D shape"));
214
+ return result.ok(s);
215
215
  });
216
- return result;
216
+ return result$1;
217
217
  } catch {
218
- return errors.err(errors.kernelError("LOFT_FAILED", "Loft operation failed"));
218
+ return result.err(result.kernelError("LOFT_FAILED", "Loft operation failed"));
219
219
  }
220
220
  };
221
221
  exports.basicFaceExtrusion = basicFaceExtrusion;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const shapeTypes = require("./shapeTypes-7xEam9Ri.cjs");
3
- const faceFns = require("./faceFns-BLTEPBKq.cjs");
3
+ const faceFns = require("./faceFns-DB1Fc5gy.cjs");
4
4
  let cache = /* @__PURE__ */ new WeakMap();
5
5
  function getCachedMeasurement(shape, key) {
6
6
  return cache.get(shape)?.get(key);
@@ -1,5 +1,5 @@
1
1
  import { B as getKernel } from "./shapeTypes-CpSaBLDv.js";
2
- import { u as uvBounds } from "./faceFns-B6ebRh5I.js";
2
+ import { u as uvBounds } from "./faceFns-B8GnxjdY.js";
3
3
  let cache = /* @__PURE__ */ new WeakMap();
4
4
  function getCachedMeasurement(shape, key) {
5
5
  return cache.get(shape)?.get(key);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const measurement = require("./measurement-DoYXRaKI.cjs");
3
+ const measurement = require("./measurement-BoNTUBAp.cjs");
4
4
  exports.createDistanceQuery = measurement.createDistanceQuery;
5
5
  exports.measureArea = measurement.measureArea;
6
6
  exports.measureDistance = measurement.measureDistance;
@@ -1,4 +1,4 @@
1
- import { d, m, g, h, i, a, c, b } from "./measurement-oWvhSVZG.js";
1
+ import { d, m, g, h, i, a, c, b } from "./measurement-D8EJ694A.js";
2
2
  export {
3
3
  d as createDistanceQuery,
4
4
  m as measureArea,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const shapeTypes = require("./shapeTypes-7xEam9Ri.cjs");
3
- const errors = require("./errors-9fDehDNc.cjs");
4
- const shapeFns = require("./shapeFns-D-MOoqJd.cjs");
3
+ const result = require("./result-fAX0OZzI.cjs");
4
+ const shapeFns = require("./shapeFns-C2SnNvdH.cjs");
5
5
  function buildMeshCacheKey(tolerance, angularTolerance, skipNormals, includeUVs = false) {
6
6
  return `${tolerance}:${angularTolerance}:${skipNormals}:${includeUVs}`;
7
7
  }
@@ -86,7 +86,7 @@ function mesh(shape, {
86
86
  const cached = getMeshForShape(shape.wrapped, cacheKey);
87
87
  if (cached) return cached;
88
88
  }
89
- const result = shapeTypes.getKernel().mesh(shape.wrapped, {
89
+ const result2 = shapeTypes.getKernel().mesh(shape.wrapped, {
90
90
  tolerance,
91
91
  angularTolerance,
92
92
  skipNormals,
@@ -95,11 +95,11 @@ function mesh(shape, {
95
95
  });
96
96
  const origins = shapeFns.getFaceOrigins(shape);
97
97
  const mesh2 = {
98
- vertices: result.vertices,
99
- normals: result.normals,
100
- triangles: result.triangles,
101
- uvs: result.uvs,
102
- faceGroups: result.faceGroups.map((g) => ({
98
+ vertices: result2.vertices,
99
+ normals: result2.normals,
100
+ triangles: result2.triangles,
101
+ uvs: result2.uvs,
102
+ faceGroups: result2.faceGroups.map((g) => ({
103
103
  start: g.start,
104
104
  count: g.count,
105
105
  faceId: g.faceHash,
@@ -118,7 +118,7 @@ function meshEdges(shape, { tolerance = 1e-3, angularTolerance = 0.1, cache = tr
118
118
  if (cached) return cached;
119
119
  }
120
120
  const kernelResult = shapeTypes.getKernel().meshEdges(shape.wrapped, tolerance, angularTolerance);
121
- const result = {
121
+ const result2 = {
122
122
  lines: kernelResult.lines,
123
123
  edgeGroups: kernelResult.edgeGroups.map((g) => ({
124
124
  start: g.start,
@@ -127,19 +127,19 @@ function meshEdges(shape, { tolerance = 1e-3, angularTolerance = 0.1, cache = tr
127
127
  }))
128
128
  };
129
129
  if (cache) {
130
- setEdgeMeshForShape(shape.wrapped, cacheKey, result);
130
+ setEdgeMeshForShape(shape.wrapped, cacheKey, result2);
131
131
  }
132
- return result;
132
+ return result2;
133
133
  }
134
134
  function exportSTEP(shape) {
135
135
  try {
136
136
  const stepString = shapeTypes.getKernel().exportSTEP([shape.wrapped]);
137
- return errors.ok(new Blob([stepString], { type: "application/STEP" }));
137
+ return result.ok(new Blob([stepString], { type: "application/STEP" }));
138
138
  } catch (e) {
139
139
  const isWriteFailure = e instanceof Error && e.message.startsWith("STEP export failed");
140
140
  const code = isWriteFailure ? "STEP_EXPORT_FAILED" : "STEP_FILE_READ_ERROR";
141
141
  const msg = isWriteFailure ? "Failed to write STEP file" : "Failed to read exported STEP file";
142
- return errors.err(errors.ioError(code, msg, e));
142
+ return result.err(result.ioError(code, msg, e));
143
143
  }
144
144
  }
145
145
  function exportSTL(shape, {
@@ -152,20 +152,20 @@ function exportSTL(shape, {
152
152
  shapeTypes.getKernel().meshShape(shape.wrapped, tolerance, angularTolerance);
153
153
  }
154
154
  const stlData = shapeTypes.getKernel().exportSTL(shape.wrapped, binary);
155
- return errors.ok(new Blob([stlData], { type: "application/sla" }));
155
+ return result.ok(new Blob([stlData], { type: "application/sla" }));
156
156
  } catch (e) {
157
157
  const isWriteFailure = e instanceof Error && e.message.startsWith("STL export failed");
158
158
  const code = isWriteFailure ? "STL_EXPORT_FAILED" : "STL_FILE_READ_ERROR";
159
159
  const msg = isWriteFailure ? "Failed to write STL file" : "Failed to read exported STL file";
160
- return errors.err(errors.ioError(code, msg, e));
160
+ return result.err(result.ioError(code, msg, e));
161
161
  }
162
162
  }
163
163
  function exportIGES(shape) {
164
164
  try {
165
165
  const igesString = shapeTypes.getKernel().exportIGES([shape.wrapped]);
166
- return errors.ok(new Blob([igesString], { type: "application/iges" }));
166
+ return result.ok(new Blob([igesString], { type: "application/iges" }));
167
167
  } catch (e) {
168
- return errors.err(errors.ioError("IGES_EXPORT_FAILED", "Failed to write IGES file", e));
168
+ return result.err(result.ioError("IGES_EXPORT_FAILED", "Failed to write IGES file", e));
169
169
  }
170
170
  }
171
171
  exports.clearMeshCache = clearMeshCache;
@@ -1,6 +1,6 @@
1
1
  import { B as getKernel } from "./shapeTypes-CpSaBLDv.js";
2
- import { o as ok, e as err, i as ioError } from "./errors-B7kgv0cd.js";
3
- import { g as getFaceOrigins } from "./shapeFns-D2PlLFE6.js";
2
+ import { o as ok, e as err, i as ioError } from "./result-BaSD1fqR.js";
3
+ import { g as getFaceOrigins } from "./shapeFns-FDuKkrDR.js";
4
4
  function buildMeshCacheKey(tolerance, angularTolerance, skipNormals, includeUVs = false) {
5
5
  return `${tolerance}:${angularTolerance}:${skipNormals}:${includeUVs}`;
6
6
  }
@@ -1,10 +1,10 @@
1
1
  import { B as getKernel, d as createKernelHandle, c as castShape, p as isShape3D, u as isWire, F as createSolid } from "./shapeTypes-CpSaBLDv.js";
2
2
  import { g as vecLength, v as vecAdd, j as vecNormalize, f as vecIsZero } from "./vecOps-ZDdZWbwT.js";
3
- import { e as err, y as validationError, r as unwrap, p as typeCastError, o as ok, B as BrepErrorCode, k as kernelError, i as ioError, b as computationError } from "./errors-B7kgv0cd.js";
4
- import { a as buildLawFromProfile } from "./loft-BcZUCGKi.js";
5
- import { j as fuseAll } from "./booleanFns-CcNUsgI8.js";
6
- import { t as toBREP } from "./shapeFns-D2PlLFE6.js";
7
- import { j as fromBREP } from "./faceFns-B6ebRh5I.js";
3
+ import { e as err, z as validationError, v as unwrap, r as typeCastError, o as ok, A as BrepErrorCode, k as kernelError, i as ioError, d as computationError } from "./result-BaSD1fqR.js";
4
+ import { a as buildLawFromProfile } from "./loft-Bhw-FMoL.js";
5
+ import { j as fuseAll } from "./booleanFns-BCTjYZAg.js";
6
+ import { t as toBREP } from "./shapeFns-FDuKkrDR.js";
7
+ import { j as fromBREP } from "./faceFns-B8GnxjdY.js";
8
8
  function uuidv() {
9
9
  return (String([1e7]) + String(-1e3) + String(-4e3) + String(-8e3) + String(-1e11)).replace(
10
10
  /[018]/g,