brepjs 8.8.7 → 8.8.9

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 (43) hide show
  1. package/dist/2d.cjs +2 -2
  2. package/dist/2d.js +3 -3
  3. package/dist/{Blueprint-BWLPU0ZC.js → Blueprint-C7JlgasP.js} +2 -2
  4. package/dist/{Blueprint-CIfiTx-y.cjs → Blueprint-CTrwIDuQ.cjs} +2 -2
  5. package/dist/{boolean2D-BG9wtSKz.js → boolean2D-CypPzZM1.js} +4 -4
  6. package/dist/{boolean2D-Bs_OdV2_.cjs → boolean2D-KvkerCI-.cjs} +4 -4
  7. package/dist/{booleanFns-DHEaBJwW.js → booleanFns-BnLhgDGb.js} +2 -2
  8. package/dist/{booleanFns-CUxOBNlC.cjs → booleanFns-DEY86xmR.cjs} +2 -2
  9. package/dist/brepjs.cjs +33 -38
  10. package/dist/brepjs.js +41 -46
  11. package/dist/{cornerFinder-DfSdXbxK.js → cornerFinder-BurQenn5.js} +1 -1
  12. package/dist/{cornerFinder-BijsFhpz.cjs → cornerFinder-DLHDc022.cjs} +1 -1
  13. package/dist/{drawFns-Df_AbW16.js → drawFns-BY9W9rPP.js} +7 -7
  14. package/dist/{drawFns-BGGYhul8.cjs → drawFns-ibZFQZkt.cjs} +7 -7
  15. package/dist/{helpers-Ces6b2wm.cjs → helpers-DQGErXAX.cjs} +1 -1
  16. package/dist/{helpers-D7hTCTJm.js → helpers-SajoWDKO.js} +1 -1
  17. package/dist/io.cjs +2 -2
  18. package/dist/io.js +2 -2
  19. package/dist/{loft-BpfrTPIR.js → loft-CfKcU3Y1.js} +1 -1
  20. package/dist/{loft-GLxTzuXU.cjs → loft-hhMumRtt.cjs} +1 -1
  21. package/dist/{meshFns-BTb2esZJ.cjs → meshFns-CfjNBqS6.cjs} +1 -1
  22. package/dist/{meshFns-DJx5Yqiy.js → meshFns-Diog9oLS.js} +1 -1
  23. package/dist/operations/loftFns.d.ts +3 -1
  24. package/dist/operations/loftFns.d.ts.map +1 -1
  25. package/dist/{operations-CHIU-aGI.js → operations-BFDNdchq.js} +2 -2
  26. package/dist/{operations-T5f-v2rF.cjs → operations-CZUFSBuY.cjs} +2 -2
  27. package/dist/operations.cjs +2 -2
  28. package/dist/operations.js +2 -2
  29. package/dist/query.cjs +2 -2
  30. package/dist/query.js +3 -3
  31. package/dist/{shapeFns-CbZMmuQA.cjs → shapeFns-D4MYB8um.cjs} +145 -95
  32. package/dist/{shapeFns-5HlS8wvc.js → shapeFns-DNxuGWvV.js} +146 -96
  33. package/dist/sketching.cjs +2 -2
  34. package/dist/sketching.js +2 -2
  35. package/dist/{surfaceBuilders-zlVu1d-b.js → surfaceBuilders-DEd0HUri.js} +1 -1
  36. package/dist/{surfaceBuilders-zWnw2I0j.cjs → surfaceBuilders-DeFCNwZl.cjs} +1 -1
  37. package/dist/topology/shapeFns.d.ts.map +1 -1
  38. package/dist/topology/surfaceFns.d.ts.map +1 -1
  39. package/dist/{topology-ZRFxrEEW.cjs → topology-CRPSzNkp.cjs} +3 -3
  40. package/dist/{topology-CMS8QyJa.js → topology-XD2qFlgc.js} +3 -3
  41. package/dist/topology.cjs +4 -4
  42. package/dist/topology.js +4 -4
  43. package/package.json +2 -3
