brepjs 12.7.2 → 12.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/2d.cjs +2 -2
  2. package/dist/2d.js +11 -11
  3. package/dist/{Blueprint-DymoCs1R.js → Blueprint-C3lWY1Jf.js} +21 -20
  4. package/dist/{Blueprint-E105uFXu.cjs → Blueprint-CnDVffSX.cjs} +2 -1
  5. package/dist/{boolean2D-BXO2hNfY.js → boolean2D-CwZAIJDS.js} +15 -17
  6. package/dist/{boolean2D-D857dStk.cjs → boolean2D-DyQJt8Na.cjs} +2 -4
  7. package/dist/{booleanFns-DpAod1nu.js → booleanFns-CcNUsgI8.js} +2 -2
  8. package/dist/{booleanFns-DeWK-2pA.cjs → booleanFns-D7HmkpYt.cjs} +1 -1
  9. package/dist/brepjs.cjs +37 -108
  10. package/dist/brepjs.js +935 -1006
  11. package/dist/core.cjs +1 -1
  12. package/dist/core.js +1 -1
  13. package/dist/{cornerFinder-xxlrRbwc.js → cornerFinder-BV-l1BCw.js} +1 -1
  14. package/dist/{curveFns-LRNGcHXh.js → curveFns-CloOqAQ_.js} +11 -11
  15. package/dist/{drawFns-ClKmj3al.js → drawFns-5myJTgtX.js} +68 -324
  16. package/dist/{drawFns-BKU3X1Qn.cjs → drawFns-CDNafQhv.cjs} +61 -317
  17. package/dist/{helpers-Dnw_sLuU.js → helpers-C9KvE1RW.js} +5 -5
  18. package/dist/io.cjs +1 -1
  19. package/dist/io.js +1 -1
  20. package/dist/kernel/brepkitAdapter.d.ts.map +1 -1
  21. package/dist/kernel/brepkitWasmTypes.d.ts +11 -1
  22. package/dist/kernel/brepkitWasmTypes.d.ts.map +1 -1
  23. package/dist/{loft-DsVv4yxU.js → loft-BcZUCGKi.js} +1 -1
  24. package/dist/{operations-DXt8hFxd.cjs → operations-DLFzmdFX.cjs} +1 -1
  25. package/dist/{operations-DE9wMwvN.js → operations-Dcz6YlOt.js} +2 -2
  26. package/dist/operations.cjs +1 -1
  27. package/dist/operations.js +2 -2
  28. package/dist/query.js +4 -4
  29. package/dist/sketching/Sketcher.d.ts +31 -77
  30. package/dist/sketching/Sketcher.d.ts.map +1 -1
  31. package/dist/sketching/Sketcher2d.d.ts +1 -1
  32. package/dist/sketching/Sketcher2d.d.ts.map +1 -1
  33. package/dist/sketching/draw.d.ts +2 -2
  34. package/dist/sketching/draw.d.ts.map +1 -1
  35. package/dist/sketching/sketcherlib.d.ts +32 -1
  36. package/dist/sketching/sketcherlib.d.ts.map +1 -1
  37. package/dist/sketching.cjs +2 -2
  38. package/dist/sketching.js +2 -2
  39. package/dist/{surfaceBuilders-D7ZH2QNS.js → surfaceBuilders-D6iDVPIM.js} +12 -12
  40. package/dist/{topology-Is3aThTo.cjs → topology-CKtCGLmb.cjs} +1 -1
  41. package/dist/{topology-DEi2sFry.js → topology-DxD58iQ6.js} +3 -3
  42. package/dist/topology.cjs +2 -2
  43. package/dist/topology.js +14 -14
  44. package/dist/{vectors-TlfO1hu2.cjs → vectors-BafmMf96.cjs} +0 -5
  45. package/dist/{vectors-cec8p8NQ.js → vectors-CESkzEm6.js} +1 -6
  46. package/dist/vectors.cjs +1 -1
  47. package/dist/vectors.js +1 -1
  48. package/package.json +3 -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-E105uFXu.cjs");
