flo-mat 3.0.7 → 3.0.10

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 (117) hide show
  1. package/browser/index.js +215 -208
  2. package/browser/index.min.js +1 -1
  3. package/node/closest-boundary-point/cull-bezier-pieces.d.ts +5 -4
  4. package/node/closest-boundary-point/cull-bezier-pieces.js +9 -8
  5. package/node/closest-boundary-point/cull-bezier-pieces.js.map +1 -1
  6. package/node/closest-boundary-point/cull-by-loose-bounding-box.d.ts +2 -2
  7. package/node/closest-boundary-point/cull-by-loose-bounding-box.js +8 -8
  8. package/node/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -1
  9. package/node/closest-boundary-point/cull-by-tight-boundary-box.d.ts +2 -2
  10. package/node/closest-boundary-point/cull-by-tight-boundary-box.js +8 -8
  11. package/node/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -1
  12. package/node/closest-boundary-point/get-best-distance-squared.d.ts +1 -1
  13. package/node/closest-boundary-point/get-best-distance-squared.js +6 -6
  14. package/node/closest-boundary-point/get-best-distance-squared.js.map +1 -1
  15. package/node/closest-boundary-point/get-close-boundary-points-certified.d.ts +2 -2
  16. package/node/closest-boundary-point/get-close-boundary-points-certified.js +7 -7
  17. package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -1
  18. package/node/cp-node/cp-node-fs.d.ts +11 -11
  19. package/node/cp-node/cp-node-fs.js +11 -11
  20. package/node/cp-node/cp-node.d.ts +15 -15
  21. package/node/cp-node/fs/get-boundary-bezier-parts-to-next.d.ts +1 -1
  22. package/node/cp-node/fs/get-boundary-bezier-parts-to-next.js +11 -16
  23. package/node/cp-node/fs/get-boundary-bezier-parts-to-next.js.map +1 -1
  24. package/node/cp-node/fs/get-boundary-beziers-between.js +4 -6
  25. package/node/cp-node/fs/get-boundary-beziers-between.js.map +1 -1
  26. package/node/cp-node/fs/get-boundary-beziers-to-next.d.ts +10 -1
  27. package/node/cp-node/fs/get-boundary-beziers-to-next.js +70 -35
  28. package/node/cp-node/fs/get-boundary-beziers-to-next.js.map +1 -1
  29. package/node/cp-node/fs/get-salience.js +2 -2
  30. package/node/cp-node/fs/get-salience.js.map +1 -1
  31. package/node/cp-node/fs/get-speed.js +0 -1
  32. package/node/cp-node/fs/get-speed.js.map +1 -1
  33. package/node/find-2-prong/cull-bezier-pieces.d.ts +4 -4
  34. package/node/find-2-prong/cull-bezier-pieces.js +9 -9
  35. package/node/find-2-prong/cull-bezier-pieces.js.map +1 -1
  36. package/node/find-2-prong/find-2-prong.js +8 -8
  37. package/node/find-2-prong/find-2-prong.js.map +1 -1
  38. package/node/find-2-prong/get-initial-bezier-pieces.d.ts +2 -2
  39. package/node/find-2-prong/get-initial-bezier-pieces.js +2 -2
  40. package/node/find-2-prong/get-initial-bezier-pieces.js.map +1 -1
  41. package/node/find-2-prong/reduce-radius.d.ts +1 -1
  42. package/node/find-2-prong/reduce-radius.js +5 -5
  43. package/node/find-2-prong/reduce-radius.js.map +1 -1
  44. package/node/find-3-prong.ts/calc-better-x.d.ts +2 -2
  45. package/node/find-3-prong.ts/calc-better-x.js +3 -3
  46. package/node/find-3-prong.ts/calc-better-x.js.map +1 -1
  47. package/node/find-3-prong.ts/calc-initial-3-prong-center.d.ts +2 -2
  48. package/node/find-3-prong.ts/calc-initial-3-prong-center.js +3 -3
  49. package/node/find-3-prong.ts/calc-initial-3-prong-center.js.map +1 -1
  50. package/node/find-3-prong.ts/find-3-prong-for-delta3s.d.ts +2 -2
  51. package/node/find-3-prong.ts/find-3-prong-for-delta3s.js +16 -16
  52. package/node/find-3-prong.ts/find-3-prong-for-delta3s.js.map +1 -1
  53. package/node/find-3-prong.ts/find-3-prong.js +2 -2
  54. package/node/find-3-prong.ts/find-3-prong.js.map +1 -1
  55. package/node/find-3-prong.ts/get-closest-points.d.ts +2 -2
  56. package/node/find-3-prong.ts/get-closest-points.js +4 -4
  57. package/node/find-3-prong.ts/get-closest-points.js.map +1 -1
  58. package/node/find-mat/find-mat.js +4 -0
  59. package/node/find-mat/find-mat.js.map +1 -1
  60. package/node/find-mat/get-meta.js.map +1 -1
  61. package/node/index.d.ts +1 -0
  62. package/node/index.js +1 -1
  63. package/node/index.js.map +1 -1
  64. package/node/mat/get-boundary-piece-beziers.js +7 -7
  65. package/node/mat/get-boundary-piece-beziers.js.map +1 -1
  66. package/node/mat/mat.d.ts +1 -1
  67. package/node/point-on-shape/compare-poss.d.ts +3 -3
  68. package/node/point-on-shape/compare-poss.js +3 -3
  69. package/node/point-on-shape/get-osculating-circle.d.ts +1 -1
  70. package/node/point-on-shape/get-osculating-circle.js +1 -1
  71. package/node/point-on-shape/pos-to-human-string.d.ts +1 -1
  72. package/node/point-on-shape/pos-to-human-string.js +1 -1
  73. package/node/sat/cull.d.ts +7 -5
  74. package/node/sat/cull.js +7 -4
  75. package/node/sat/cull.js.map +1 -1
  76. package/node/sat/to-scale-axis.d.ts +3 -2
  77. package/node/sat/to-scale-axis.js +3 -2
  78. package/node/sat/to-scale-axis.js.map +1 -1
  79. package/package.json +5 -5
  80. package/src/closest-boundary-point/cull-bezier-pieces.ts +12 -11
  81. package/src/closest-boundary-point/cull-by-loose-bounding-box.ts +8 -8
  82. package/src/closest-boundary-point/cull-by-tight-boundary-box.ts +8 -8
  83. package/src/closest-boundary-point/get-best-distance-squared.ts +6 -6
  84. package/src/closest-boundary-point/get-close-boundary-points-certified.ts +8 -8
  85. package/src/cp-node/fs/get-boundary-bezier-parts-to-next.ts +12 -18
  86. package/src/cp-node/fs/get-boundary-beziers-between.ts +6 -7
  87. package/src/cp-node/fs/get-boundary-beziers-to-next.ts +79 -53
  88. package/src/cp-node/fs/get-salience.ts +2 -2
  89. package/src/cp-node/fs/get-speed.ts +1 -6
  90. package/src/curve/curve.ts +5 -5
  91. package/src/debug/functions/draw-elem/two-prong.ts +40 -40
  92. package/src/debug/functions/two-prong.ts +195 -195
  93. package/src/debug/two-prong-for-debugging.ts +26 -26
  94. package/src/find-2-prong/add-debug-info.ts +38 -38
  95. package/src/find-2-prong/cull-bezier-pieces.ts +10 -10
  96. package/src/find-2-prong/find-2-prong.ts +8 -8
  97. package/src/find-2-prong/get-initial-bezier-pieces.ts +2 -2
  98. package/src/find-2-prong/reduce-radius.ts +5 -5
  99. package/src/find-3-prong.ts/calc-better-x.ts +3 -3
  100. package/src/find-3-prong.ts/calc-initial-3-prong-center.ts +3 -3
  101. package/src/find-3-prong.ts/find-3-prong-for-delta3s.ts +16 -16
  102. package/src/find-3-prong.ts/find-3-prong.ts +2 -2
  103. package/src/find-3-prong.ts/get-closest-points.ts +4 -4
  104. package/src/find-mat/add-2-prongs-by-error.ts +7 -7
  105. package/src/find-mat/find-mat.ts +6 -0
  106. package/src/find-mat/get-meta.ts +7 -1
  107. package/src/index.ts +2 -2
  108. package/src/mat/get-boundary-piece-beziers.ts +7 -7
  109. package/src/mat/get-two-prong-type.ts +8 -8
  110. package/src/sat/cull.ts +10 -7
  111. package/src/sat/to-scale-axis.ts +18 -17
  112. package/src/utils/bezier-piece-to-bezier.ts +7 -7
  113. package/node/cp-node/fs/cp-nodes-to-boundary-beziers.d.ts +0 -3
  114. package/node/cp-node/fs/cp-nodes-to-boundary-beziers.js +0 -6
  115. package/node/cp-node/fs/cp-nodes-to-boundary-beziers.js.map +0 -1
  116. package/src/closest-boundary-point/get-closest-boundary-point-certified.ts +0 -70
  117. package/src/cp-node/fs/cp-nodes-to-boundary-beziers.ts +0 -10
