brepjs 12.7.1 → 12.7.3

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 (61) hide show
  1. package/dist/2d.cjs +2 -2
  2. package/dist/2d.js +11 -11
  3. package/dist/{Blueprint-CtuUvzex.js → Blueprint-C3lWY1Jf.js} +21 -20
  4. package/dist/{Blueprint-CoFJDAQd.cjs → Blueprint-CnDVffSX.cjs} +3 -2
  5. package/dist/{boolean2D-x2irapGj.js → boolean2D-CwZAIJDS.js} +15 -17
  6. package/dist/{boolean2D-Dk-vLBdl.cjs → boolean2D-DyQJt8Na.cjs} +3 -5
  7. package/dist/{booleanFns-DtOkwLHI.js → booleanFns-CcNUsgI8.js} +3 -3
  8. package/dist/{booleanFns-BJjYqwJ5.cjs → booleanFns-D7HmkpYt.cjs} +2 -2
  9. package/dist/brepjs.cjs +99 -43
  10. package/dist/brepjs.js +1006 -950
  11. package/dist/core.cjs +1 -1
  12. package/dist/core.js +1 -1
  13. package/dist/{cornerFinder-BESZIitp.cjs → cornerFinder-3zfbQvXg.cjs} +1 -1
  14. package/dist/{cornerFinder-FY38t0zq.js → cornerFinder-BV-l1BCw.js} +1 -1
  15. package/dist/{curveFns-LRNGcHXh.js → curveFns-CloOqAQ_.js} +11 -11
  16. package/dist/{drawFns-D8QyY7cg.js → drawFns-5myJTgtX.js} +69 -325
  17. package/dist/{drawFns-BEeoD1yO.cjs → drawFns-CDNafQhv.cjs} +64 -320
  18. package/dist/{helpers-DNzVfe-Z.cjs → helpers-6kn30cSD.cjs} +1 -1
  19. package/dist/{helpers-DeFPsrcI.js → helpers-C9KvE1RW.js} +6 -6
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/io.cjs +2 -2
  23. package/dist/io.js +2 -2
  24. package/dist/kernel/brepkitAdapter.d.ts.map +1 -1
  25. package/dist/kernel/brepkitWasmTypes.d.ts +5 -1
  26. package/dist/kernel/brepkitWasmTypes.d.ts.map +1 -1
  27. package/dist/{loft-DsVv4yxU.js → loft-BcZUCGKi.js} +1 -1
  28. package/dist/{meshFns-BU2l_yOm.cjs → meshFns-3gy0empP.cjs} +1 -1
  29. package/dist/{meshFns-HNwWuM4v.js → meshFns-DsLRd3tA.js} +1 -1
  30. package/dist/{operations-D-gTZNtM.cjs → operations-DLFzmdFX.cjs} +2 -2
  31. package/dist/{operations-D_3rrfrE.js → operations-Dcz6YlOt.js} +3 -3
  32. package/dist/operations.cjs +1 -1
  33. package/dist/operations.js +2 -2
  34. package/dist/query.cjs +2 -2
  35. package/dist/query.js +4 -4
  36. package/dist/{shapeFns-DHlLNHTn.cjs → shapeFns-D-MOoqJd.cjs} +4 -0
  37. package/dist/{shapeFns-CbXxLvV_.js → shapeFns-D2PlLFE6.js} +11 -7
  38. package/dist/sketching/Sketcher.d.ts +31 -77
  39. package/dist/sketching/Sketcher.d.ts.map +1 -1
  40. package/dist/sketching/Sketcher2d.d.ts +1 -1
  41. package/dist/sketching/Sketcher2d.d.ts.map +1 -1
  42. package/dist/sketching/draw.d.ts +2 -2
  43. package/dist/sketching/draw.d.ts.map +1 -1
  44. package/dist/sketching/sketcherlib.d.ts +32 -1
  45. package/dist/sketching/sketcherlib.d.ts.map +1 -1
  46. package/dist/sketching.cjs +2 -2
  47. package/dist/sketching.js +2 -2
  48. package/dist/{surfaceBuilders-D7ZH2QNS.js → surfaceBuilders-D6iDVPIM.js} +12 -12
  49. package/dist/topology/shapeFns.d.ts +5 -0
  50. package/dist/topology/shapeFns.d.ts.map +1 -1
  51. package/dist/{topology-BHnY7Szr.cjs → topology-CKtCGLmb.cjs} +3 -3
  52. package/dist/{topology-C1eZ86dI.js → topology-DxD58iQ6.js} +5 -5
  53. package/dist/topology.cjs +5 -4
  54. package/dist/topology.d.ts +1 -1
  55. package/dist/topology.d.ts.map +1 -1
  56. package/dist/topology.js +23 -22
  57. package/dist/{vectors-TlfO1hu2.cjs → vectors-BafmMf96.cjs} +0 -5
  58. package/dist/{vectors-cec8p8NQ.js → vectors-CESkzEm6.js} +1 -6
  59. package/dist/vectors.cjs +1 -1
  60. package/dist/vectors.js +1 -1
  61. package/package.json +2 -2
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-CoFJDAQd.cjs");
4
- const boolean2D = require("./boolean2D-Dk-vLBdl.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-CtuUvzex.js";
2
- import { d, C } from "./Blueprint-CtuUvzex.js";
3
- import { e, C as C2, f, l, g, n, k, q, o, p, r } from "./boolean2D-x2irapGj.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-DeFPsrcI.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,11 +1,11 @@
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");
6
6
  const curveFns = require("./curveFns-Ch87sD5O.cjs");
7
7
  const errors = require("./errors-9fDehDNc.cjs");
8
- const helpers = require("./helpers-DNzVfe-Z.cjs");
8
+ const helpers = require("./helpers-6kn30cSD.cjs");
9
9
  const vecOps = require("./vecOps-CjRL1jau.cjs");
10
10
  const surfaceBuilders = require("./surfaceBuilders-Be_ENWSA.cjs");
11
11
  const result = require("./result.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-DeFPsrcI.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-CtuUvzex.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");
@@ -54,8 +54,8 @@ const shapeTypes = require("./shapeTypes-7xEam9Ri.cjs");
54
54
  const curveFns = require("./curveFns-Ch87sD5O.cjs");
55
55
  const surfaceBuilders = require("./surfaceBuilders-Be_ENWSA.cjs");
56
56
  const result = require("./result.cjs");
57
- const helpers = require("./helpers-DNzVfe-Z.cjs");
58
- const Blueprint = require("./Blueprint-CoFJDAQd.cjs");
57
+ const helpers = require("./helpers-6kn30cSD.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
- import { a as getFaces, p as propagateOriginsByHash, b as propagateOriginsFromEvolution, c as getWires, d as getEdges, e as getVertices, g as getFaceOrigins } from "./shapeFns-CbXxLvV_.js";
6
- import { m as makeFace } from "./surfaceBuilders-D7ZH2QNS.js";
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-D6iDVPIM.js";
7
7
  const shapeTagStore = /* @__PURE__ */ new WeakMap();
8
8
  const tagMetadataStore = /* @__PURE__ */ new WeakMap();
9
9
  function hasFaceTags(shape) {
@@ -1,9 +1,9 @@
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
- const shapeFns = require("./shapeFns-DHlLNHTn.cjs");
6
+ const shapeFns = require("./shapeFns-D-MOoqJd.cjs");
7
7
  const surfaceBuilders = require("./surfaceBuilders-Be_ENWSA.cjs");
8
8
  const shapeTagStore = /* @__PURE__ */ new WeakMap();
9
9
  const tagMetadataStore = /* @__PURE__ */ new WeakMap();
package/dist/brepjs.cjs CHANGED
@@ -48,28 +48,28 @@ 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-CoFJDAQd.cjs");
51
+ const Blueprint = require("./Blueprint-CnDVffSX.cjs");
52
52
  const loft$2 = require("./loft-DR1UN5uN.cjs");
53
- const operations = require("./operations-D-gTZNtM.cjs");
54
- const boolean2D = require("./boolean2D-Dk-vLBdl.cjs");
53
+ const operations = require("./operations-DLFzmdFX.cjs");
54
+ const boolean2D = require("./boolean2D-DyQJt8Na.cjs");
55
55
  const _2d = require("./2d.cjs");
56
- const helpers = require("./helpers-DNzVfe-Z.cjs");
56
+ const helpers = require("./helpers-6kn30cSD.cjs");
57
57
  const io = require("./io.cjs");
58
- const drawFns = require("./drawFns-BEeoD1yO.cjs");
58
+ const drawFns = require("./drawFns-CDNafQhv.cjs");
59
59
  const types = require("./types-CA_xrgDq.cjs");
60
- const vectors = require("./vectors-TlfO1hu2.cjs");
61
- const shapeFns = require("./shapeFns-DHlLNHTn.cjs");
62
- const booleanFns = require("./booleanFns-BJjYqwJ5.cjs");
63
- const topology = require("./topology-BHnY7Szr.cjs");
60
+ const vectors = require("./vectors-BafmMf96.cjs");
61
+ const shapeFns = require("./shapeFns-D-MOoqJd.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
- const meshFns = require("./meshFns-BU2l_yOm.cjs");
66
+ const meshFns = require("./meshFns-3gy0empP.cjs");
67
67
  const measurement = require("./measurement-DoYXRaKI.cjs");
68
68
  const surfaceBuilders = require("./surfaceBuilders-Be_ENWSA.cjs");
69
69
  const query = require("./query.cjs");
70
70
  const solidBuilders = require("./solidBuilders-BzfRBizW.cjs");
71
71
  const result = require("./result.cjs");
72
- const cornerFinder = require("./cornerFinder-BESZIitp.cjs");
72
+ const cornerFinder = require("./cornerFinder-3zfbQvXg.cjs");
73
73
  const worker = require("./worker.cjs");
74
74
  function supportsProjection(kernel) {
75
75
  return "projectShape" in kernel;
@@ -1203,23 +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
- const lx = [p1[0] - center[0], p1[1] - center[1], p1[2] - center[2]];
1210
- const lxLen = Math.sqrt(lx[0] ** 2 + lx[1] ** 2 + lx[2] ** 2);
1211
- const uxA = [lx[0] / lxLen, lx[1] / lxLen, lx[2] / lxLen];
1212
- const uyA = [
1213
- nz[1] * uxA[2] - nz[2] * uxA[1],
1214
- nz[2] * uxA[0] - nz[0] * uxA[2],
1215
- nz[0] * uxA[1] - nz[1] * uxA[0]
1216
- ];
1217
- const v3 = [p3[0] - center[0], p3[1] - center[1], p3[2] - center[2]];
1218
- const dotX = v3[0] * uxA[0] + v3[1] * uxA[1] + v3[2] * uxA[2];
1219
- const dotY = v3[0] * uyA[0] + v3[1] * uyA[1] + v3[2] * uyA[2];
1220
- let endAngle = Math.atan2(dotY, dotX);
1221
- if (endAngle <= 0) endAngle += 2 * Math.PI;
1222
- return this.makeCircleNurbs(center, normal, radius, 0, endAngle);
1220
+ return edgeHandle(id);
1223
1221
  }
1224
1222
  makeEllipseEdge(center, normal, majorRadius, minorRadius, xDir) {
1225
1223
  return this.makeEllipseNurbs(center, normal, majorRadius, minorRadius, 0, 2 * Math.PI, xDir);
@@ -1259,21 +1257,73 @@ class BrepkitAdapter {
1259
1257
  return edgeHandle(id);
1260
1258
  }
1261
1259
  makeTangentArc(startPoint, startTangent, endPoint) {
1262
- const cp1 = [
1263
- startPoint[0] + startTangent[0] / 3,
1264
- startPoint[1] + startTangent[1] / 3,
1265
- startPoint[2] + startTangent[2] / 3
1260
+ const tLen = Math.sqrt(startTangent[0] ** 2 + startTangent[1] ** 2 + startTangent[2] ** 2);
1261
+ if (tLen < 1e-12) return this.makeLineEdge(startPoint, endPoint);
1262
+ const t = [
1263
+ startTangent[0] / tLen,
1264
+ startTangent[1] / tLen,
1265
+ startTangent[2] / tLen
1266
+ ];
1267
+ const ch = [
1268
+ startPoint[0] - endPoint[0],
1269
+ startPoint[1] - endPoint[1],
1270
+ startPoint[2] - endPoint[2]
1266
1271
  ];
1267
- const dx = endPoint[0] - cp1[0];
1268
- const dy = endPoint[1] - cp1[1];
1269
- const dz = endPoint[2] - cp1[2];
1270
- const len = Math.sqrt(dx * dx + dy * dy + dz * dz);
1271
- const cp2 = [
1272
- endPoint[0] - dx / (3 * Math.max(len, 1e-10)),
1273
- endPoint[1] - dy / (3 * Math.max(len, 1e-10)),
1274
- endPoint[2] - dz / (3 * Math.max(len, 1e-10))
1272
+ const chDotT = ch[0] * t[0] + ch[1] * t[1] + ch[2] * t[2];
1273
+ const perp = [
1274
+ ch[0] - chDotT * t[0],
1275
+ ch[1] - chDotT * t[1],
1276
+ ch[2] - chDotT * t[2]
1275
1277
  ];
1276
- return this.makeBezierEdge([startPoint, cp1, cp2, endPoint]);
1278
+ const perpLen = Math.sqrt(perp[0] ** 2 + perp[1] ** 2 + perp[2] ** 2);
1279
+ if (perpLen < 1e-12) return this.makeLineEdge(startPoint, endPoint);
1280
+ const n = [perp[0] / perpLen, perp[1] / perpLen, perp[2] / perpLen];
1281
+ const chord2 = ch[0] ** 2 + ch[1] ** 2 + ch[2] ** 2;
1282
+ const nDotCh = n[0] * ch[0] + n[1] * ch[1] + n[2] * ch[2];
1283
+ const s = -chord2 / (2 * nDotCh);
1284
+ const center = [
1285
+ startPoint[0] + s * n[0],
1286
+ startPoint[1] + s * n[1],
1287
+ startPoint[2] + s * n[2]
1288
+ ];
1289
+ const radius = Math.abs(s);
1290
+ const e1 = [
1291
+ (startPoint[0] - center[0]) / radius,
1292
+ (startPoint[1] - center[1]) / radius,
1293
+ (startPoint[2] - center[2]) / radius
1294
+ ];
1295
+ const e2 = [
1296
+ (endPoint[0] - center[0]) / radius,
1297
+ (endPoint[1] - center[1]) / radius,
1298
+ (endPoint[2] - center[2]) / radius
1299
+ ];
1300
+ let mx = e1[0] + e2[0];
1301
+ let my = e1[1] + e2[1];
1302
+ let mz = e1[2] + e2[2];
1303
+ let mLen = Math.sqrt(mx * mx + my * my + mz * mz);
1304
+ if (mLen < 1e-12) {
1305
+ mx = t[0];
1306
+ my = t[1];
1307
+ mz = t[2];
1308
+ mLen = 1;
1309
+ }
1310
+ const mid = [
1311
+ center[0] + radius * mx / mLen,
1312
+ center[1] + radius * my / mLen,
1313
+ center[2] + radius * mz / mLen
1314
+ ];
1315
+ const toMid = [
1316
+ mid[0] - startPoint[0],
1317
+ mid[1] - startPoint[1],
1318
+ mid[2] - startPoint[2]
1319
+ ];
1320
+ const dotTM = t[0] * toMid[0] + t[1] * toMid[1] + t[2] * toMid[2];
1321
+ if (dotTM < 0) {
1322
+ mid[0] = center[0] - radius * mx / mLen;
1323
+ mid[1] = center[1] - radius * my / mLen;
1324
+ mid[2] = center[2] - radius * mz / mLen;
1325
+ }
1326
+ return this.makeArcEdge(startPoint, mid, endPoint);
1277
1327
  }
1278
1328
  makeHelixWire(pitch, height, radius, center, _direction, leftHanded) {
1279
1329
  const turns = height / pitch;
@@ -2081,7 +2131,7 @@ class BrepkitAdapter {
2081
2131
  if (bkHandle.type !== "solid") {
2082
2132
  return { lines: new Float32Array(0), edgeGroups: [] };
2083
2133
  }
2084
- const edgeLines = this.bk.meshEdges(bkHandle.id, tolerance);
2134
+ const edgeLines = this.bk.meshEdgesAll ? this.bk.meshEdgesAll(bkHandle.id, tolerance) : this.bk.meshEdges(bkHandle.id, tolerance);
2085
2135
  const positions = edgeLines.positions;
2086
2136
  const offsets = edgeLines.offsets;
2087
2137
  const edgeCount = edgeLines.edgeCount;
@@ -3363,9 +3413,14 @@ class BrepkitAdapter {
3363
3413
  const sense = da1m < da12;
3364
3414
  const circle = makeCircle2d(cx, cy, radius, sense);
3365
3415
  if (!sense) {
3366
- return { __bk2d: "trimmed", basis: circle, tStart: -a1, tEnd: -a2 };
3416
+ const tStart = -a1;
3417
+ let tEnd2 = -a2;
3418
+ if (tEnd2 < tStart - 1e-9) tEnd2 += 2 * Math.PI;
3419
+ return { __bk2d: "trimmed", basis: circle, tStart, tEnd: tEnd2 };
3367
3420
  }
3368
- return { __bk2d: "trimmed", basis: circle, tStart: a1, tEnd: a2 };
3421
+ let tEnd = a2;
3422
+ if (tEnd < a1 - 1e-9) tEnd += 2 * Math.PI;
3423
+ return { __bk2d: "trimmed", basis: circle, tStart: a1, tEnd };
3369
3424
  }
3370
3425
  makeArc2dTangent(sx, sy, tx, ty, ex, ey) {
3371
3426
  const len = Math.sqrt(tx * tx + ty * ty);
@@ -7462,6 +7517,7 @@ exports.getFaces = shapeFns.getFaces;
7462
7517
  exports.getHashCode = shapeFns.getHashCode;
7463
7518
  exports.getVertices = shapeFns.getVertices;
7464
7519
  exports.getWires = shapeFns.getWires;
7520
+ exports.invalidateShapeCache = shapeFns.invalidateShapeCache;
7465
7521
  exports.isEqualShape = shapeFns.isEqualShape;
7466
7522
  exports.isSameShape = shapeFns.isSameShape;
7467
7523
  exports.iterEdges = shapeFns.iterEdges;