package/dist/2d.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const Blueprint = require("./Blueprint-CIfiTx-y.cjs");
4
- const boolean2D = require("./boolean2D-Bs_OdV2_.cjs");
3
+ const Blueprint = require("./Blueprint-CTrwIDuQ.cjs");
4
+ const boolean2D = require("./boolean2D-KvkerCI-.cjs");
5
5
  function reverseCurve(curve) {
6
6
  const cloned = curve.clone();
7
7
  cloned.reverse();
package/dist/2d.js CHANGED
@@ -1,6 +1,6 @@
1
- import { B as Blueprint } from "./Blueprint-BWLPU0ZC.js";
2
- import { d, C, r } from "./Blueprint-BWLPU0ZC.js";
3
- import { e, C as C2, f, l, g, n, k, q, o, p, r as r2 } from "./boolean2D-BG9wtSKz.js";
1
+ import { B as Blueprint } from "./Blueprint-C7JlgasP.js";
2
+ import { d, C, r } from "./Blueprint-C7JlgasP.js";
3
+ import { e, C as C2, f, l, g, n, k, q, o, p, r as r2 } from "./boolean2D-CypPzZM1.js";
4
4
  function reverseCurve(curve) {
5
5
  const cloned = curve.clone();
6
6
  cloned.reverse();
@@ -49,8 +49,8 @@ import { D as DisposalScope, x as registerForCleanup, y as unregisterFromCleanup
49
49
  import { u as uvBounds, f as faceGeomType, e as faceCenter, h as uvCoordinates, c as cast } from "./faceFns-DG4bu-QB.js";
50
50
  import { f as findCurveType, g as getOrientation } from "./curveFns-VRW_cski.js";
51
51
  import { u as unwrap, l as ok, e as err, b as computationError, x as validationError } from "./errors-CHfaHQSt.js";
52
- import { z as zip, m as makeFace } from "./surfaceBuilders-zlVu1d-b.js";
53
- import { d as distance2d, s as samePoint, b as scalarMultiply2d, c as add2d, n as normalize2d, e as subtract2d, g as getSingleFace } from "./helpers-D7hTCTJm.js";
52
+ import { z as zip, m as makeFace } from "./surfaceBuilders-DEd0HUri.js";
53
+ import { d as distance2d, s as samePoint, b as scalarMultiply2d, c as add2d, n as normalize2d, e as subtract2d, g as getSingleFace } from "./helpers-SajoWDKO.js";
54
54
  import { R as RAD2DEG, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
55
55
  import { bug } from "./result.js";
56
56
  function makePlane(plane, origin) {
@@ -50,8 +50,8 @@ const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
50
50
  const faceFns = require("./faceFns-B8xnZw-f.cjs");
51
51
  const curveFns = require("./curveFns-D0L3YcH-.cjs");
52
52
  const errors = require("./errors-BYb4tL5h.cjs");
53
- const surfaceBuilders = require("./surfaceBuilders-zWnw2I0j.cjs");
54
- const helpers = require("./helpers-Ces6b2wm.cjs");
53
+ const surfaceBuilders = require("./surfaceBuilders-DeFCNwZl.cjs");
54
+ const helpers = require("./helpers-DQGErXAX.cjs");
55
55
  const vecOps = require("./vecOps-CjRL1jau.cjs");
56
56
  const result = require("./result.cjs");
57
57
  function makePlane(plane, origin) {
@@ -48,13 +48,13 @@ import { l as ok, e as err, b as computationError, u as unwrap, g as isOk } from
48
48
  import { d as downcast, u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-DG4bu-QB.js";
49
49
  import { g as getKernel, a as toVec3 } from "./occtBoundary-Ct0tN8cs.js";
50
50
  import { n as vecScale, j as vecNormalize, b as vecCross, D as DEG2RAD, R as RAD2DEG } from "./vecOps-ZDdZWbwT.js";
51
- import { r as revolution, c as complexExtrude, t as twistExtrude, b as basicFaceExtrusion, g as genericSweep, l as loft } from "./loft-BpfrTPIR.js";
51
+ import { r as revolution, c as complexExtrude, t as twistExtrude, b as basicFaceExtrusion, g as genericSweep, l as loft } from "./loft-CfKcU3Y1.js";
52
52
  import { D as DisposalScope, s as createFace, q as createWire, r as createEdge } from "./shapeTypes-D34s68Xi.js";
53
53
  import { d as curveStartPoint, c as curveTangentAt, e as curveIsClosed } from "./curveFns-VRW_cski.js";
54
- import { m as makeFace, l as makeNewFaceWithinFace, b as assembleWire, z as zip } from "./surfaceBuilders-zlVu1d-b.js";
54
+ import { m as makeFace, l as makeNewFaceWithinFace, b as assembleWire, z as zip } from "./surfaceBuilders-DEd0HUri.js";
55
55
  import { bug } from "./result.js";
56
- import { s as samePoint$1, n as normalize2d, e as subtract2d, c as add2d, i as crossProduct2d, b as scalarMultiply2d, f as polarToCartesian, r as rotate2d, j as cartesianToPolar, d as distance2d, p as polarAngle2d, k as PRECISION_INTERSECTION } from "./helpers-D7hTCTJm.js";
57
- import { C as Curve2D, a as make2dSegmentCurve, j as approximateAsBSpline, b as make2dArcFromCenter, k as isPoint2D, g as make2dCircle, l as make2dThreePointArc, d as BoundingBox2d, v as viewbox, n as asSVG, B as Blueprint, o as make2dEllipseArc, p as make2dTangentArc, q as make2dBezierCurve, r as axis2d, s as removeDuplicatePoints } from "./Blueprint-BWLPU0ZC.js";
56
+ import { s as samePoint$1, n as normalize2d, e as subtract2d, c as add2d, i as crossProduct2d, b as scalarMultiply2d, f as polarToCartesian, r as rotate2d, j as cartesianToPolar, d as distance2d, p as polarAngle2d, k as PRECISION_INTERSECTION } from "./helpers-SajoWDKO.js";
57
+ import { C as Curve2D, a as make2dSegmentCurve, j as approximateAsBSpline, b as make2dArcFromCenter, k as isPoint2D, g as make2dCircle, l as make2dThreePointArc, d as BoundingBox2d, v as viewbox, n as asSVG, B as Blueprint, o as make2dEllipseArc, p as make2dTangentArc, q as make2dBezierCurve, r as axis2d, s as removeDuplicatePoints } from "./Blueprint-C7JlgasP.js";
58
58
  function* pointsIteration(intersector) {
59
59
  const nPoints = intersector.NbPoints();
60
60
  if (!nPoints) return;
@@ -49,13 +49,13 @@ const errors = require("./errors-BYb4tL5h.cjs");
49
49
  const faceFns = require("./faceFns-B8xnZw-f.cjs");
50
50
  const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
51
51
  const vecOps = require("./vecOps-CjRL1jau.cjs");
52
- const loft = require("./loft-GLxTzuXU.cjs");
52
+ const loft = require("./loft-hhMumRtt.cjs");
53
53
  const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
54
54
  const curveFns = require("./curveFns-D0L3YcH-.cjs");
55
- const surfaceBuilders = require("./surfaceBuilders-zWnw2I0j.cjs");
55
+ const surfaceBuilders = require("./surfaceBuilders-DeFCNwZl.cjs");
56
56
  const result = require("./result.cjs");
57
- const helpers = require("./helpers-Ces6b2wm.cjs");
58
- const Blueprint = require("./Blueprint-CIfiTx-y.cjs");
57
+ const helpers = require("./helpers-DQGErXAX.cjs");
58
+ const Blueprint = require("./Blueprint-CTrwIDuQ.cjs");
59
59
  function* pointsIteration(intersector) {
60
60
  const nPoints = intersector.NbPoints();
61
61
  if (!nPoints) return;
@@ -48,8 +48,8 @@ import { D as DisposalScope, c as castShape, j as isShape3D } from "./shapeTypes
48
48
  import { l as ok, d as isErr, e as err, x as validationError, B as BrepErrorCode, p as typeCastError, o as occtError } from "./errors-CHfaHQSt.js";
49
49
  import { r as resolvePlane } from "./vectors-Dp5Iu1KH.js";
50
50
  import { H as HASH_CODE_MAX, n as vecScale, v as vecAdd } from "./vecOps-ZDdZWbwT.js";
51
- import { a as getFaces, i as iterOcList, p as propagateOrigins, b as propagateOriginsByHash, c as getWires, d as getEdges, e as getVertices } from "./shapeFns-5HlS8wvc.js";
52
- import { m as makeFace } from "./surfaceBuilders-zlVu1d-b.js";
51
+ import { a as getFaces, i as iterOcList, p as propagateOrigins, b as propagateOriginsByHash, c as getWires, d as getEdges, e as getVertices } from "./shapeFns-DNxuGWvV.js";
52
+ import { m as makeFace } from "./surfaceBuilders-DEd0HUri.js";
53
53
  function applyGlue(op, optimisation) {
54
54
  const oc = getKernel().oc;
55
55
  if (optimisation === "commonFace") {
@@ -49,8 +49,8 @@ const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
49
49
  const errors = require("./errors-BYb4tL5h.cjs");
50
50
  const vectors = require("./vectors-9rrStq8t.cjs");
51
51
  const vecOps = require("./vecOps-CjRL1jau.cjs");
52
- const shapeFns = require("./shapeFns-CbZMmuQA.cjs");
53
- const surfaceBuilders = require("./surfaceBuilders-zWnw2I0j.cjs");
52
+ const shapeFns = require("./shapeFns-D4MYB8um.cjs");
53
+ const surfaceBuilders = require("./surfaceBuilders-DeFCNwZl.cjs");
54
54
  function applyGlue(op, optimisation) {
55
55
  const oc = occtBoundary.getKernel().oc;
56
56
  if (optimisation === "commonFace") {
package/dist/brepjs.cjs CHANGED
@@ -49,26 +49,26 @@ const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
49
49
  const errors = require("./errors-BYb4tL5h.cjs");
50
50
  const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
51
51
  const vecOps = require("./vecOps-CjRL1jau.cjs");
52
- const Blueprint = require("./Blueprint-CIfiTx-y.cjs");
52
+ const Blueprint = require("./Blueprint-CTrwIDuQ.cjs");
53
53
  const curveFns = require("./curveFns-D0L3YcH-.cjs");
54
- const loft$2 = require("./loft-GLxTzuXU.cjs");
55
- const operations = require("./operations-T5f-v2rF.cjs");
56
- const boolean2D = require("./boolean2D-Bs_OdV2_.cjs");
54
+ const loft$2 = require("./loft-hhMumRtt.cjs");
55
+ const operations = require("./operations-CZUFSBuY.cjs");
56
+ const boolean2D = require("./boolean2D-KvkerCI-.cjs");
57
57
  const _2d = require("./2d.cjs");
58
- const helpers = require("./helpers-Ces6b2wm.cjs");
58
+ const helpers = require("./helpers-DQGErXAX.cjs");
59
59
  const io = require("./io.cjs");
60
- const drawFns = require("./drawFns-BGGYhul8.cjs");
60
+ const drawFns = require("./drawFns-ibZFQZkt.cjs");
61
61
  const vectors = require("./vectors-9rrStq8t.cjs");
62
- const shapeFns = require("./shapeFns-CbZMmuQA.cjs");
63
- const booleanFns = require("./booleanFns-CUxOBNlC.cjs");
64
- const topology = require("./topology-ZRFxrEEW.cjs");
62
+ const shapeFns = require("./shapeFns-D4MYB8um.cjs");
63
+ const booleanFns = require("./booleanFns-DEY86xmR.cjs");
64
+ const topology = require("./topology-CRPSzNkp.cjs");
65
65
  const faceFns = require("./faceFns-B8xnZw-f.cjs");
66
- const meshFns = require("./meshFns-BTb2esZJ.cjs");
66
+ const meshFns = require("./meshFns-CfjNBqS6.cjs");
67
67
  const measurement = require("./measurement-C4Ofuy_y.cjs");
68
- const surfaceBuilders = require("./surfaceBuilders-zWnw2I0j.cjs");
68
+ const surfaceBuilders = require("./surfaceBuilders-DeFCNwZl.cjs");
69
69
  const query = require("./query.cjs");
70
70
  const result = require("./result.cjs");
71
- const cornerFinder = require("./cornerFinder-BijsFhpz.cjs");
71
+ const cornerFinder = require("./cornerFinder-DLHDc022.cjs");
72
72
  const worker = require("./worker.cjs");
73
73
  const errorFactories = {
74
74
  OCCT_OPERATION: (code, message, cause) => ({ kind: "OCCT_OPERATION", code, message, cause }),
@@ -200,6 +200,9 @@ function buildVertexFinder(filters) {
200
200
  function vertexFinder() {
201
201
  return buildVertexFinder([]);
202
202
  }
203
+ const REC601_R = 0.299;
204
+ const REC601_G = 0.587;
205
+ const REC601_B = 0.114;
203
206
  function surfaceFromGrid(heights, options = {}) {
204
207
  if (heights.length < 2) {
205
208
  return errors.err(
@@ -245,10 +248,11 @@ function surfaceFromGrid(heights, options = {}) {
245
248
  }
246
249
  }
247
250
  function buildBSplineSurface(heights, rows, cols, dx, dy, scaleZ) {
248
- const oc = occtBoundary.getKernel().oc;
249
- const OC = oc;
250
- const pntArray = new OC.TColgp_Array2OfPnt_2(1, rows, 1, cols);
251
+ var _stack = [];
251
252
  try {
253
+ const oc = occtBoundary.getKernel().oc;
254
+ const scope = __using(_stack, new shapeTypes.DisposalScope());
255
+ const pntArray = scope.register(new oc.TColgp_Array2OfPnt_2(1, rows, 1, cols));
252
256
  for (let r = 0; r < rows; r++) {
253
257
  for (let c = 0; c < cols; c++) {
254
258
  const row = heights[r];
@@ -258,33 +262,24 @@ function buildBSplineSurface(heights, rows, cols, dx, dy, scaleZ) {
258
262
  pnt.delete();
259
263
  }
260
264
  }
261
- const fitter = new OC.GeomAPI_PointsToBSplineSurface_2(pntArray, 3, 8, 0, 1e-3);
265
+ const fitter = scope.register(new oc.GeomAPI_PointsToBSplineSurface_2(pntArray, 3, 8, 0, 1e-3));
262
266
  const surface = fitter.Surface();
263
- const faceMaker = new OC.BRepBuilderAPI_MakeFace_8(surface, 1e-6);
264
- let result2;
267
+ const faceMaker = scope.register(new oc.BRepBuilderAPI_MakeFace_8(surface, 1e-6));
265
268
  if (faceMaker.IsDone()) {
266
269
  const shape2 = shapeTypes.castShape(faceMaker.Face());
267
270
  if (shapeTypes.isFace(shape2)) {
268
- result2 = errors.ok(shape2);
269
- } else {
270
- shape2[Symbol.dispose]();
271
- result2 = errors.err(
272
- errors.occtError(errors.BrepErrorCode.SURFACE_FAILED, "B-spline surface did not produce a face")
273
- );
271
+ return errors.ok(shape2);
274
272
  }
275
- } else {
276
- result2 = errors.err(
277
- errors.occtError(
278
- errors.BrepErrorCode.SURFACE_FAILED,
279
- "BRepBuilderAPI_MakeFace failed for B-spline surface"
280
- )
281
- );
273
+ shape2[Symbol.dispose]();
274
+ return errors.err(errors.occtError(errors.BrepErrorCode.SURFACE_FAILED, "B-spline surface did not produce a face"));
282
275
  }
283
- faceMaker.delete();
284
- fitter.delete();
285
- return result2;
276
+ return errors.err(
277
+ errors.occtError(errors.BrepErrorCode.SURFACE_FAILED, "BRepBuilderAPI_MakeFace failed for B-spline surface")
278
+ );
279
+ } catch (_) {
280
+ var _error = _, _hasError = true;
286
281
  } finally {
287
- pntArray.delete();
282
+ __callDispose(_stack, _error, _hasError);
288
283
  }
289
284
  }
290
285
  function buildTriangulatedSurface(heights, rows, cols, dx, dy, scaleZ) {
@@ -413,7 +408,7 @@ async function surfaceFromImage(blob, options = {}) {
413
408
  value = b / 255;
414
409
  break;
415
410
  default:
416
- value = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
411
+ value = (REC601_R * r + REC601_G * g + REC601_B * b) / 255;
417
412
  break;
418
413
  }
419
414
  row.push(value);
@@ -2460,7 +2455,7 @@ function isValid(shape2) {
2460
2455
  function isEmpty(shape2) {
2461
2456
  return shapeFns.isEmpty(resolve(shape2));
2462
2457
  }
2463
- function loft$1(wires, { ruled = true, startPoint, endPoint } = {}, returnShell = false) {
2458
+ function loft$1(wires, { ruled = true, startPoint, endPoint, tolerance = 1e-6 } = {}, returnShell = false) {
2464
2459
  var _stack = [];
2465
2460
  try {
2466
2461
  if (wires.length === 0 && !startPoint && !endPoint) {
@@ -2468,7 +2463,7 @@ function loft$1(wires, { ruled = true, startPoint, endPoint } = {}, returnShell
2468
2463
  }
2469
2464
  const oc = occtBoundary.getKernel().oc;
2470
2465
  const scope = __using(_stack, new shapeTypes.DisposalScope());
2471
- const builder = scope.register(new oc.BRepOffsetAPI_ThruSections(!returnShell, ruled, 1e-6));
2466
+ const builder = scope.register(new oc.BRepOffsetAPI_ThruSections(!returnShell, ruled, tolerance));
2472
2467
  if (startPoint) {
2473
2468
  const pnt = scope.register(occtBoundary.toOcPnt(occtBoundary.toVec3(startPoint)));
2474
2469
  const vMaker = scope.register(new oc.BRepBuilderAPI_MakeVertex(pnt));
package/dist/brepjs.js CHANGED
@@ -51,37 +51,37 @@ import { c as castShape, D as DisposalScope, e as isFace, k as isShell, l as isS
51
51
  import { t as t3, r as r3, s as s2, a as a2, b as b3, z as z2, u, A, B, g as g2, i as i2, f as f2, h as h3, m as m2, C, w as w3, o, p } from "./shapeTypes-D34s68Xi.js";
52
52
  import { c as vecDistance, D as DEG2RAD, H as HASH_CODE_MAX, n as vecScale, j as vecNormalize, f as vecIsZero } from "./vecOps-ZDdZWbwT.js";
53
53
  import { R, v as v2, a as a3, b as b4, d, e, g as g3, h as h4, i as i3, k as k3, l as l2, m as m3, o as o2 } from "./vecOps-ZDdZWbwT.js";
54
- import { B as B2, d as d2, C as C2, r as r4, t as t4 } from "./Blueprint-BWLPU0ZC.js";
54
+ import { B as B2, d as d2, C as C2, r as r4, t as t4 } from "./Blueprint-C7JlgasP.js";
55
55
  import { e as curveIsClosed, d as curveStartPoint, c as curveTangentAt, h as curvePointAt, a as curveEndPoint, i as curveLength } from "./curveFns-VRW_cski.js";
56
56
  import { j as j3, k as k4, l as l3, f as f3, m as m4, b as b5, g as g4, n as n3, o as o3 } from "./curveFns-VRW_cski.js";
57
- import { m as makeCompound, d as makeCone, e as makeCylinder, f as makeEllipsoid, h as makeOffset, w as weldShellsAndFaces, a as makeSolid, i as makeSphere, j as makeTorus, k as makeVertex } from "./loft-BpfrTPIR.js";
58
- import { b as b6, g as g5, r as r5 } from "./loft-BpfrTPIR.js";
59
- import { w as walkAssembly, e as extrude$1, r as revolve$1, s as sweep, c as circularPattern, l as linearPattern } from "./operations-CHIU-aGI.js";
60
- import { a as a4, b as b7, d as d3, f as f4, g as g6, h as h5, i as i4, j as j4, k as k5, m as m5, n as n4, o as o4, p as p2, q, t as t5, u as u2, v as v3, x, y, z as z3, A as A2, B as B3, C as C3, D, E } from "./operations-CHIU-aGI.js";
61
- import { B as B4, a as a5, e as e2, C as C4, F, S, f as f5, l as l4, g as g7, n as n5, k as k6, q as q2, o as o5, p as p3, r as r6 } from "./boolean2D-BG9wtSKz.js";
57
+ import { m as makeCompound, d as makeCone, e as makeCylinder, f as makeEllipsoid, h as makeOffset, w as weldShellsAndFaces, a as makeSolid, i as makeSphere, j as makeTorus, k as makeVertex } from "./loft-CfKcU3Y1.js";
58
+ import { b as b6, g as g5, r as r5 } from "./loft-CfKcU3Y1.js";
59
+ import { w as walkAssembly, e as extrude$1, r as revolve$1, s as sweep, c as circularPattern, l as linearPattern } from "./operations-BFDNdchq.js";
60
+ import { a as a4, b as b7, d as d3, f as f4, g as g6, h as h5, i as i4, j as j4, k as k5, m as m5, n as n4, o as o4, p as p2, q, t as t5, u as u2, v as v3, x, y, z as z3, A as A2, B as B3, C as C3, D, E } from "./operations-BFDNdchq.js";
61
+ import { B as B4, a as a5, e as e2, C as C4, F, S, f as f5, l as l4, g as g7, n as n5, k as k6, q as q2, o as o5, p as p3, r as r6 } from "./boolean2D-CypPzZM1.js";
62
62
  import { createBlueprint, curve2dBoundingBox, curve2dDistanceFrom, curve2dFirstPoint, curve2dIsOnCurve, curve2dLastPoint, curve2dParameter, curve2dSplitAt, curve2dTangentAt, getBounds2D, getOrientation2D, isInside2D, mirror2D, reverseCurve, rotate2D, scale2D, sketch2DOnFace, sketch2DOnPlane, stretch2D, toSVGPathD, translate2D } from "./2d.js";
63
- import { l as createTypedFinder, m as faceFinder } from "./helpers-D7hTCTJm.js";
64
- import { g as g8 } from "./helpers-D7hTCTJm.js";
63
+ import { l as createTypedFinder, m as faceFinder } from "./helpers-SajoWDKO.js";
64
+ import { g as g8 } from "./helpers-SajoWDKO.js";
65
65
  import { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportOBJ, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD } from "./io.js";
66
- import { C as C5, D as D2, a as a6, S as S2, b as b8, X, Y, c as c2, d as d4, e as e3, f as f6, Z, g as g9, h as h6, i as i5, j as j5, k as k7, l as l5, m as m6, n as n6, o as o6, p as p4, q as q3, r as r7, s as s3, t as t6, u as u3, v as v4, w as w4, x as x2, y as y2, z as z4, _, $, a0, a1, A as A3, a2 as a22, B as B5, E as E2, a3 as a32, F as F2, G, H, I, J, K, L, M, N, O as O2, P, Q, R as R2, T, U, a4 as a42, V, a5 as a52, a6 as a62, W } from "./drawFns-Df_AbW16.js";
66
+ import { C as C5, D as D2, a as a6, S as S2, b as b8, X, Y, c as c2, d as d4, e as e3, f as f6, Z, g as g9, h as h6, i as i5, j as j5, k as k7, l as l5, m as m6, n as n6, o as o6, p as p4, q as q3, r as r7, s as s3, t as t6, u as u3, v as v4, w as w4, x as x2, y as y2, z as z4, _, $, a0, a1, A as A3, a2 as a22, B as B5, E as E2, a3 as a32, F as F2, G, H, I, J, K, L, M, N, O as O2, P, Q, R as R2, T, U, a4 as a42, V, a5 as a52, a6 as a62, W } from "./drawFns-BY9W9rPP.js";
67
67
  import { c as c3, a as a7, p as p5, r as r8, t as t7 } from "./vectors-Dp5Iu1KH.js";
68
- import { v as vertexPosition, a as getFaces, e as getVertices, d as getEdges, t as translate$1, p as propagateOrigins, j as applyMatrix$1, k as clone$1, l as describe$1, m as isEmpty$1, n as mirror$1, r as rotate$1, s as scale$1, o as simplify$1, q as toBREP$1, u as transformCopy$1, w as getBounds, c as getWires } from "./shapeFns-5HlS8wvc.js";
69
- import { x as x3, g as g10, f as f7, y as y3, h as h7, z as z5, A as A4, B as B6, C as C6, D as D3, E as E3 } from "./shapeFns-5HlS8wvc.js";
70
- import { p as propagateFaceTags, a as propagateColors, c as cut$1, f as fuse$1, i as intersect$1, s as section$1, b as sectionToFace$1, d as slice$1, e as split$1, g as fuseAll, h as cutAll } from "./booleanFns-DHEaBJwW.js";
71
- import { j as j6, k as k8, l as l6, m as m7, n as n7, o as o7, q as q4, r as r9, t as t8, u as u4 } from "./booleanFns-DHEaBJwW.js";
72
- import { c as chamferDistAngle, h as heal$1, i as isValid$1 } from "./topology-CMS8QyJa.js";
73
- import { a as a8, b as b9, e as e4, f as f8, d as d5, g as g11, j as j7, s as s4, t as t9, k as k9, l as l7, v as v5, w as w5 } from "./topology-CMS8QyJa.js";
68
+ import { v as vertexPosition, a as getFaces, e as getVertices, d as getEdges, t as translate$1, p as propagateOrigins, j as applyMatrix$1, k as clone$1, l as describe$1, m as isEmpty$1, n as mirror$1, r as rotate$1, s as scale$1, o as simplify$1, q as toBREP$1, u as transformCopy$1, w as getBounds, c as getWires } from "./shapeFns-DNxuGWvV.js";
69
+ import { x as x3, g as g10, f as f7, y as y3, h as h7, z as z5, A as A4, B as B6, C as C6, D as D3, E as E3 } from "./shapeFns-DNxuGWvV.js";
70
+ import { p as propagateFaceTags, a as propagateColors, c as cut$1, f as fuse$1, i as intersect$1, s as section$1, b as sectionToFace$1, d as slice$1, e as split$1, g as fuseAll, h as cutAll } from "./booleanFns-BnLhgDGb.js";
71
+ import { j as j6, k as k8, l as l6, m as m7, n as n7, o as o7, q as q4, r as r9, t as t8, u as u4 } from "./booleanFns-BnLhgDGb.js";
72
+ import { c as chamferDistAngle, h as heal$1, i as isValid$1 } from "./topology-XD2qFlgc.js";
73
+ import { a as a8, b as b9, e as e4, f as f8, d as d5, g as g11, j as j7, s as s4, t as t9, k as k9, l as l7, v as v5, w as w5 } from "./topology-XD2qFlgc.js";
74
74
  import { i as iterTopo, e as faceCenter, n as normalAt, j as fromBREP$1, k as innerWires, o as outerWire, g as getSurfaceType } from "./faceFns-DG4bu-QB.js";
75
75
  import { l as l8, c as c4, m as m8, d as d6, f as f9, q as q5, r as r10, s as s5, p as p6, t as t10, v as v6, u as u5, h as h8 } from "./faceFns-DG4bu-QB.js";
76
- import { m as mesh$1, a as meshEdges$1 } from "./meshFns-DJx5Yqiy.js";
77
- import { c as c5, b as b10, e as e5, d as d7, f as f10 } from "./meshFns-DJx5Yqiy.js";
76
+ import { m as mesh$1, a as meshEdges$1 } from "./meshFns-Diog9oLS.js";
77
+ import { c as c5, b as b10, e as e5, d as d7, f as f10 } from "./meshFns-Diog9oLS.js";
78
78
  import { m as measureArea, a as measureSurfaceProps, b as measureVolumeProps, c as measureVolume } from "./measurement-DzRb6oYN.js";
79
79
  import { d as d8, e as e6, f as f11, g as g12, h as h9, i as i6 } from "./measurement-DzRb6oYN.js";
80
- import { h as addHolesInFace, g as makeBezierCurve, k as makeBSplineApproximation, i as makeCircle, j as makeEllipse, f as makeEllipseArc, m as makeFace, n as makeNonPlanarFace, c as makeHelix, a as makeLine, o as makePolygon, l as makeNewFaceWithinFace, e as makeTangentArc, d as makeThreePointArc, b as assembleWire } from "./surfaceBuilders-zlVu1d-b.js";
81
- import { p as p7 } from "./surfaceBuilders-zlVu1d-b.js";
80
+ import { h as addHolesInFace, g as makeBezierCurve, k as makeBSplineApproximation, i as makeCircle, j as makeEllipse, f as makeEllipseArc, m as makeFace, n as makeNonPlanarFace, c as makeHelix, a as makeLine, o as makePolygon, l as makeNewFaceWithinFace, e as makeTangentArc, d as makeThreePointArc, b as assembleWire } from "./surfaceBuilders-DEd0HUri.js";
81
+ import { p as p7 } from "./surfaceBuilders-DEd0HUri.js";
82
82
  import { edgeFinder } from "./query.js";
83
83
  import { BrepBugError, bug } from "./result.js";
84
- import { c as c6 } from "./cornerFinder-DfSdXbxK.js";
84
+ import { c as c6 } from "./cornerFinder-BurQenn5.js";
85
85
  import { createOperationRegistry, createTaskQueue, createWorkerClient, createWorkerHandler, dequeueTask, enqueueTask, isDisposeRequest, isErrorResponse, isInitRequest, isOperationRequest, isQueueEmpty, isSuccessResponse, pendingCount, registerHandler, rejectAll } from "./worker.js";
86
86
  const errorFactories = {
87
87
  OCCT_OPERATION: (code, message, cause) => ({ kind: "OCCT_OPERATION", code, message, cause }),
@@ -213,6 +213,9 @@ function buildVertexFinder(filters) {
213
213
  function vertexFinder() {
214
214
  return buildVertexFinder([]);
215
215
  }
216
+ const REC601_R = 0.299;
217
+ const REC601_G = 0.587;
218
+ const REC601_B = 0.114;
216
219
  function surfaceFromGrid(heights, options = {}) {
217
220
  if (heights.length < 2) {
218
221
  return err(
@@ -258,10 +261,11 @@ function surfaceFromGrid(heights, options = {}) {
258
261
  }
259
262
  }
260
263
  function buildBSplineSurface(heights, rows, cols, dx, dy, scaleZ) {
261
- const oc = getKernel().oc;
262
- const OC = oc;
263
- const pntArray = new OC.TColgp_Array2OfPnt_2(1, rows, 1, cols);
264
+ var _stack = [];
264
265
  try {
266
+ const oc = getKernel().oc;
267
+ const scope = __using(_stack, new DisposalScope());
268
+ const pntArray = scope.register(new oc.TColgp_Array2OfPnt_2(1, rows, 1, cols));
265
269
  for (let r11 = 0; r11 < rows; r11++) {
266
270
  for (let c7 = 0; c7 < cols; c7++) {
267
271
  const row = heights[r11];
@@ -271,33 +275,24 @@ function buildBSplineSurface(heights, rows, cols, dx, dy, scaleZ) {
271
275
  pnt.delete();
272
276
  }
273
277
  }
274
- const fitter = new OC.GeomAPI_PointsToBSplineSurface_2(pntArray, 3, 8, 0, 1e-3);
278
+ const fitter = scope.register(new oc.GeomAPI_PointsToBSplineSurface_2(pntArray, 3, 8, 0, 1e-3));
275
279
  const surface = fitter.Surface();
276
- const faceMaker = new OC.BRepBuilderAPI_MakeFace_8(surface, 1e-6);
277
- let result;
280
+ const faceMaker = scope.register(new oc.BRepBuilderAPI_MakeFace_8(surface, 1e-6));
278
281
  if (faceMaker.IsDone()) {
279
282
  const shape2 = castShape(faceMaker.Face());
280
283
  if (isFace(shape2)) {
281
- result = ok(shape2);
282
- } else {
283
- shape2[Symbol.dispose]();
284
- result = err(
285
- occtError(BrepErrorCode.SURFACE_FAILED, "B-spline surface did not produce a face")
286
- );
284
+ return ok(shape2);
287
285
  }
288
- } else {
289
- result = err(
290
- occtError(
291
- BrepErrorCode.SURFACE_FAILED,
292
- "BRepBuilderAPI_MakeFace failed for B-spline surface"
293
- )
294
- );
286
+ shape2[Symbol.dispose]();
287
+ return err(occtError(BrepErrorCode.SURFACE_FAILED, "B-spline surface did not produce a face"));
295
288
  }
296
- faceMaker.delete();
297
- fitter.delete();
298
- return result;
289
+ return err(
290
+ occtError(BrepErrorCode.SURFACE_FAILED, "BRepBuilderAPI_MakeFace failed for B-spline surface")
291
+ );
292
+ } catch (_2) {
293
+ var _error = _2, _hasError = true;
299
294
  } finally {
300
- pntArray.delete();
295
+ __callDispose(_stack, _error, _hasError);
301
296
  }
302
297
  }
303
298
  function buildTriangulatedSurface(heights, rows, cols, dx, dy, scaleZ) {
@@ -426,7 +421,7 @@ async function surfaceFromImage(blob, options = {}) {
426
421
  value = b11 / 255;
427
422
  break;
428
423
  default:
429
- value = (0.299 * r11 + 0.587 * g13 + 0.114 * b11) / 255;
424
+ value = (REC601_R * r11 + REC601_G * g13 + REC601_B * b11) / 255;
430
425
  break;
431
426
  }
432
427
  row.push(value);
@@ -2473,7 +2468,7 @@ function isValid(shape2) {
2473
2468
  function isEmpty(shape2) {
2474
2469
  return isEmpty$1(resolve(shape2));
2475
2470
  }
2476
- function loft$1(wires, { ruled = true, startPoint, endPoint } = {}, returnShell = false) {
2471
+ function loft$1(wires, { ruled = true, startPoint, endPoint, tolerance = 1e-6 } = {}, returnShell = false) {
2477
2472
  var _stack = [];
2478
2473
  try {
2479
2474
  if (wires.length === 0 && !startPoint && !endPoint) {
@@ -2481,7 +2476,7 @@ function loft$1(wires, { ruled = true, startPoint, endPoint } = {}, returnShell
2481
2476
  }
2482
2477
  const oc = getKernel().oc;
2483
2478
  const scope = __using(_stack, new DisposalScope());
2484
- const builder = scope.register(new oc.BRepOffsetAPI_ThruSections(!returnShell, ruled, 1e-6));
2479
+ const builder = scope.register(new oc.BRepOffsetAPI_ThruSections(!returnShell, ruled, tolerance));
2485
2480
  if (startPoint) {
2486
2481
  const pnt = scope.register(toOcPnt(toVec3(startPoint)));
2487
2482
  const vMaker = scope.register(new oc.BRepBuilderAPI_MakeVertex(pnt));
@@ -1,4 +1,4 @@
1
- import { a as angle2d, s as samePoint, d as distance2d } from "./helpers-D7hTCTJm.js";
1
+ import { a as angle2d, s as samePoint, d as distance2d } from "./helpers-SajoWDKO.js";
2
2
  import { D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
3
3
  const PI_2 = 2 * Math.PI;
4
4
  function positiveHalfAngle(angle) {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const helpers = require("./helpers-Ces6b2wm.cjs");
2
+ const helpers = require("./helpers-DQGErXAX.cjs");
3
3
  const vecOps = require("./vecOps-CjRL1jau.cjs");
4
4
  const PI_2 = 2 * Math.PI;
5
5
  function positiveHalfAngle(angle) {
@@ -47,18 +47,18 @@ import { u as unwrap, g as isOk, e as err, x as validationError, l as ok } from
47
47
  import { r as resolvePlane, b as planeToWorld, d as planeToLocal } from "./vectors-Dp5Iu1KH.js";
48
48
  import { g as getKernel, a as toVec3, c as makeOcAx2 } from "./occtBoundary-Ct0tN8cs.js";
49
49
  import { n as vecScale, j as vecNormalize, v as vecAdd, o as vecSub, b as vecCross, m as vecRotate, R as RAD2DEG, g as vecLength, e as vecEquals, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
50
- import { b as Flatbush, c as convertSvgEllipseParams, d as defaultsSplineOptions, S as Sketch, r as roundedRectangleBlueprint, e as Blueprints, C as CompoundBlueprint, f as cut2D, i as intersectCurves, g as fuse2D, m as make2dOffset, h as filletCurves, j as chamferCurves, o as organiseBlueprints, a as BlueprintSketcher, k as intersect2D, B as BaseSketcher2d, p as polysidesBlueprint } from "./boolean2D-BG9wtSKz.js";
50
+ import { b as Flatbush, c as convertSvgEllipseParams, d as defaultsSplineOptions, S as Sketch, r as roundedRectangleBlueprint, e as Blueprints, C as CompoundBlueprint, f as cut2D, i as intersectCurves, g as fuse2D, m as make2dOffset, h as filletCurves, j as chamferCurves, o as organiseBlueprints, a as BlueprintSketcher, k as intersect2D, B as BaseSketcher2d, p as polysidesBlueprint } from "./boolean2D-CypPzZM1.js";
51
51
  import { d as downcast, c as cast, e as faceCenter, n as normalAt, o as outerWire } from "./faceFns-DG4bu-QB.js";
52
52
  import { c as curveTangentAt, a as curveEndPoint, b as getCurveType, o as offsetWire2D } from "./curveFns-VRW_cski.js";
53
- import { a as makeLine, d as makeThreePointArc, e as makeTangentArc, f as makeEllipseArc, g as makeBezierCurve, b as assembleWire, h as addHolesInFace, m as makeFace, i as makeCircle, j as makeEllipse, c as makeHelix, k as makeBSplineApproximation } from "./surfaceBuilders-zlVu1d-b.js";
53
+ import { a as makeLine, d as makeThreePointArc, e as makeTangentArc, f as makeEllipseArc, g as makeBezierCurve, b as assembleWire, h as addHolesInFace, m as makeFace, i as makeCircle, j as makeEllipse, c as makeHelix, k as makeBSplineApproximation } from "./surfaceBuilders-DEd0HUri.js";
54
54
  import { D as DisposalScope, q as createWire, s as createFace, e as isFace, c as castShape } from "./shapeTypes-D34s68Xi.js";
55
- import { m as mirror, B as Blueprint, C as Curve2D, a as make2dSegmentCurve, b as make2dArcFromCenter, c as approximateAsSvgCompatibleCurve, d as BoundingBox2d, e as edgeToCurve, f as make2dInerpolatedBSplineCurve, g as make2dCircle, h as make2dEllipse, i as deserializeCurve2D } from "./Blueprint-BWLPU0ZC.js";
55
+ import { m as mirror, B as Blueprint, C as Curve2D, a as make2dSegmentCurve, b as make2dArcFromCenter, c as approximateAsSvgCompatibleCurve, d as BoundingBox2d, e as edgeToCurve, f as make2dInerpolatedBSplineCurve, g as make2dCircle, h as make2dEllipse, i as deserializeCurve2D } from "./Blueprint-C7JlgasP.js";
56
56
  import { bug } from "./result.js";
57
- import { d as distance2d, p as polarAngle2d, f as polarToCartesian, P as PRECISION_OFFSET, h as squareDistance2d, s as samePoint$1, e as subtract2d, c as add2d } from "./helpers-D7hTCTJm.js";
58
- import { d as getEdges } from "./shapeFns-5HlS8wvc.js";
59
- import { m as makeCompound, b as basicFaceExtrusion, r as revolution, a as makeSolid, c as complexExtrude, t as twistExtrude } from "./loft-BpfrTPIR.js";
57
+ import { d as distance2d, p as polarAngle2d, f as polarToCartesian, P as PRECISION_OFFSET, h as squareDistance2d, s as samePoint$1, e as subtract2d, c as add2d } from "./helpers-SajoWDKO.js";
58
+ import { d as getEdges } from "./shapeFns-DNxuGWvV.js";
59
+ import { m as makeCompound, b as basicFaceExtrusion, r as revolution, a as makeSolid, c as complexExtrude, t as twistExtrude } from "./loft-CfKcU3Y1.js";
60
60
  import opentype from "opentype.js";
61
- import { c as cornerFinder } from "./cornerFinder-DfSdXbxK.js";
61
+ import { c as cornerFinder } from "./cornerFinder-BurQenn5.js";
62
62
  const stitchCurves = (curves, precision = 1e-7) => {
63
63
  const startPoints = new Flatbush(curves.length);
64
64
  curves.forEach((c) => {
@@ -48,18 +48,18 @@ const errors = require("./errors-BYb4tL5h.cjs");
48
48
  const vectors = require("./vectors-9rrStq8t.cjs");
49
49
  const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
50
50
  const vecOps = require("./vecOps-CjRL1jau.cjs");
51
- const boolean2D = require("./boolean2D-Bs_OdV2_.cjs");
51
+ const boolean2D = require("./boolean2D-KvkerCI-.cjs");
52
52
  const faceFns = require("./faceFns-B8xnZw-f.cjs");
53
53
  const curveFns = require("./curveFns-D0L3YcH-.cjs");
54
- const surfaceBuilders = require("./surfaceBuilders-zWnw2I0j.cjs");
54
+ const surfaceBuilders = require("./surfaceBuilders-DeFCNwZl.cjs");
55
55
  const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
56
- const Blueprint = require("./Blueprint-CIfiTx-y.cjs");
56
+ const Blueprint = require("./Blueprint-CTrwIDuQ.cjs");
57
57
  const result = require("./result.cjs");
58
- const helpers = require("./helpers-Ces6b2wm.cjs");
59
- const shapeFns = require("./shapeFns-CbZMmuQA.cjs");
60
- const loft = require("./loft-GLxTzuXU.cjs");
58
+ const helpers = require("./helpers-DQGErXAX.cjs");
59
+ const shapeFns = require("./shapeFns-D4MYB8um.cjs");
60
+ const loft = require("./loft-hhMumRtt.cjs");
61
61
  const opentype = require("opentype.js");
62
- const cornerFinder = require("./cornerFinder-BijsFhpz.cjs");
62
+ const cornerFinder = require("./cornerFinder-DLHDc022.cjs");
63
63
  const stitchCurves = (curves, precision = 1e-7) => {
64
64
  const startPoints = new boolean2D.Flatbush(curves.length);
65
65
  curves.forEach((c) => {
@@ -5,7 +5,7 @@ const errors = require("./errors-BYb4tL5h.cjs");
5
5
  const vecOps = require("./vecOps-CjRL1jau.cjs");
6
6
  const faceFns = require("./faceFns-B8xnZw-f.cjs");
7
7
  const measurement = require("./measurement-C4Ofuy_y.cjs");
8
- const shapeFns = require("./shapeFns-CbZMmuQA.cjs");
8
+ const shapeFns = require("./shapeFns-D4MYB8um.cjs");
9
9
  const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
10
10
  const PRECISION_INTERSECTION = 1e-9;
11
11
  const PRECISION_OFFSET = 1e-8;
@@ -4,7 +4,7 @@ import { e as err, q as queryError, l as ok, u as unwrap } from "./errors-CHfaHQ
4
4
  import { j as vecNormalize, d as vecDot, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
5
5
  import { i as iterTopo, d as downcast, g as getSurfaceType, n as normalAt } from "./faceFns-DG4bu-QB.js";
6
6
  import { m as measureArea } from "./measurement-DzRb6oYN.js";
7
- import { f as getHashCode, h as isSameShape } from "./shapeFns-5HlS8wvc.js";
7
+ import { f as getHashCode, h as isSameShape } from "./shapeFns-DNxuGWvV.js";
8
8
  import { g as getKernel, d as toOcPnt } from "./occtBoundary-Ct0tN8cs.js";
9
9
  const PRECISION_INTERSECTION = 1e-9;
10
10
  const PRECISION_OFFSET = 1e-8;
package/dist/io.cjs CHANGED
@@ -48,8 +48,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
48
48
  const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
49
49
  const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
50
50
  const errors = require("./errors-BYb4tL5h.cjs");
51
- const meshFns = require("./meshFns-BTb2esZJ.cjs");
52
- const Blueprint = require("./Blueprint-CIfiTx-y.cjs");
51
+ const meshFns = require("./meshFns-CfjNBqS6.cjs");
52
+ const Blueprint = require("./Blueprint-CTrwIDuQ.cjs");
53
53
  function vec3At(arr, i) {
54
54
  const off = i * 3;
55
55
  return [arr[off], arr[off + 1], arr[off + 2]];
package/dist/io.js CHANGED
@@ -46,8 +46,8 @@ var __callDispose = (stack, error, hasError) => {
46
46
  import { g as getKernel, o as uniqueId } from "./occtBoundary-Ct0tN8cs.js";
47
47
  import { D as DisposalScope, c as castShape } from "./shapeTypes-D34s68Xi.js";
48
48
  import { e as err, i as ioError, l as ok } from "./errors-CHfaHQSt.js";
49
- import { e, d, f } from "./meshFns-DJx5Yqiy.js";
50
- import { B as Blueprint, a as make2dSegmentCurve, l as make2dThreePointArc, q as make2dBezierCurve } from "./Blueprint-BWLPU0ZC.js";
49
+ import { e, d, f } from "./meshFns-Diog9oLS.js";
50
+ import { B as Blueprint, a as make2dSegmentCurve, l as make2dThreePointArc, q as make2dBezierCurve } from "./Blueprint-C7JlgasP.js";
51
51
  function vec3At(arr, i) {
52
52
  const off = i * 3;
53
53
  return [arr[off], arr[off + 1], arr[off + 2]];
@@ -48,7 +48,7 @@ import { D as DEG2RAD, v as vecAdd, g as vecLength } from "./vecOps-ZDdZWbwT.js"
48
48
  import { c as cast, d as downcast, a as isShape3D$1, b as isWire } from "./faceFns-DG4bu-QB.js";
49
49
  import { e as err, x as validationError, l as ok, u as unwrap, p as typeCastError, a as andThen, o as occtError } from "./errors-CHfaHQSt.js";
50
50
  import { D as DisposalScope, k as isShell, t as createCompound, u as createVertex, v as createSolid, j as isShape3D, l as isSolid } from "./shapeTypes-D34s68Xi.js";
51
- import { a as makeLine, b as assembleWire, c as makeHelix } from "./surfaceBuilders-zlVu1d-b.js";
51
+ import { a as makeLine, b as assembleWire, c as makeHelix } from "./surfaceBuilders-DEd0HUri.js";
52
52
  function buildLawFromProfile(extrusionLength, { profile, endFactor = 1 }) {
53
53
  var _stack = [];
54
54
  try {
@@ -49,7 +49,7 @@ const vecOps = require("./vecOps-CjRL1jau.cjs");
49
49
  const faceFns = require("./faceFns-B8xnZw-f.cjs");
50
50
  const errors = require("./errors-BYb4tL5h.cjs");
51
51
  const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
52
- const surfaceBuilders = require("./surfaceBuilders-zWnw2I0j.cjs");
52
+ const surfaceBuilders = require("./surfaceBuilders-DeFCNwZl.cjs");
53
53
  function buildLawFromProfile(extrusionLength, { profile, endFactor = 1 }) {
54
54
  var _stack = [];
55
55
  try {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const occtBoundary = require("./occtBoundary-CN_uQJtA.cjs");
3
3
  const errors = require("./errors-BYb4tL5h.cjs");
4
- const shapeFns = require("./shapeFns-CbZMmuQA.cjs");
4
+ const shapeFns = require("./shapeFns-D4MYB8um.cjs");
5
5
  function buildMeshCacheKey(tolerance, angularTolerance, skipNormals) {
6
6
  return `${tolerance}:${angularTolerance}:${skipNormals}`;
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import { g as getKernel, u as uniqueIOFilename } from "./occtBoundary-Ct0tN8cs.js";
2
2
  import { l as ok, e as err, i as ioError } from "./errors-CHfaHQSt.js";
3
- import { g as getFaceOrigins } from "./shapeFns-5HlS8wvc.js";
3
+ import { g as getFaceOrigins } from "./shapeFns-DNxuGWvV.js";
4
4
  function buildMeshCacheKey(tolerance, angularTolerance, skipNormals) {
5
5
  return `${tolerance}:${angularTolerance}:${skipNormals}`;
6
6
  }
@@ -9,6 +9,8 @@ export interface LoftOptions {
9
9
  startPoint?: PointInput;
10
10
  /** Optional end vertex after the last wire profile. */
11
11
  endPoint?: PointInput;
12
+ /** Sewing tolerance for ThruSections builder. Defaults to `1e-6`. */
13
+ tolerance?: number;
12
14
  }
13
15
  /**
14
16
  * Loft through a set of wire profiles to create a 3D shape.
@@ -29,5 +31,5 @@ export interface LoftOptions {
29
31
  *
30
32
  * @see {@link loft!loft | loft} for the OOP API equivalent.
31
33
  */
32
- export declare function loft(wires: Wire[], { ruled, startPoint, endPoint }?: LoftOptions, returnShell?: boolean): Result<Shape3D>;
34
+ export declare function loft(wires: Wire[], { ruled, startPoint, endPoint, tolerance }?: LoftOptions, returnShell?: boolean): Result<Shape3D>;
33
35
  //# sourceMappingURL=loftFns.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loftFns.d.ts","sourceRoot":"","sources":["../../src/operations/loftFns.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAGzD,uDAAuD;AACvD,MAAM,WAAW,WAAW;IAC1B,+EAA+E;IAC/E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,IAAI,CAClB,KAAK,EAAE,IAAI,EAAE,EACb,EAAE,KAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAE,WAAgB,EACxD,WAAW,UAAQ,GAClB,MAAM,CAAC,OAAO,CAAC,CAoCjB"}
1
+ {"version":3,"file":"loftFns.d.ts","sourceRoot":"","sources":["../../src/operations/loftFns.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAG3D,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,mBAAmB,CAAC;AAGzD,uDAAuD;AACvD,MAAM,WAAW,WAAW;IAC1B,+EAA+E;IAC/E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,IAAI,CAClB,KAAK,EAAE,IAAI,EAAE,EACb,EAAE,KAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAgB,EAAE,GAAE,WAAgB,EAC1E,WAAW,UAAQ,GAClB,MAAM,CAAC,OAAO,CAAC,CAoCjB"}
@@ -48,8 +48,8 @@ import { g as vecLength, v as vecAdd, D as DEG2RAD, f as vecIsZero, j as vecNorm
48
48
  import { b as createOcHandle, c as castShape, j as isShape3D, D as DisposalScope, n as isWire, v as createSolid } from "./shapeTypes-D34s68Xi.js";
49
49
  import { d as downcast } from "./faceFns-DG4bu-QB.js";
50
50
  import { e as err, x as validationError, u as unwrap, p as typeCastError, l as ok, B as BrepErrorCode, d as isErr, o as occtError, i as ioError, b as computationError } from "./errors-CHfaHQSt.js";
51
- import { n as buildLawFromProfile } from "./loft-BpfrTPIR.js";
52
- import { g as fuseAll } from "./booleanFns-DHEaBJwW.js";
51
+ import { n as buildLawFromProfile } from "./loft-CfKcU3Y1.js";
52
+ import { g as fuseAll } from "./booleanFns-BnLhgDGb.js";
53
53
  function uuidv() {
54
54
  return (String([1e7]) + String(-1e3) + String(-4e3) + String(-8e3) + String(-1e11)).replace(
55
55
  /[018]/g,
@@ -49,8 +49,8 @@ const vecOps = require("./vecOps-CjRL1jau.cjs");
49
49
  const shapeTypes = require("./shapeTypes-sXITvFkF.cjs");
50
50
  const faceFns = require("./faceFns-B8xnZw-f.cjs");
51
51
  const errors = require("./errors-BYb4tL5h.cjs");
52
- const loft = require("./loft-GLxTzuXU.cjs");
53
- const booleanFns = require("./booleanFns-CUxOBNlC.cjs");
52
+ const loft = require("./loft-hhMumRtt.cjs");
53
+ const booleanFns = require("./booleanFns-DEY86xmR.cjs");
54
54
  function uuidv() {
55
55
  return (String([1e7]) + String(-1e3) + String(-4e3) + String(-8e3) + String(-1e11)).replace(
56
56
  /[018]/g,