@@ -1,9 +1,10 @@
1
1
  import { CurvePiece } from '../mat/curve-piece.js';
2
2
  /**
3
- * @internal
4
- * @param bezierPieces
3
+ * @param curvePieces
5
4
  * @param p
6
5
  * @param extreme
6
+ *
7
+ * @internal
7
8
  */
8
- declare function cullBezierPieces1(bezierPieces: CurvePiece[], p: number[]): CurvePiece[];
9
- export { cullBezierPieces1 };
9
+ declare function cullCurvePieces1(curvePieces: CurvePiece[], p: number[]): CurvePiece[];
10
+ export { cullCurvePieces1 };
@@ -2,16 +2,17 @@ import { getBestDistanceSquared } from './get-best-distance-squared.js';
2
2
  import { cullByLooseBoundingBox } from './cull-by-loose-bounding-box.js';
3
3
  import { cullByTightBoundingBox } from './cull-by-tight-boundary-box.js';
4
4
  /**
5
- * @internal
6
- * @param bezierPieces
5
+ * @param curvePieces
7
6
  * @param p
8
7
  * @param extreme
8
+ *
9
+ * @internal
9
10
  */
10
- function cullBezierPieces1(bezierPieces, p) {
11
- const bestSquaredDistance = getBestDistanceSquared(bezierPieces, p);
12
- bezierPieces = cullByLooseBoundingBox(bezierPieces, p, bestSquaredDistance);
13
- bezierPieces = cullByTightBoundingBox(bezierPieces, p, bestSquaredDistance);
14
- return bezierPieces;
11
+ function cullCurvePieces1(curvePieces, p) {
12
+ const bestSquaredDistance = getBestDistanceSquared(curvePieces, p);
13
+ curvePieces = cullByLooseBoundingBox(curvePieces, p, bestSquaredDistance);
14
+ curvePieces = cullByTightBoundingBox(curvePieces, p, bestSquaredDistance);
15
+ return curvePieces;
15
16
  }
16
- export { cullBezierPieces1 };
17
+ export { cullCurvePieces1 };
17
18
  //# sourceMappingURL=cull-bezier-pieces.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cull-bezier-pieces.js","sourceRoot":"","sources":["../../src/closest-boundary-point/cull-bezier-pieces.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAGzE;;;;;GAKG;AACH,SAAS,iBAAiB,CAClB,YAA0B,EAC1B,CAAW;IAEf,MAAM,mBAAmB,GAAG,sBAAsB,CAC9C,YAAY,EAAE,CAAC,CAClB,CAAC;IACF,YAAY,GAAG,sBAAsB,CACjC,YAAY,EAAE,CAAC,EACf,mBAAmB,CACtB,CAAC;IAEF,YAAY,GAAG,sBAAsB,CACjC,YAAY,EAAE,CAAC,EACf,mBAAmB,CACtB,CAAC;IAGF,OAAO,YAAY,CAAC;AACxB,CAAC;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
1
+ {"version":3,"file":"cull-bezier-pieces.js","sourceRoot":"","sources":["../../src/closest-boundary-point/cull-bezier-pieces.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAGzE;;;;;;GAMG;AACH,SAAS,gBAAgB,CACjB,WAAyB,EACzB,CAAW;IAEf,MAAM,mBAAmB,GAAG,sBAAsB,CAC9C,WAAW,EAAE,CAAC,CACjB,CAAC;IACF,WAAW,GAAG,sBAAsB,CAChC,WAAW,EAAE,CAAC,EACd,mBAAmB,CACtB,CAAC;IAEF,WAAW,GAAG,sBAAsB,CAChC,WAAW,EAAE,CAAC,EACd,mBAAmB,CACtB,CAAC;IAGF,OAAO,WAAW,CAAC;AACvB,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
@@ -3,9 +3,9 @@ import { CurvePiece } from '../mat/curve-piece.js';
3
3
  * @internal
4
4
  * When checking distances, ignore all those with closest possible distance
5
5
  * further than 'bestSquaredDistance', i.e. cull them.
6
- * @param bezierPieces
6
+ * @param curvePieces
7
7
  * @param p
8
8
  * @param dSquared
9
9
  */
10
- declare function cullByLooseBoundingBox(bezierPieces: CurvePiece[], p: number[], dSquared: number): CurvePiece[];
10
+ declare function cullByLooseBoundingBox(curvePieces: CurvePiece[], p: number[], dSquared: number): CurvePiece[];
11
11
  export { cullByLooseBoundingBox };
@@ -4,22 +4,22 @@ import { getBoundingBox$ } from '../geometry/get-bounding-box-.js';
4
4
  * @internal
5
5
  * When checking distances, ignore all those with closest possible distance
6
6
  * further than 'bestSquaredDistance', i.e. cull them.
7
- * @param bezierPieces
7
+ * @param curvePieces
8
8
  * @param p
9
9
  * @param dSquared
10
10
  */
11
- function cullByLooseBoundingBox(bezierPieces, p, dSquared) {
12
- const candidateBezierPieces = [];
13
- for (let i = 0; i < bezierPieces.length; i++) {
14
- const bezierPiece = bezierPieces[i];
15
- const ps = bezierPiece.curve.ps;
11
+ function cullByLooseBoundingBox(curvePieces, p, dSquared) {
12
+ const candidateCurvePieces = [];
13
+ for (let i = 0; i < curvePieces.length; i++) {
14
+ const curvePiece = curvePieces[i];
15
+ const ps = curvePiece.curve.ps;
16
16
  const boundingBox = getBoundingBox$(ps);
17
17
  const d = getClosestSquareDistanceToRect(boundingBox, p);
18
18
  if (d <= dSquared) {
19
- candidateBezierPieces.push(bezierPiece);
19
+ candidateCurvePieces.push(curvePiece);
20
20
  }
21
21
  }
22
- return candidateBezierPieces;
22
+ return candidateCurvePieces;
23
23
  }
24
24
  export { cullByLooseBoundingBox };
25
25
  //# sourceMappingURL=cull-by-loose-bounding-box.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cull-by-loose-bounding-box.js","sourceRoot":"","sources":["../../src/closest-boundary-point/cull-by-loose-bounding-box.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE;;;;;;;GAOG;AACH,SAAS,sBAAsB,CACvB,YAA0B,EAC1B,CAAW,EACX,QAAgB;IAEpB,MAAM,qBAAqB,GAAG,EAAE,CAAC;IAEjC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAEhC,MAAM,WAAW,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;QAExC,MAAM,CAAC,GAAG,8BAA8B,CACpC,WAAW,EACX,CAAC,CACJ,CAAC;QACF,IAAI,CAAC,IAAI,QAAQ,EAAE,CAAC;YAChB,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC5C,CAAC;IACL,CAAC;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
1
+ {"version":3,"file":"cull-by-loose-bounding-box.js","sourceRoot":"","sources":["../../src/closest-boundary-point/cull-by-loose-bounding-box.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE;;;;;;;GAOG;AACH,SAAS,sBAAsB,CACvB,WAAyB,EACzB,CAAW,EACX,QAAgB;IAEpB,MAAM,oBAAoB,GAAG,EAAE,CAAC;IAEhC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAClC,MAAM,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAE/B,MAAM,WAAW,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;QAExC,MAAM,CAAC,GAAG,8BAA8B,CACpC,WAAW,EACX,CAAC,CACJ,CAAC;QACF,IAAI,CAAC,IAAI,QAAQ,EAAE,CAAC;YAChB,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,CAAC;IACL,CAAC;IAED,OAAO,oBAAoB,CAAC;AAChC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
@@ -3,9 +3,9 @@ import { CurvePiece } from "../mat/curve-piece.js";
3
3
  * @internal
4
4
  * When checking distances, ignore all those with closest possible distance
5
5
  * further than 'bestSquaredDistance', i.e. cull them.
6
- * @param bezierPieces
6
+ * @param curvePieces
7
7
  * @param p
8
8
  * @param bestSquaredDistance
9
9
  */
10
- declare function cullByTightBoundingBox(bezierPieces: CurvePiece[], p: number[], bestSquaredDistance: number): CurvePiece[];
10
+ declare function cullByTightBoundingBox(curvePieces: CurvePiece[], p: number[], bestSquaredDistance: number): CurvePiece[];
11
11
  export { cullByTightBoundingBox };
@@ -6,22 +6,22 @@ const getBoundingBoxTight_ = memoize(getBoundingBoxTight);
6
6
  * @internal
7
7
  * When checking distances, ignore all those with closest possible distance
8
8
  * further than 'bestSquaredDistance', i.e. cull them.
9
- * @param bezierPieces
9
+ * @param curvePieces
10
10
  * @param p
11
11
  * @param bestSquaredDistance
12
12
  */
13
- function cullByTightBoundingBox(bezierPieces, p, bestSquaredDistance) {
14
- const candidateBezierPieces = [];
15
- for (let i = 0; i < bezierPieces.length; i++) {
16
- const bezierPiece = bezierPieces[i];
17
- const ps = bezierPiece.curve.ps;
13
+ function cullByTightBoundingBox(curvePieces, p, bestSquaredDistance) {
14
+ const candidateCurvePieces = [];
15
+ for (let i = 0; i < curvePieces.length; i++) {
16
+ const curvePiece = curvePieces[i];
17
+ const ps = curvePiece.curve.ps;
18
18
  const tightBoundingBox = getBoundingBoxTight_(ps);
19
19
  const d = getClosestSquaredDistanceToRotatedRect(tightBoundingBox, p);
20
20
  if (d <= bestSquaredDistance) {
21
- candidateBezierPieces.push(bezierPiece);
21
+ candidateCurvePieces.push(curvePiece);
22
22
  }
23
23
  }
24
- return candidateBezierPieces;
24
+ return candidateCurvePieces;
25
25
  }
26
26
  export { cullByTightBoundingBox };
27
27
  //# sourceMappingURL=cull-by-tight-boundary-box.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cull-by-tight-boundary-box.js","sourceRoot":"","sources":["../../src/closest-boundary-point/cull-by-tight-boundary-box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,sCAAsC,EAAE,MAAM,6DAA6D,CAAC;AAGrH,MAAM,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAG1D;;;;;;;GAOG;AACH,SAAS,sBAAsB,CACvB,YAA0B,EAC1B,CAAW,EACX,mBAA2B;IAE/B,MAAM,qBAAqB,GAAG,EAAE,CAAC;IAEjC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAEhC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,EAAE,CAAC,CAAC;QAClD,MAAM,CAAC,GAAG,sCAAsC,CACxC,gBAAgB,EAChB,CAAC,CACR,CAAC;QACF,IAAI,CAAC,IAAI,mBAAmB,EAAE,CAAC;YAC3B,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC5C,CAAC;IACL,CAAC;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
1
+ {"version":3,"file":"cull-by-tight-boundary-box.js","sourceRoot":"","sources":["../../src/closest-boundary-point/cull-by-tight-boundary-box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,sCAAsC,EAAE,MAAM,6DAA6D,CAAC;AAGrH,MAAM,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAG1D;;;;;;;GAOG;AACH,SAAS,sBAAsB,CACvB,WAAyB,EACzB,CAAW,EACX,mBAA2B;IAE/B,MAAM,oBAAoB,GAAG,EAAE,CAAC;IAEhC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAClC,MAAM,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAE/B,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,EAAE,CAAC,CAAC;QAClD,MAAM,CAAC,GAAG,sCAAsC,CACxC,gBAAgB,EAChB,CAAC,CACR,CAAC;QACF,IAAI,CAAC,IAAI,mBAAmB,EAAE,CAAC;YAC3B,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,CAAC;IACL,CAAC;IAED,OAAO,oBAAoB,CAAC;AAChC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
@@ -4,5 +4,5 @@ import { CurvePiece } from "../mat/curve-piece.js";
4
4
  * Finds an initial distance such that the closest point can not be further than
5
5
  * this distance away.
6
6
  */
7
- declare function getBestDistanceSquared(bezierPieces: CurvePiece[], p: number[]): number;
7
+ declare function getBestDistanceSquared(curvePieces: CurvePiece[], p: number[]): number;
8
8
  export { getBestDistanceSquared };
@@ -5,13 +5,13 @@ import { squaredDistanceBetween } from 'flo-vector2d';
5
5
  * Finds an initial distance such that the closest point can not be further than
6
6
  * this distance away.
7
7
  */
8
- function getBestDistanceSquared(bezierPieces, p) {
8
+ function getBestDistanceSquared(curvePieces, p) {
9
9
  let bestSquaredDistance = Number.POSITIVE_INFINITY;
10
- for (let i = 0; i < bezierPieces.length; i++) {
11
- const bezierPiece = bezierPieces[i];
12
- const ps = bezierPiece.curve.ps;
13
- const p1 = evalDeCasteljau(ps, bezierPiece.ts[0]);
14
- const p2 = evalDeCasteljau(ps, bezierPiece.ts[1]);
10
+ for (let i = 0; i < curvePieces.length; i++) {
11
+ const curvePiece = curvePieces[i];
12
+ const ps = curvePiece.curve.ps;
13
+ const p1 = evalDeCasteljau(ps, curvePiece.ts[0]);
14
+ const p2 = evalDeCasteljau(ps, curvePiece.ts[1]);
15
15
  const d = Math.min(squaredDistanceBetween(p, p1), squaredDistanceBetween(p, p2));
16
16
  if (d < bestSquaredDistance) {
17
17
  bestSquaredDistance = d;
@@ -1 +1 @@
1
- {"version":3,"file":"get-best-distance-squared.js","sourceRoot":"","sources":["../../src/closest-boundary-point/get-best-distance-squared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAItD;;;;GAIG;AACH,SAAS,sBAAsB,CACvB,YAA0B,EAC1B,CAAW;IAEf,IAAI,mBAAmB,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACnD,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAEpC,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAEhC,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAClD,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAElD,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CACd,sBAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,EAC7B,sBAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,CAChC,CAAC;QAEF,IAAI,CAAC,GAAG,mBAAmB,EAAE,CAAC;YAC1B,mBAAmB,GAAG,CAAC,CAAC;QAC5B,CAAC;IACL,CAAC;IAED,mEAAmE;IACnE,OAAO,CAAC,CAAC,GAAG,CAAC,IAAE,CAAC,EAAE,CAAC,GAAC,mBAAmB,CAAC;AAC5C,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
1
+ {"version":3,"file":"get-best-distance-squared.js","sourceRoot":"","sources":["../../src/closest-boundary-point/get-best-distance-squared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAItD;;;;GAIG;AACH,SAAS,sBAAsB,CACvB,WAAyB,EACzB,CAAW;IAEf,IAAI,mBAAmB,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACnD,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAElC,MAAM,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAE/B,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAEjD,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CACd,sBAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,EAC7B,sBAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,CAChC,CAAC;QAEF,IAAI,CAAC,GAAG,mBAAmB,EAAE,CAAC;YAC1B,mBAAmB,GAAG,CAAC,CAAC;QAC5B,CAAC;IACL,CAAC;IAED,mEAAmE;IACnE,OAAO,CAAC,CAAC,GAAG,CAAC,IAAE,CAAC,EAAE,CAAC,GAAC,mBAAmB,CAAC;AAC5C,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
@@ -7,12 +7,12 @@ import { PointOnShape } from '../point-on-shape/point-on-shape.js';
7
7
  * bezier pieces, including the beziers actually checked after culling.
8
8
  *
9
9
  * @param pow
10
- * @param bezierPieces
10
+ * @param curvePieces
11
11
  * @param x
12
12
  * @param touchedCurve
13
13
  * @param t
14
14
  * @param for1Prong defaults to `false`;
15
15
  * @param angle defaults to `0`
16
16
  */
17
- declare function getCloseBoundaryPointsCertified(pow: number, bezierPieces: CurvePiece[], x: number[], touchedCurve?: Curve | undefined, t?: number | undefined, for1Prong?: boolean, angle?: number): PointOnShape[];
17
+ declare function getCloseBoundaryPointsCertified(pow: number, curvePieces: CurvePiece[], x: number[], touchedCurve?: Curve | undefined, t?: number | undefined, for1Prong?: boolean, angle?: number): PointOnShape[];
18
18
  export { getCloseBoundaryPointsCertified };
@@ -1,5 +1,5 @@
1
1
  import { getPotentialClosestPointsOnCurveCertified } from './get-potential-closest-points-on-curve-certified.js';
2
- import { cullBezierPieces1 } from './cull-bezier-pieces.js';
2
+ import { cullCurvePieces1 } from './cull-bezier-pieces.js';
3
3
  import { createPos } from '../point-on-shape/create-pos.js';
4
4
  /**
5
5
  * @internal
@@ -7,19 +7,19 @@ import { createPos } from '../point-on-shape/create-pos.js';
7
7
  * bezier pieces, including the beziers actually checked after culling.
8
8
  *
9
9
  * @param pow
10
- * @param bezierPieces
10
+ * @param curvePieces
11
11
  * @param x
12
12
  * @param touchedCurve
13
13
  * @param t
14
14
  * @param for1Prong defaults to `false`;
15
15
  * @param angle defaults to `0`
16
16
  */
17
- function getCloseBoundaryPointsCertified(pow, bezierPieces, x, touchedCurve = undefined, t = undefined, for1Prong = false, angle = 0) {
18
- bezierPieces = cullBezierPieces1(bezierPieces, x);
17
+ function getCloseBoundaryPointsCertified(pow, curvePieces, x, touchedCurve = undefined, t = undefined, for1Prong = false, angle = 0) {
18
+ curvePieces = cullCurvePieces1(curvePieces, x);
19
19
  const pInfoss = [];
20
- for (let i = 0; i < bezierPieces.length; i++) {
21
- const bezierPiece = bezierPieces[i];
22
- const pInfos = getPotentialClosestPointsOnCurveCertified(pow, bezierPiece.curve, x, bezierPiece.ts, touchedCurve, t, for1Prong, angle);
20
+ for (let i = 0; i < curvePieces.length; i++) {
21
+ const curvePiece = curvePieces[i];
22
+ const pInfos = getPotentialClosestPointsOnCurveCertified(pow, curvePiece.curve, x, curvePiece.ts, touchedCurve, t, for1Prong, angle);
23
23
  pInfoss.push(...pInfos);
24
24
  }
25
25
  /** the minimum max interval value */
@@ -1 +1 @@
1
- {"version":3,"file":"get-close-boundary-points-certified.js","sourceRoot":"","sources":["../../src/closest-boundary-point/get-close-boundary-points-certified.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yCAAyC,EAAE,MAAM,sDAAsD,CAAC;AACjH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAI5D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAG5D;;;;;;;;;;;;GAYG;AACH,SAAS,+BAA+B,CACtC,GAAW,EACL,YAA0B,EAC1B,CAAW,EACjB,eAAkC,SAAS,EAC3C,IAAwB,SAAS,EACjC,SAAS,GAAG,KAAK,EACjB,KAAK,GAAG,CAAC;IAEV,YAAY,GAAG,iBAAiB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAElD,MAAM,OAAO,GAA0B,EAAE,CAAC;IAC1C,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAEpC,MAAM,MAAM,GAAG,yCAAyC,CACvD,GAAG,EACH,WAAW,CAAC,KAAK,EACjB,CAAC,EACD,WAAW,CAAC,EAAE,EACd,YAAY,EACZ,CAAC,EACD,SAAS,EACT,KAAK,CACL,CAAC;QAEF,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;IACzB,CAAC;IAED,qCAAqC;IACrC,IAAI,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACtC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACtC,IAAI,KAAK,GAAG,MAAM,EAAE,CAAC;YACpB,MAAM,GAAG,KAAK,CAAC;QAChB,CAAC;IACF,CAAC;IAED,MAAM,iBAAiB,GAA0B,EAAE,CAAC;IAEpD,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC;YACjC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC;IAED,OAAO,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AAC5E,CAAC;AAGD,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
1
+ {"version":3,"file":"get-close-boundary-points-certified.js","sourceRoot":"","sources":["../../src/closest-boundary-point/get-close-boundary-points-certified.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yCAAyC,EAAE,MAAM,sDAAsD,CAAC;AACjH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAI3D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAG5D;;;;;;;;;;;;GAYG;AACH,SAAS,+BAA+B,CACtC,GAAW,EACL,WAAyB,EACzB,CAAW,EACjB,eAAkC,SAAS,EAC3C,IAAwB,SAAS,EACjC,SAAS,GAAG,KAAK,EACjB,KAAK,GAAG,CAAC;I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AAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AAC5E,CAAC;AAGD,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
@@ -36,17 +36,17 @@ declare const CpNodeFs: {
36
36
  /**
37
37
  * Returns the children of this `CpNode` when seen as a MAT edge. Only
38
38
  * children in a 'forward' direction are returned. These include all edges
39
- * except the 'backward' edge given by [[prevOnCircle]], even terminating
39
+ * except the 'backward' edge given by `prevOnCircle`, even terminating
40
40
  * edges.
41
41
  */
42
42
  getChildren: typeof getChildren;
43
43
  /**
44
- * Similar to [[getChildren]] but returns the child nodes of the tree when
44
+ * Similar to `getChildren` but returns the child nodes of the tree when
45
45
  * `CpNode` is seen as a MAT vertex point (as opposed to edge). In this
46
46
  * way the dual graph of the tree can easily be traversed - see e.g.
47
- * [[traverseVertices]]. Generally, however, traversing the edges is
47
+ * `traverseVertices`. Generally, however, traversing the edges is
48
48
  * preferred as it returns the entire Medial Axis (by utilizing
49
- * [[getMatCurveToNext]] on each returned edge).
49
+ * `getMatCurveToNext` on each returned edge).
50
50
  */
51
51
  getVertexForwardChildren: typeof getVertexForwardChildren;
52
52
  /**
@@ -78,7 +78,7 @@ declare const CpNodeFs: {
78
78
  * maximal disk. It can be seen as a limiting case of a two-prong where the
79
79
  * distance between two of the contact points tend to zero. One point
80
80
  * (represented by a `CpNode` of course) will be terminating with the
81
- * other point being its [[next]], whereas the other point will *not* be
81
+ * other point being its `next`, whereas the other point will *not* be
82
82
  * terminating and 'points' back into the shape.
83
83
  */
84
84
  isTerminating: typeof isTerminating;
@@ -97,7 +97,7 @@ declare const CpNodeFs: {
97
97
  * limiting case of a two-prong having zero radius.
98
98
  *
99
99
  * Note that two `CpNode`s are stored for each sharp corner, one being
100
- * terminating and one not. See [[isTerminating]] for more details.
100
+ * terminating and one not. See `isTerminating` for more details.
101
101
  */
102
102
  isSharp: typeof isSharp;
103
103
  /**
@@ -106,7 +106,7 @@ declare const CpNodeFs: {
106
106
  * corners.
107
107
  *
108
108
  * Note, however, that two `CpNode`s are stored for each such point to
109
- * preserve symmetry - see [[isTerminating]] for more details.
109
+ * preserve symmetry - see `isTerminating` for more details.
110
110
  */
111
111
  isOneProng: typeof isOneProng;
112
112
  /**
@@ -114,15 +114,15 @@ declare const CpNodeFs: {
114
114
  * by this `CpNode`.
115
115
  *
116
116
  * Note, however, that even one-prongs and sharp corners will return 2 (see
117
- * [[isTerminating]] for more details); if this is not desired use
118
- * [[getRealProngCount]] instead which will return 1 in these cases.
117
+ * `isTerminating` for more details); if this is not desired use
118
+ * `getRealProngCount` instead which will return 1 in these cases.
119
119
  */
120
120
  getProngCount: typeof getProngCount;
121
121
  /**
122
122
  * Returns the number of contact points (up to planar coordinates) on the
123
123
  * maximal disk circle implied by this `CpNode`.
124
124
  *
125
- * See also [[getProngCount]].
125
+ * See also `getProngCount`.
126
126
  */
127
127
  getRealProngCount: typeof getRealProngCount;
128
128
  /**
@@ -159,7 +159,7 @@ declare const CpNodeFs: {
159
159
  * Traverses the MAT tree and calls the given callback function for each vertex
160
160
  * (represented by a `CpNode`) on the MAT.
161
161
  *
162
- * It is usually preferable to use [[traverseEdges]] as it allows for the
162
+ * It is usually preferable to use `traverseEdges` as it allows for the
163
163
  * traversal of all the smooth curves representing the MAT.
164
164
  * @param cpNode Any `CpNode` representing the start vertex.
165
165
  * @param traverseVerticesCallback A callback function taking a single `CpNode` as parameter.
@@ -38,17 +38,17 @@ const CpNodeFs = {
38
38
  /**
39
39
  * Returns the children of this `CpNode` when seen as a MAT edge. Only
40
40
  * children in a 'forward' direction are returned. These include all edges
41
- * except the 'backward' edge given by [[prevOnCircle]], even terminating
41
+ * except the 'backward' edge given by `prevOnCircle`, even terminating
42
42
  * edges.
43
43
  */
44
44
  getChildren,
45
45
  /**
46
- * Similar to [[getChildren]] but returns the child nodes of the tree when
46
+ * Similar to `getChildren` but returns the child nodes of the tree when
47
47
  * `CpNode` is seen as a MAT vertex point (as opposed to edge). In this
48
48
  * way the dual graph of the tree can easily be traversed - see e.g.
49
- * [[traverseVertices]]. Generally, however, traversing the edges is
49
+ * `traverseVertices`. Generally, however, traversing the edges is
50
50
  * preferred as it returns the entire Medial Axis (by utilizing
51
- * [[getMatCurveToNext]] on each returned edge).
51
+ * `getMatCurveToNext` on each returned edge).
52
52
  */
53
53
  getVertexForwardChildren,
54
54
  /**
@@ -80,7 +80,7 @@ const CpNodeFs = {
80
80
  * maximal disk. It can be seen as a limiting case of a two-prong where the
81
81
  * distance between two of the contact points tend to zero. One point
82
82
  * (represented by a `CpNode` of course) will be terminating with the
83
- * other point being its [[next]], whereas the other point will *not* be
83
+ * other point being its `next`, whereas the other point will *not* be
84
84
  * terminating and 'points' back into the shape.
85
85
  */
86
86
  isTerminating,
@@ -99,7 +99,7 @@ const CpNodeFs = {
99
99
  * limiting case of a two-prong having zero radius.
100
100
  *
101
101
  * Note that two `CpNode`s are stored for each sharp corner, one being
102
- * terminating and one not. See [[isTerminating]] for more details.
102
+ * terminating and one not. See `isTerminating` for more details.
103
103
  */
104
104
  isSharp,
105
105
  /**
@@ -108,7 +108,7 @@ const CpNodeFs = {
108
108
  * corners.
109
109
  *
110
110
  * Note, however, that two `CpNode`s are stored for each such point to
111
- * preserve symmetry - see [[isTerminating]] for more details.
111
+ * preserve symmetry - see `isTerminating` for more details.
112
112
  */
113
113
  isOneProng,
114
114
  /**
@@ -116,15 +116,15 @@ const CpNodeFs = {
116
116
  * by this `CpNode`.
117
117
  *
118
118
  * Note, however, that even one-prongs and sharp corners will return 2 (see
119
- * [[isTerminating]] for more details); if this is not desired use
120
- * [[getRealProngCount]] instead which will return 1 in these cases.
119
+ * `isTerminating` for more details); if this is not desired use
120
+ * `getRealProngCount` instead which will return 1 in these cases.
121
121
  */
122
122
  getProngCount,
123
123
  /**
124
124
  * Returns the number of contact points (up to planar coordinates) on the
125
125
  * maximal disk circle implied by this `CpNode`.
126
126
  *
127
- * See also [[getProngCount]].
127
+ * See also `getProngCount`.
128
128
  */
129
129
  getRealProngCount,
130
130
  /**
@@ -161,7 +161,7 @@ const CpNodeFs = {
161
161
  * Traverses the MAT tree and calls the given callback function for each vertex
162
162
  * (represented by a `CpNode`) on the MAT.
163
163
  *
164
- * It is usually preferable to use [[traverseEdges]] as it allows for the
164
+ * It is usually preferable to use `traverseEdges` as it allows for the
165
165
  * traversal of all the smooth curves representing the MAT.
166
166
  * @param cpNode Any `CpNode` representing the start vertex.
167
167
  * @param traverseVerticesCallback A callback function taking a single `CpNode` as parameter.
@@ -9,41 +9,41 @@ import { ContactPoint } from '../contact-point/contact-point.js';
9
9
  * represents the entire MAT.
10
10
  *
11
11
  * To get the maximal disk circle (of which the center is on the medial axis)
12
- * use [[cp]].circle.
12
+ * use `cp.circle`.
13
13
  *
14
- * To get the boundary point, use [[cp]].pointOnShape.
14
+ * To get the boundary point, use `cp.pointOnShape`.
15
15
  *
16
- * The edge [[next]] (resp. [[prev]]) allows one to move anti-clockwise (resp.
16
+ * The edge `next` (resp. `prev`) allows one to move anti-clockwise (resp.
17
17
  * clockwise) on the shape boundary to the next `CpNode`. This also imposes a
18
18
  * direction of traversal of the MAT edges and vertices.
19
19
  *
20
- * The edge [[nextOnCircle]] (resp. [[prevOnCircle]]) allows one to go
20
+ * The edge `nextOnCircle` (resp. `prevOnCircle`) allows one to go
21
21
  * anti-clockwise (resp. clockwise) around the maximal disks implied by
22
22
  * the CpNode to the next maximal disk contact point. This is equivalent to
23
23
  * following other branches on the MAT.
24
24
  *
25
- * Call [[getMatCurveBetween]](cpNodeFrom, cpNodeTo) or getMatCurveToNext(cpNode)
26
- * (replacing the older CpNode.[[matCurveToNextVertex]]) to get a bezier curve
25
+ * Call `getMatCurveBetween(cpNodeFrom, cpNodeTo)` or `getMatCurveToNext(cpNode)`
26
+ * (replacing the older CpNode.`matCurveToNextVertex`) to get a bezier curve
27
27
  * from the maximal disk of this `CpNode` to the next `CpNode`'s
28
28
  * maximal disk and thus directly representing a piece of the medial axis.
29
29
  *
30
- * The function, [[getChildren]], returns the children of this `CpNode` when
30
+ * The function, `getChildren`, returns the children of this `CpNode` when
31
31
  * seen as a MAT edge. Only children in a 'forward' direction are returned. These
32
- * include all edges except the 'backward' edge given by [[prevOnCircle]]. For
32
+ * include all edges except the 'backward' edge given by `prevOnCircle`. For
33
33
  * `CpNode`s having a maximal disk with 2 contact points (a 2-prong, the usual
34
- * case) the children will be the single edge [[next]]. For a 3-prong this will
35
- * be the edges [[next]] and [[nextOnCircle]], etc. [[getChildren]] allows one to
36
- * easily traverse the MAT tree - see e.g. the implementation of [[traverseEdges]].
34
+ * case) the children will be the single edge `next`. For a 3-prong this will
35
+ * be the edges `next` and `nextOnCircle`, etc. `getChildren` allows one to
36
+ * easily traverse the MAT tree - see e.g. the implementation of `traverseEdges`.
37
37
  *
38
- * The getter, [[getVertexForwardChildren]], is similar to [[getChildren]] but returns the
38
+ * The getter, `getVertexForwardChildren`, is similar to `getChildren` but returns the
39
39
  * child nodes of the tree when `CpNode` is seen as a MAT vertex point (as
40
40
  * opposed to edge). In this way the dual graph of the tree can easily be
41
- * traversed - see e.g. [[traverseVertices]]. Generally, however, traversing the
41
+ * traversed - see e.g. `traverseVertices`. Generally, however, traversing the
42
42
  * edges is preferred as it returns the entire Medial Axis (by utilizing
43
- * [[getMatCurveToNext]] on each returned edge).
43
+ * `getMatCurveToNext` on each returned edge).
44
44
  *
45
45
  * It may be worth mentioning that by traversing from the CpNode by following
46
- * [[next]] repeatedly until one is back at the same CpNode allows one
46
+ * `next` repeatedly until one is back at the same CpNode allows one
47
47
  * to 'go around' the shape boundary and at the same time traverse the MAT twice
48
48
  * in opposite directions.
49
49
  */
@@ -9,5 +9,5 @@ import type { CpNode } from '../cp-node.js';
9
9
  *
10
10
  * @param cpNode
11
11
  */
12
- declare function getBoundaryBezierPartsToNext(cpNode: CpNode): BezierPiece[] | undefined;
12
+ declare function getBoundaryBezierPartsToNext(cpNode: CpNode): BezierPiece[];
13
13
  export { getBoundaryBezierPartsToNext };
@@ -17,36 +17,31 @@ function getBoundaryBezierPartsToNext(cpNode) {
17
17
  if (curveThis.loop !== curveNext.loop) {
18
18
  // It is a hole-closer going over to the other loop - a kind of terminal
19
19
  // CpNode.
20
- return undefined;
20
+ // return undefined;
21
+ return [];
21
22
  }
22
23
  const bezierPieces = [];
23
24
  if (curveNext === curveThis) {
24
- bezierPieces.push({
25
- ps: posThis.curve.ps,
26
- ts: [posThis.t, posNext.t]
27
- });
25
+ bezierPieces.push({ ps: posThis.curve.ps, ts: [posThis.t, posNext.t] });
28
26
  }
29
27
  else {
30
- bezierPieces.push({
31
- ps: posThis.curve.ps,
32
- ts: [posThis.t, 1]
33
- });
34
- addSkippedBeziers(bezierPieces, posThis.curve, posNext.curve, posNext.t);
28
+ bezierPieces.push({ ps: posThis.curve.ps, ts: [posThis.t, 1] });
29
+ addSkippedBezierPiecess(bezierPieces, posThis.curve, posNext.curve, posNext.t);
35
30
  }
36
31
  return bezierPieces;
37
32
  }
38
33
  /**
39
- * @internal
40
34
  * Adds pieces of skipped beziers.
35
+ * @internal
41
36
  */
42
- function addSkippedBeziers(bezierPieces, curveStart, curveEnd, t1) {
37
+ function addSkippedBezierPiecess(bezierPieces, curveStart, curveEnd, t1) {
43
38
  let curveThis = curveStart;
44
39
  do {
45
40
  curveThis = curveThis.next;
46
- const bezierPart = curveThis === curveEnd
47
- ? { ps: curveThis.ps, ts: [0, t1] }
48
- : { ps: curveThis.ps, ts: [0, 1] };
49
- bezierPieces.push(bezierPart);
41
+ const tEnd = curveThis === curveEnd ? t1 : 1;
42
+ bezierPieces.push({
43
+ ps: curveThis.ps, ts: [0, tEnd]
44
+ });
50
45
  } while (curveThis !== curveEnd);
51
46
  }
52
47
  export { getBoundaryBezierPartsToNext };
@@ -1 +1 @@
1
- {"version":3,"file":"get-boundary-bezier-parts-to-next.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-boundary-bezier-parts-to-next.ts"],"names":[],"mappings":"AAKA;;;;;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,CAAC,CAAC,CAAC,EAAE,CACvD,CAAC;IACN,CAAC;SAAM,CAAC;QACJ,YAAY,CAAC,IAAI,CACb,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAC/C,CAAC;QAEF,uBAAuB,CACnB,YAAY,EACZ,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,CAAC,CACZ,CAAC;IACN,CAAC;IAED,OAAO,YAAY,CAAC;AACxB,CAAC;AAGD;;;GAGG;AACH,SAAS,uBAAuB,CACxB,YAA2B,EAC3B,UAAiB,EACjB,QAAe,EACf,EAAU;IAEd,IAAI,SAAS,GAAG,UAAU,CAAC;IAC3B,GAAG,CAAC;QACA,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;QAC3B,MAAM,IAAI,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7C,YAAY,CAAC,IAAI,CAAC;YACd,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC;SAClC,CAAC,CAAC;IACP,CAAC,QAAQ,SAAS,KAAK,QAAQ,EAAE;AACrC,CAAC;AAGD,OAAO,EAAE,4BAA4B,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
- import { cpNodesToBoundaryBeziers } from "./cp-nodes-to-boundary-beziers.js";
2
1
  import { getAllBetween } from "./get-all-between.js";
2
+ import { getBoundaryBeziersToNext } from "./get-boundary-beziers-to-next.js";
3
3
  /**
4
4
  * Returns all `CpNode`s between the two given ones (inclusive).
5
5
  *
@@ -12,11 +12,9 @@ import { getAllBetween } from "./get-all-between.js";
12
12
  * include all `CpNode`s around the loop, otherwise include none.
13
13
  */
14
14
  function getBoundaryBeziersBetween(cpNode1, cpNode2, inclAllIfEqual = true) {
15
- const allBetween = getAllBetween(cpNode1, cpNode2, inclAllIfEqual);
16
- return {
17
- pss: cpNodesToBoundaryBeziers(allBetween.cpNodes),
18
- hasHoleCloser: allBetween.hasHoleCloser
19
- };
15
+ const { cpNodes, hasHoleCloser } = getAllBetween(cpNode1, cpNode2, inclAllIfEqual);
16
+ const pss = cpNodes.flatMap(getBoundaryBeziersToNext);
17
+ return { pss, hasHoleCloser };
20
18
  }
21
19
  export { getBoundaryBeziersBetween };
22
20
  //# sourceMappingURL=get-boundary-beziers-between.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-boundary-beziers-between.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-boundary-beziers-between.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;;;;;;;;GAUG;AACH,SAAS,yBAAyB,CAC1B,OAAe,EACf,OAAe,EACf,cAAc,GAAG,IAAI;IAKzB,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,EAAC,OAAO,EAAC,cAAc,CAAC,CAAC;IAEjE,OAAO;QACH,GAAG,EAAE,wBAAwB,CAAC,UAAU,CAAC,OAAO,CAAC;QACjD,aAAa,EAAE,UAAU,CAAC,aAAa;KAC1C,CAAA;AACL,CAAC;AAGD,OAAO,EAAE,yBAAyB,EAAE,CAAA"}
1
+ {"version":3,"file":"get-boundary-beziers-between.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-boundary-beziers-between.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAG7E;;;;;;;;;;GAUG;AACH,SAAS,yBAAyB,CAC1B,OAAe,EACf,OAAe,EACf,cAAc,GAAG,IAAI;IAKzB,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAC5B,aAAa,CAAC,OAAO,EAAC,OAAO,EAAC,cAAc,CAAC,CAAC;IAElD,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAEtD,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,CAAA;AACjC,CAAC;AAGD,OAAO,EAAE,yBAAyB,EAAE,CAAA"}
@@ -1,3 +1,12 @@
1
- import { CpNode } from '../cp-node.js';
1
+ import type { CpNode } from '../cp-node.js';
2
+ /**
3
+ // * Returns the boundary beziers between this `CpNode` and the next
4
+ // * one.
5
+ // *
6
+ // * * returns `[]` if the next `CpNode` is on a different loop,
7
+ // * as this is a hole-closer and there are no boundary beziers between them.
8
+ // *
9
+ // * @param cpNode
10
+ // */
2
11
  declare function getBoundaryBeziersToNext(cpNode: CpNode): number[][][];
3
12
  export { getBoundaryBeziersToNext };