4
- const boolean2D = require("./boolean2D-D857dStk.cjs");
3
+ const Blueprint = require("./Blueprint-CnDVffSX.cjs");
4
+ const boolean2D = require("./boolean2D-DyQJt8Na.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-DymoCs1R.js";
2
- import { d, C } from "./Blueprint-DymoCs1R.js";
3
- import { e, C as C2, f, l, g, n, k, q, o, p, r } from "./boolean2D-BXO2hNfY.js";
1
+ import { B as Blueprint } from "./Blueprint-C3lWY1Jf.js";
2
+ import { e, C } from "./Blueprint-C3lWY1Jf.js";
3
+ import { c, C as C2, d, j, f, k, h, l, o, p, r } from "./boolean2D-CwZAIJDS.js";
4
4
  function reverseCurve(curve) {
5
5
  const cloned = curve.clone();
6
6
  cloned.reverse();
@@ -68,8 +68,8 @@ function sketch2DOnFace(bp, face, scaleMode) {
68
68
  }
69
69
  export {
70
70
  Blueprint,
71
- e as Blueprints,
72
- d as BoundingBox2d,
71
+ c as Blueprints,
72
+ e as BoundingBox2d,
73
73
  C2 as CompoundBlueprint,
74
74
  C as Curve2D,
75
75
  createBlueprint,
@@ -81,14 +81,14 @@ export {
81
81
  curve2dParameter,
82
82
  curve2dSplitAt,
83
83
  curve2dTangentAt,
84
- f as cut2D,
85
- l as cutBlueprints,
86
- g as fuse2D,
87
- n as fuseBlueprints,
84
+ d as cut2D,
85
+ j as cutBlueprints,
86
+ f as fuse2D,
87
+ k as fuseBlueprints,
88
88
  getBounds2D,
89
89
  getOrientation2D,
90
- k as intersect2D,
91
- q as intersectBlueprints,
90
+ h as intersect2D,
91
+ l as intersectBlueprints,
92
92
  isInside2D,
93
93
  mirror2D,
94
94
  o as organiseBlueprints,
@@ -1,12 +1,12 @@
1
- import { r as resolvePlane } from "./vectors-cec8p8NQ.js";
1
+ import { r as resolvePlane } from "./vectors-CESkzEm6.js";
2
2
  import { a as toVec3 } from "./types-CWDdqcrq.js";
3
3
  import { B as getKernel, J as getKernel2D, K as registerForCleanup, L as unregisterFromCleanup, H as createEdge, G as createWire } from "./shapeTypes-CpSaBLDv.js";
4
4
  import { u as uvBounds, f as faceGeomType, e as faceCenter, h as uvCoordinates, c as cast } from "./faceFns-B6ebRh5I.js";
5
- import { g as getOrientation } from "./curveFns-LRNGcHXh.js";
5
+ import { g as getOrientation } from "./curveFns-CloOqAQ_.js";
6
6
  import { o as ok, e as err, b as computationError, r as unwrap, y as validationError } from "./errors-B7kgv0cd.js";
7
- import { d as distance2d, s as samePoint, b as scalarMultiply2d, c as add2d, e as subtract2d, g as getSingleFace } from "./helpers-Dnw_sLuU.js";
7
+ import { d as distance2d, s as samePoint, b as scalarMultiply2d, c as add2d, e as subtract2d, g as getSingleFace } from "./helpers-C9KvE1RW.js";
8
8
  import { R as RAD2DEG, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
9
- import { m as makeFace } from "./surfaceBuilders-D7ZH2QNS.js";
9
+ import { m as makeFace } from "./surfaceBuilders-D6iDVPIM.js";
10
10
  import { bug } from "./result.js";
11
11
  function makePlane(plane, origin) {
12
12
  if (plane && typeof plane !== "string") {
@@ -982,23 +982,24 @@ export {
982
982
  Curve2D as C,
983
983
  make2dSegmentCurve as a,
984
984
  make2dArcFromCenter as b,
985
- approximateAsSvgCompatibleCurve as c,
986
- BoundingBox2d as d,
987
- edgeToCurve as e,
988
- make2dInerpolatedBSplineCurve as f,
989
- make2dCircle as g,
990
- make2dEllipse as h,
991
- deserializeCurve2D as i,
992
- approximateAsBSpline as j,
993
- isPoint2D as k,
994
- make2dThreePointArc as l,
985
+ curvesAsEdgesOnPlane as c,
986
+ approximateAsSvgCompatibleCurve as d,
987
+ BoundingBox2d as e,
988
+ edgeToCurve as f,
989
+ make2dInerpolatedBSplineCurve as g,
990
+ make2dCircle as h,
991
+ make2dEllipse as i,
992
+ deserializeCurve2D as j,
993
+ approximateAsBSpline as k,
994
+ isPoint2D as l,
995
995
  mirror as m,
996
996
  normalize2d as n,
997
- asSVG as o,
998
- make2dEllipseArc as p,
999
- make2dTangentArc as q,
1000
- make2dBezierCurve as r,
1001
- removeDuplicatePoints as s,
1002
- makePlane as t,
997
+ make2dThreePointArc as o,
998
+ asSVG as p,
999
+ make2dEllipseArc as q,
1000
+ make2dTangentArc as r,
1001
+ make2dBezierCurve as s,
1002
+ removeDuplicatePoints as t,
1003
+ makePlane as u,
1003
1004
  viewbox as v
1004
1005
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const vectors = require("./vectors-TlfO1hu2.cjs");
2
+ const vectors = require("./vectors-BafmMf96.cjs");
3
3
  const types = require("./types-CA_xrgDq.cjs");
4
4
  const shapeTypes = require("./shapeTypes-7xEam9Ri.cjs");
5
5
  const faceFns = require("./faceFns-BLTEPBKq.cjs");
@@ -984,6 +984,7 @@ exports.Curve2D = Curve2D;
984
984
  exports.approximateAsBSpline = approximateAsBSpline;
985
985
  exports.approximateAsSvgCompatibleCurve = approximateAsSvgCompatibleCurve;
986
986
  exports.asSVG = asSVG;
987
+ exports.curvesAsEdgesOnPlane = curvesAsEdgesOnPlane;
987
988
  exports.deserializeCurve2D = deserializeCurve2D;
988
989
  exports.edgeToCurve = edgeToCurve;
989
990
  exports.isPoint2D = isPoint2D;
@@ -43,18 +43,18 @@ var __callDispose = (stack, error, hasError) => {
43
43
  };
44
44
  return next();
45
45
  };
46
- import { a as createPlane } from "./vectors-cec8p8NQ.js";
46
+ import { a as createPlane } from "./vectors-CESkzEm6.js";
47
47
  import { o as ok, e as err, b as computationError, r as unwrap, g as isOk } from "./errors-B7kgv0cd.js";
48
48
  import { d as downcast, u as uvBounds, p as pointOnSurface, n as normalAt } from "./faceFns-B6ebRh5I.js";
49
49
  import { a as toVec3 } from "./types-CWDdqcrq.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-DsVv4yxU.js";
51
+ import { r as revolution, c as complexExtrude, t as twistExtrude, b as basicFaceExtrusion, g as genericSweep, l as loft } from "./loft-BcZUCGKi.js";
52
52
  import { J as getKernel2D, I as createFace, G as createWire, B as getKernel, H as createEdge, D as DisposalScope } from "./shapeTypes-CpSaBLDv.js";
53
- import { d as curveStartPoint, c as curveTangentAt, e as curveIsClosed } from "./curveFns-LRNGcHXh.js";
54
- import { m as makeFace, l as makeNewFaceWithinFace, b as assembleWire, z as zip } from "./surfaceBuilders-D7ZH2QNS.js";
53
+ import { c as curveStartPoint, a as curveTangentAt, b as curveIsClosed } from "./curveFns-CloOqAQ_.js";
54
+ import { m as makeFace, h as makeNewFaceWithinFace, b as assembleWire, z as zip } from "./surfaceBuilders-D6iDVPIM.js";
55
55
  import { bug } from "./result.js";
56
- import { s as samePoint$1, 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-Dnw_sLuU.js";
57
- import { C as Curve2D, a as make2dSegmentCurve, j as approximateAsBSpline, n as normalize2d, b as make2dArcFromCenter, k as isPoint2D, g as make2dCircle, l as make2dThreePointArc, d as BoundingBox2d, v as viewbox, o as asSVG, B as Blueprint, p as make2dEllipseArc, q as make2dTangentArc, r as make2dBezierCurve, s as removeDuplicatePoints } from "./Blueprint-DymoCs1R.js";
56
+ import { s as samePoint$1, e as subtract2d, c as add2d, h as crossProduct2d, b as scalarMultiply2d, p as polarToCartesian, r as rotate2d, i as cartesianToPolar, d as distance2d, j as polarAngle2d, k as PRECISION_INTERSECTION } from "./helpers-C9KvE1RW.js";
57
+ import { C as Curve2D, a as make2dSegmentCurve, k as approximateAsBSpline, n as normalize2d, b as make2dArcFromCenter, l as isPoint2D, h as make2dCircle, o as make2dThreePointArc, e as BoundingBox2d, v as viewbox, p as asSVG, B as Blueprint, q as make2dEllipseArc, r as make2dTangentArc, s as make2dBezierCurve, t as removeDuplicatePoints } from "./Blueprint-C3lWY1Jf.js";
58
58
  const intersectCurves = (first, second, precision = 1e-9) => {
59
59
  if (first.boundingBox.isOut(second.boundingBox))
60
60
  return ok({ intersections: [], commonSegments: [], commonSegmentsPoints: [] });
@@ -2465,20 +2465,18 @@ export {
2465
2465
  Sketch as S,
2466
2466
  BlueprintSketcher as a,
2467
2467
  Flatbush as b,
2468
- convertSvgEllipseParams as c,
2469
- defaultsSplineOptions as d,
2470
- Blueprints as e,
2471
- cut2D as f,
2472
- fuse2D as g,
2473
- filletCurves as h,
2468
+ Blueprints as c,
2469
+ cut2D as d,
2470
+ filletCurves as e,
2471
+ fuse2D as f,
2472
+ chamferCurves as g,
2473
+ intersect2D as h,
2474
2474
  intersectCurves as i,
2475
- chamferCurves as j,
2476
- intersect2D as k,
2477
- cutBlueprints as l,
2475
+ cutBlueprints as j,
2476
+ fuseBlueprints as k,
2477
+ intersectBlueprints as l,
2478
2478
  make2dOffset as m,
2479
- fuseBlueprints as n,
2480
2479
  organiseBlueprints as o,
2481
2480
  polysidesBlueprint as p,
2482
- intersectBlueprints as q,
2483
2481
  roundedRectangleBlueprint as r
2484
2482
  };
@@ -44,7 +44,7 @@ var __callDispose = (stack, error, hasError) => {
44
44
  };
45
45
  return next();
46
46
  };
47
- const vectors = require("./vectors-TlfO1hu2.cjs");
47
+ const vectors = require("./vectors-BafmMf96.cjs");
48
48
  const errors = require("./errors-9fDehDNc.cjs");
49
49
  const faceFns = require("./faceFns-BLTEPBKq.cjs");
50
50
  const types = require("./types-CA_xrgDq.cjs");
@@ -55,7 +55,7 @@ const curveFns = require("./curveFns-Ch87sD5O.cjs");
55
55
  const surfaceBuilders = require("./surfaceBuilders-Be_ENWSA.cjs");
56
56
  const result = require("./result.cjs");
57
57
  const helpers = require("./helpers-6kn30cSD.cjs");
58
- const Blueprint = require("./Blueprint-E105uFXu.cjs");
58
+ const Blueprint = require("./Blueprint-CnDVffSX.cjs");
59
59
  const intersectCurves = (first, second, precision = 1e-9) => {
60
60
  if (first.boundingBox.isOut(second.boundingBox))
61
61
  return errors.ok({ intersections: [], commonSegments: [], commonSegmentsPoints: [] });
@@ -2467,10 +2467,8 @@ exports.FaceSketcher = FaceSketcher;
2467
2467
  exports.Flatbush = Flatbush;
2468
2468
  exports.Sketch = Sketch;
2469
2469
  exports.chamferCurves = chamferCurves;
2470
- exports.convertSvgEllipseParams = convertSvgEllipseParams;
2471
2470
  exports.cut2D = cut2D;
2472
2471
  exports.cutBlueprints = cutBlueprints;
2473
- exports.defaultsSplineOptions = defaultsSplineOptions;
2474
2472
  exports.filletCurves = filletCurves;
2475
2473
  exports.fuse2D = fuse2D;
2476
2474
  exports.fuseBlueprints = fuseBlueprints;
@@ -1,9 +1,9 @@
1
1
  import { B as getKernel, c as castShape, p as isShape3D } from "./shapeTypes-CpSaBLDv.js";
2
2
  import { o as ok, d as isErr, e as err, y as validationError, B as BrepErrorCode, p as typeCastError, k as kernelError } from "./errors-B7kgv0cd.js";
3
- import { r as resolvePlane } from "./vectors-cec8p8NQ.js";
3
+ import { r as resolvePlane } from "./vectors-CESkzEm6.js";
4
4
  import { H as HASH_CODE_MAX, n as vecScale, v as vecAdd } from "./vecOps-ZDdZWbwT.js";
5
5
  import { a as getFaces, p as propagateOriginsByHash, b as propagateOriginsFromEvolution, c as getWires, d as getEdges, e as getVertices, g as getFaceOrigins } from "./shapeFns-D2PlLFE6.js";
6
- import { m as makeFace } from "./surfaceBuilders-D7ZH2QNS.js";
6
+ import { m as makeFace } from "./surfaceBuilders-D6iDVPIM.js";
7
7
  const shapeTagStore = /* @__PURE__ */ new WeakMap();
8
8
  const tagMetadataStore = /* @__PURE__ */ new WeakMap();
9
9
  function hasFaceTags(shape) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const shapeTypes = require("./shapeTypes-7xEam9Ri.cjs");
3
3
  const errors = require("./errors-9fDehDNc.cjs");
4
- const vectors = require("./vectors-TlfO1hu2.cjs");
4
+ const vectors = require("./vectors-BafmMf96.cjs");
5
5
  const vecOps = require("./vecOps-CjRL1jau.cjs");
6
6
  const shapeFns = require("./shapeFns-D-MOoqJd.cjs");
7
7
  const surfaceBuilders = require("./surfaceBuilders-Be_ENWSA.cjs");
package/dist/brepjs.cjs CHANGED
@@ -48,19 +48,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
48
48
  const shapeTypes = require("./shapeTypes-7xEam9Ri.cjs");
49
49
  const errors = require("./errors-9fDehDNc.cjs");
50
50
  const vecOps = require("./vecOps-CjRL1jau.cjs");
51
- const Blueprint = require("./Blueprint-E105uFXu.cjs");
51
+ const Blueprint = require("./Blueprint-CnDVffSX.cjs");
52
52
  const loft$2 = require("./loft-DR1UN5uN.cjs");
53
- const operations = require("./operations-DXt8hFxd.cjs");
54
- const boolean2D = require("./boolean2D-D857dStk.cjs");
53
+ const operations = require("./operations-DLFzmdFX.cjs");
54
+ const boolean2D = require("./boolean2D-DyQJt8Na.cjs");
55
55
  const _2d = require("./2d.cjs");
56
56
  const helpers = require("./helpers-6kn30cSD.cjs");
57
57
  const io = require("./io.cjs");
58
- const drawFns = require("./drawFns-BKU3X1Qn.cjs");
58
+ const drawFns = require("./drawFns-CDNafQhv.cjs");
59
59
  const types = require("./types-CA_xrgDq.cjs");
60
- const vectors = require("./vectors-TlfO1hu2.cjs");
60
+ const vectors = require("./vectors-BafmMf96.cjs");
61
61
  const shapeFns = require("./shapeFns-D-MOoqJd.cjs");
62
- const booleanFns = require("./booleanFns-DeWK-2pA.cjs");
63
- const topology = require("./topology-Is3aThTo.cjs");
62
+ const booleanFns = require("./booleanFns-D7HmkpYt.cjs");
63
+ const topology = require("./topology-CKtCGLmb.cjs");
64
64
  const curveFns = require("./curveFns-Ch87sD5O.cjs");
65
65
  const faceFns = require("./faceFns-BLTEPBKq.cjs");
66
66
  const meshFns = require("./meshFns-3gy0empP.cjs");
@@ -1203,40 +1203,21 @@ class BrepkitAdapter {
1203
1203
  p1[1] + ccx * ux[1] + ccy * uy[1],
1204
1204
  p1[2] + ccx * ux[2] + ccy * uy[2]
1205
1205
  ];
1206
- const radius = Math.sqrt(
1207
- (p1[0] - center[0]) ** 2 + (p1[1] - center[1]) ** 2 + (p1[2] - center[2]) ** 2
1206
+ const id = this.bk.makeCircleArc3d(
1207
+ p1[0],
1208
+ p1[1],
1209
+ p1[2],
1210
+ p3[0],
1211
+ p3[1],
1212
+ p3[2],
1213
+ center[0],
1214
+ center[1],
1215
+ center[2],
1216
+ nz[0],
1217
+ nz[1],
1218
+ nz[2]
1208
1219
  );
1209
- if (typeof this.bk.makeCircleArc3d === "function") {
1210
- const id = this.bk.makeCircleArc3d(
1211
- p1[0],
1212
- p1[1],
1213
- p1[2],
1214
- p3[0],
1215
- p3[1],
1216
- p3[2],
1217
- center[0],
1218
- center[1],
1219
- center[2],
1220
- nz[0],
1221
- nz[1],
1222
- nz[2]
1223
- );
1224
- return edgeHandle(id);
1225
- }
1226
- const lx = [p1[0] - center[0], p1[1] - center[1], p1[2] - center[2]];
1227
- const lxLen = Math.sqrt(lx[0] ** 2 + lx[1] ** 2 + lx[2] ** 2);
1228
- const uxA = [lx[0] / lxLen, lx[1] / lxLen, lx[2] / lxLen];
1229
- const uyA = [
1230
- nz[1] * uxA[2] - nz[2] * uxA[1],
1231
- nz[2] * uxA[0] - nz[0] * uxA[2],
1232
- nz[0] * uxA[1] - nz[1] * uxA[0]
1233
- ];
1234
- const v3f = [p3[0] - center[0], p3[1] - center[1], p3[2] - center[2]];
1235
- const dotX = v3f[0] * uxA[0] + v3f[1] * uxA[1] + v3f[2] * uxA[2];
1236
- const dotY = v3f[0] * uyA[0] + v3f[1] * uyA[1] + v3f[2] * uyA[2];
1237
- let endAngle = Math.atan2(dotY, dotX);
1238
- if (endAngle <= 0) endAngle += 2 * Math.PI;
1239
- return this.makeCircleNurbs(center, normal, radius, 0, endAngle);
1220
+ return edgeHandle(id);
1240
1221
  }
1241
1222
  makeEllipseEdge(center, normal, majorRadius, minorRadius, xDir) {
1242
1223
  return this.makeEllipseNurbs(center, normal, majorRadius, minorRadius, 0, 2 * Math.PI, xDir);
@@ -1276,73 +1257,21 @@ class BrepkitAdapter {
1276
1257
  return edgeHandle(id);
1277
1258
  }
1278
1259
  makeTangentArc(startPoint, startTangent, endPoint) {
1279
- const tLen = Math.sqrt(startTangent[0] ** 2 + startTangent[1] ** 2 + startTangent[2] ** 2);
1280
- if (tLen < 1e-12) return this.makeLineEdge(startPoint, endPoint);
1281
- const t = [
1282
- startTangent[0] / tLen,
1283
- startTangent[1] / tLen,
1284
- startTangent[2] / tLen
1285
- ];
1286
- const ch = [
1287
- startPoint[0] - endPoint[0],
1288
- startPoint[1] - endPoint[1],
1289
- startPoint[2] - endPoint[2]
1290
- ];
1291
- const chDotT = ch[0] * t[0] + ch[1] * t[1] + ch[2] * t[2];
1292
- const perp = [
1293
- ch[0] - chDotT * t[0],
1294
- ch[1] - chDotT * t[1],
1295
- ch[2] - chDotT * t[2]
1296
- ];
1297
- const perpLen = Math.sqrt(perp[0] ** 2 + perp[1] ** 2 + perp[2] ** 2);
1298
- if (perpLen < 1e-12) return this.makeLineEdge(startPoint, endPoint);
1299
- const n = [perp[0] / perpLen, perp[1] / perpLen, perp[2] / perpLen];
1300
- const chord2 = ch[0] ** 2 + ch[1] ** 2 + ch[2] ** 2;
1301
- const nDotCh = n[0] * ch[0] + n[1] * ch[1] + n[2] * ch[2];
1302
- const s = -chord2 / (2 * nDotCh);
1303
- const center = [
1304
- startPoint[0] + s * n[0],
1305
- startPoint[1] + s * n[1],
1306
- startPoint[2] + s * n[2]
1307
- ];
1308
- const radius = Math.abs(s);
1309
- const e1 = [
1310
- (startPoint[0] - center[0]) / radius,
1311
- (startPoint[1] - center[1]) / radius,
1312
- (startPoint[2] - center[2]) / radius
1313
- ];
1314
- const e2 = [
1315
- (endPoint[0] - center[0]) / radius,
1316
- (endPoint[1] - center[1]) / radius,
1317
- (endPoint[2] - center[2]) / radius
1318
- ];
1319
- let mx = e1[0] + e2[0];
1320
- let my = e1[1] + e2[1];
1321
- let mz = e1[2] + e2[2];
1322
- let mLen = Math.sqrt(mx * mx + my * my + mz * mz);
1323
- if (mLen < 1e-12) {
1324
- mx = t[0];
1325
- my = t[1];
1326
- mz = t[2];
1327
- mLen = 1;
1328
- }
1329
- const mid = [
1330
- center[0] + radius * mx / mLen,
1331
- center[1] + radius * my / mLen,
1332
- center[2] + radius * mz / mLen
1333
- ];
1334
- const toMid = [
1335
- mid[0] - startPoint[0],
1336
- mid[1] - startPoint[1],
1337
- mid[2] - startPoint[2]
1338
- ];
1339
- const dotTM = t[0] * toMid[0] + t[1] * toMid[1] + t[2] * toMid[2];
1340
- if (dotTM < 0) {
1341
- mid[0] = center[0] - radius * mx / mLen;
1342
- mid[1] = center[1] - radius * my / mLen;
1343
- mid[2] = center[2] - radius * mz / mLen;
1344
- }
1345
- return this.makeArcEdge(startPoint, mid, endPoint);
1260
+ if (!this.bk.makeTangentArc3d) {
1261
+ throw new Error("makeTangentArc requires brepkit-wasm >= 1.1.0");
1262
+ }
1263
+ const id = this.bk.makeTangentArc3d(
1264
+ startPoint[0],
1265
+ startPoint[1],
1266
+ startPoint[2],
1267
+ startTangent[0],
1268
+ startTangent[1],
1269
+ startTangent[2],
1270
+ endPoint[0],
1271
+ endPoint[1],
1272
+ endPoint[2]
1273
+ );
1274
+ return edgeHandle(id);
1346
1275
  }
1347
1276
  makeHelixWire(pitch, height, radius, center, _direction, leftHanded) {
1348
1277
  const turns = height / pitch;
@@ -2150,7 +2079,7 @@ class BrepkitAdapter {
2150
2079
  if (bkHandle.type !== "solid") {
2151
2080
  return { lines: new Float32Array(0), edgeGroups: [] };
2152
2081
  }
2153
- const edgeLines = this.bk.meshEdges(bkHandle.id, tolerance);
2082
+ const edgeLines = this.bk.meshEdgesAll ? this.bk.meshEdgesAll(bkHandle.id, tolerance) : this.bk.meshEdges(bkHandle.id, tolerance);
2154
2083
  const positions = edgeLines.positions;
2155
2084
  const offsets = edgeLines.offsets;
2156
2085
  const edgeCount = edgeLines.edgeCount;