flo-mat 4.0.1 → 4.0.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.
- package/README.md +1 -1
- package/__tests__/find-2-prong/get-medial/get-closest-points.spec.ts +49 -0
- package/__tests__/specific-cases/specific-cases.spec.ts +6 -0
- package/browser/index.js +9994 -12650
- package/browser/index.min.js +1 -1
- package/node/closest-boundary-point/foot-and-endpoint-info.d.ts +0 -3
- package/node/closest-boundary-point/get-close-boundary-points-certified.d.ts +1 -1
- package/node/closest-boundary-point/get-close-boundary-points-certified.js +2 -2
- package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -1
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.d.ts +1 -2
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js +34 -24
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js.map +1 -1
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.d.ts +1 -1
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js +6 -9
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js.map +1 -1
- package/node/cp-node/fs/insert-cp-node.d.ts +2 -2
- package/node/cp-node/fs/insert-cp-node.js.map +1 -1
- package/node/cp-node/fs/is-on-same-loop.d.ts +3 -0
- package/node/cp-node/fs/is-on-same-loop.js +6 -0
- package/node/cp-node/fs/is-on-same-loop.js.map +1 -0
- package/node/cp-node/fs/is-order-correct.d.ts +2 -2
- package/node/cp-node/fs/is-order-correct.js.map +1 -1
- package/node/cp-node/fs/traverse-cp.js.map +1 -1
- package/node/cp-node/fs/traverse-vertices.d.ts +1 -1
- package/node/cp-node/fs/traverse-vertices.js.map +1 -1
- package/node/debug/debug.d.ts +10 -15
- package/node/debug/debug.js +35 -46
- package/node/debug/debug.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-branch.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-branch.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-cp-node.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-cp-node.js +2 -2
- package/node/debug/functions/draw-elem/draw-cp-node.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-leaves.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-leaves.js +2 -2
- package/node/debug/functions/draw-elem/draw-leaves.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-mat.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-mat.js +1 -2
- package/node/debug/functions/draw-elem/draw-mat.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-min-y.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-min-y.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-three-prong.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-three-prong.js +2 -2
- package/node/debug/functions/draw-elem/draw-three-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-vertex.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-vertex.js +0 -2
- package/node/debug/functions/draw-elem/draw-vertex.js.map +1 -1
- package/node/error-analysis/gamma.d.ts +32 -0
- package/node/error-analysis/gamma.js +39 -0
- package/node/error-analysis/gamma.js.map +1 -0
- package/node/find-2-prong/add-1-prong.js +1 -4
- package/node/find-2-prong/add-1-prong.js.map +1 -1
- package/node/find-2-prong/find-2-prong.js +5 -5
- package/node/find-2-prong/find-2-prong.js.map +1 -1
- package/node/find-2-prong/get-medial/get-closest-points.js +27 -23
- package/node/find-2-prong/get-medial/get-closest-points.js.map +1 -1
- package/node/find-3-prong/calc-better-x.d.ts +1 -1
- package/node/find-3-prong/calc-better-x.js +6 -4
- package/node/find-3-prong/calc-better-x.js.map +1 -1
- package/node/find-3-prong/calc-initial-3-prong-center.d.ts +1 -1
- package/node/find-3-prong/calc-initial-3-prong-center.js +4 -3
- package/node/find-3-prong/calc-initial-3-prong-center.js.map +1 -1
- package/node/find-3-prong/find-3-prong-for-delta3s.js +22 -5
- package/node/find-3-prong/find-3-prong-for-delta3s.js.map +1 -1
- package/node/find-3-prong/find-and-add-3-prong.d.ts +2 -2
- package/node/find-3-prong/find-and-add-3-prong.js +15 -0
- package/node/find-3-prong/find-and-add-3-prong.js.map +1 -1
- package/node/find-3-prong/find-and-add-3-prongs-on-loop.js +8 -21
- package/node/find-3-prong/find-and-add-3-prongs-on-loop.js.map +1 -1
- package/node/find-3-prong/find-and-add-3-prongs.d.ts +1 -4
- package/node/find-3-prong/find-and-add-3-prongs.js +1 -2
- package/node/find-3-prong/find-and-add-3-prongs.js.map +1 -1
- package/node/find-3-prong/get-closest-points.d.ts +1 -1
- package/node/find-3-prong/get-closest-points.js +2 -2
- package/node/find-3-prong/get-closest-points.js.map +1 -1
- package/node/find-3-prong/timed-cc.d.ts +3 -0
- package/node/find-3-prong/timed-cc.js +5 -0
- package/node/find-3-prong/timed-cc.js.map +1 -0
- package/node/find-mat/create-initial-cp-tree.d.ts +2 -2
- package/node/find-mat/create-initial-cp-tree.js +2 -2
- package/node/find-mat/create-initial-cp-tree.js.map +1 -1
- package/node/find-mat/find-mat.d.ts +4 -4
- package/node/find-mat/find-mat.js +1 -2
- package/node/find-mat/find-mat.js.map +1 -1
- package/node/find-mat/find-mats.js +2 -2
- package/node/find-mat/find-mats.js.map +1 -1
- package/node/find-mat/get-meta.d.ts +1 -6
- package/node/find-mat/get-meta.js +4 -25
- package/node/find-mat/get-meta.js.map +1 -1
- package/node/index.d.ts +5 -2
- package/node/index.js +4 -1
- package/node/index.js.map +1 -1
- package/node/mat/create-new-cp-trees.d.ts +2 -2
- package/node/mat/create-new-cp-trees.js +2 -2
- package/node/mat/create-new-cp-trees.js.map +1 -1
- package/node/mat/get-cp-node-to-left-or-same.d.ts +2 -2
- package/node/mat/get-cp-node-to-left-or-same.js +2 -1
- package/node/mat/get-cp-node-to-left-or-same.js.map +1 -1
- package/node/mat/mat-meta.d.ts +2 -2
- package/node/point-on-shape/get-osculating-circle.js +2 -1
- package/node/point-on-shape/get-osculating-circle.js.map +1 -1
- package/node/reconstruct-from-mat/filter-zero-length.d.ts +10 -0
- package/node/reconstruct-from-mat/filter-zero-length.js +14 -0
- package/node/reconstruct-from-mat/filter-zero-length.js.map +1 -0
- package/node/reconstruct-from-mat/get-all-on-loop-by-loop.d.ts +7 -0
- package/node/reconstruct-from-mat/get-all-on-loop-by-loop.js +38 -0
- package/node/reconstruct-from-mat/get-all-on-loop-by-loop.js.map +1 -0
- package/node/reconstruct-from-mat/get-bezier-piece-length.d.ts +3 -0
- package/node/reconstruct-from-mat/get-bezier-piece-length.js +6 -0
- package/node/reconstruct-from-mat/get-bezier-piece-length.js.map +1 -0
- package/node/reconstruct-from-mat/get-boundary.d.ts +7 -0
- package/node/reconstruct-from-mat/get-boundary.js +18 -0
- package/node/reconstruct-from-mat/get-boundary.js.map +1 -0
- package/node/reconstruct-from-mat/get-cp-nodess-for-sat.d.ts +4 -0
- package/node/reconstruct-from-mat/get-cp-nodess-for-sat.js +15 -0
- package/node/reconstruct-from-mat/get-cp-nodess-for-sat.js.map +1 -0
- package/node/reconstruct-from-mat/get-matching-beziers.d.ts +10 -0
- package/node/reconstruct-from-mat/get-matching-beziers.js +29 -0
- package/node/reconstruct-from-mat/get-matching-beziers.js.map +1 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.d.ts +6 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.js +10 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-per-sat.js.map +1 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.d.ts +7 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.js +47 -0
- package/node/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.js.map +1 -0
- package/node/reconstruct-from-mat/get-sats2.d.ts +10 -0
- package/node/reconstruct-from-mat/get-sats2.js +16 -0
- package/node/reconstruct-from-mat/get-sats2.js.map +1 -0
- package/node/reconstruct-from-mat/is-fully-terminating.d.ts +3 -0
- package/node/reconstruct-from-mat/is-fully-terminating.js +19 -0
- package/node/reconstruct-from-mat/is-fully-terminating.js.map +1 -0
- package/node/reconstruct-from-mat/matched-beziers.d.ts +10 -0
- package/node/reconstruct-from-mat/matched-beziers.js +2 -0
- package/node/reconstruct-from-mat/matched-beziers.js.map +1 -0
- package/node/reconstruct-from-mat/reconstruct-from-mat.d.ts +4 -0
- package/node/reconstruct-from-mat/reconstruct-from-mat.js +28 -0
- package/node/reconstruct-from-mat/reconstruct-from-mat.js.map +1 -0
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.d.ts +12 -0
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js +46 -0
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js.map +1 -0
- package/node/reconstruct-from-mat/split-tri-path.d.ts +5 -0
- package/node/reconstruct-from-mat/split-tri-path.js +209 -0
- package/node/reconstruct-from-mat/split-tri-path.js.map +1 -0
- package/node/sat/add-debug-info.js +1 -2
- package/node/sat/add-debug-info.js.map +1 -1
- package/node/utils/clip.d.ts +2 -0
- package/node/utils/clip.js +6 -0
- package/node/utils/clip.js.map +1 -0
- package/package.json +6 -7
- package/src/closest-boundary-point/foot-and-endpoint-info.ts +0 -3
- package/src/closest-boundary-point/get-close-boundary-points-certified.ts +0 -2
- package/src/closest-boundary-point/get-potential-closest-points-on-curve-certified.ts +41 -27
- package/src/closest-boundary-point/root-interval-to-distance-squared-interval.ts +5 -10
- package/src/cp-node/fs/insert-cp-node.ts +2 -2
- package/src/cp-node/fs/is-on-same-loop.ts +15 -0
- package/src/cp-node/fs/is-order-correct.ts +2 -2
- package/src/cp-node/fs/traverse-cp.ts +1 -1
- package/src/cp-node/fs/traverse-vertices.ts +1 -2
- package/src/debug/debug.ts +54 -72
- package/src/debug/functions/check-ordering.ts +0 -1
- package/src/debug/functions/draw-elem/draw-branch.ts +1 -3
- package/src/debug/functions/draw-elem/draw-cp-node.ts +3 -4
- package/src/debug/functions/draw-elem/draw-leaves.ts +3 -3
- package/src/debug/functions/draw-elem/draw-mat.ts +2 -5
- package/src/debug/functions/draw-elem/draw-min-y.ts +2 -2
- package/src/debug/functions/draw-elem/draw-three-prong.ts +3 -3
- package/src/debug/functions/draw-elem/draw-vertex.ts +1 -4
- package/src/error-analysis/gamma.ts +9 -2
- package/src/find-2-prong/add-1-prong.ts +1 -5
- package/src/find-2-prong/find-2-prong.ts +7 -6
- package/src/find-2-prong/get-medial/get-closest-points.ts +24 -26
- package/src/find-3-prong/calc-better-x.ts +7 -4
- package/src/find-3-prong/calc-initial-3-prong-center.ts +2 -3
- package/src/find-3-prong/find-3-prong-for-delta3s.ts +23 -5
- package/src/find-3-prong/find-and-add-3-prong.ts +18 -4
- package/src/find-3-prong/find-and-add-3-prongs-on-loop.ts +7 -23
- package/src/find-3-prong/find-and-add-3-prongs.ts +5 -3
- package/src/find-3-prong/get-closest-points.ts +0 -2
- package/src/find-3-prong/timed-cc.ts +9 -0
- package/src/find-mat/create-initial-cp-tree.ts +3 -3
- package/src/find-mat/find-mat.ts +6 -8
- package/src/find-mat/find-mats.ts +4 -2
- package/src/find-mat/get-meta.ts +3 -38
- package/src/index.ts +6 -3
- package/src/mat/create-new-cp-trees.ts +3 -3
- package/src/mat/get-cp-node-to-left-or-same.ts +4 -3
- package/src/mat/mat-meta.ts +2 -2
- package/src/point-on-shape/get-osculating-circle.ts +2 -1
- package/src/reconstruct-from-mat/filter-zero-length.ts +23 -0
- package/src/reconstruct-from-mat/get-all-on-loop-by-loop.ts +52 -0
- package/src/reconstruct-from-mat/get-bezier-piece-length.ts +12 -0
- package/src/reconstruct-from-mat/get-boundary.ts +32 -0
- package/src/reconstruct-from-mat/get-cp-nodess-for-sat.ts +24 -0
- package/src/reconstruct-from-mat/get-matching-beziers.ts +46 -0
- package/src/reconstruct-from-mat/get-mbss-by-loop-per-sat.ts +19 -0
- package/src/reconstruct-from-mat/get-mbss-by-loop-with-opp-arr.ts +69 -0
- package/src/reconstruct-from-mat/get-sats2.ts +25 -0
- package/src/reconstruct-from-mat/is-fully-terminating.ts +27 -0
- package/src/reconstruct-from-mat/matched-beziers.ts +14 -0
- package/src/reconstruct-from-mat/reconstruct-from-mat.ts +45 -0
- package/src/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.ts +62 -0
- package/src/reconstruct-from-mat/split-tri-path.ts +280 -0
- package/src/sat/add-debug-info.ts +1 -2
- package/src/utils/clip.ts +13 -0
- package/wallaby.mjs +1 -0
- package/node/closest-boundary-point/get-p-from-box.d.ts +0 -3
- package/node/closest-boundary-point/get-p-from-box.js +0 -11
- package/node/closest-boundary-point/get-p-from-box.js.map +0 -1
- package/node/debug/functions/general.d.ts +0 -48
- package/node/debug/functions/general.js +0 -53
- package/node/debug/functions/general.js.map +0 -1
- package/node/point-on-shape/pos-to-human-string.d.ts +0 -8
- package/node/point-on-shape/pos-to-human-string.js +0 -12
- package/node/point-on-shape/pos-to-human-string.js.map +0 -1
- package/src/debug/elem-type-two-prong.ts +0 -8
- package/src/debug/functions/cmp-cp-on-delta.ts +0 -54
- package/src/debug/functions/general.ts +0 -79
- package/src/debug/functions/three-prong.ts +0 -249
- package/src/debug/functions/two-prong.ts +0 -203
- package/src/find-2-prong/add-debug-info.ts +0 -45
|
@@ -21,7 +21,6 @@ function findAndAdd3Prongs(meta, cpStart) {
|
|
|
21
21
|
return { closeBysFor3Prong: undefined, addedCpNodes: [] };
|
|
22
22
|
}
|
|
23
23
|
const addedCpNodes = [];
|
|
24
|
-
let closeBysFor3Prong = undefined;
|
|
25
24
|
do {
|
|
26
25
|
if (cpStart === undefined) {
|
|
27
26
|
continue;
|
|
@@ -41,7 +40,7 @@ function findAndAdd3Prongs(meta, cpStart) {
|
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
} while (true);
|
|
44
|
-
return { closeBysFor3Prong, addedCpNodes };
|
|
43
|
+
return { closeBysFor3Prong: undefined, addedCpNodes };
|
|
45
44
|
}
|
|
46
45
|
export { findAndAdd3Prongs };
|
|
47
46
|
//# sourceMappingURL=find-and-add-3-prongs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-and-add-3-prongs.js","sourceRoot":"","sources":["../../src/find-3-prong/find-and-add-3-prongs.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D,IAAI,EAAE,GAAG,CAAC,CAAC;AACX;;;;;;;;;;;;;GAaG;AACH,SAAS,iBAAiB,CAClB,IAAa,EACb,OAAe;
|
|
1
|
+
{"version":3,"file":"find-and-add-3-prongs.js","sourceRoot":"","sources":["../../src/find-3-prong/find-and-add-3-prongs.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D,IAAI,EAAE,GAAG,CAAC,CAAC;AACX;;;;;;;;;;;;;GAaG;AACH,SAAS,iBAAiB,CAClB,IAAa,EACb,OAAe;IAKnB,IAAI,gBAAgB,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACzC,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IAC9D,CAAC;IAED,MAAM,YAAY,GAAe,EAAE,CAAC;IACpC,GAAG,CAAC;QACA,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAAC,SAAS;QAAC,CAAC;QACxC,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QAEvC,IAAI,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YAAC,MAAM;QAAC,CAAC;QAEtC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,gBAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAE1E,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3B,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/B,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC;QAC/C,CAAC;QAED,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;YACjC,IAAI,EAAE,EAAE,KAAK,OAAO,CAAC,UAAU,CAAC,uBAAuB,EAAE,CAAC;gBACtD,OAAO,SAAU,CAAC;YACtB,CAAC;QACL,CAAC;IACL,CAAC,QAAQ,IAAI,EAAE;IAEf,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;AAC1D,CAAC;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -6,5 +6,5 @@ import type { CurvePiece } from '../mat/curve-piece.js';
|
|
|
6
6
|
*
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
declare function getClosestPoints(
|
|
9
|
+
declare function getClosestPoints(x: number[], curvePiece3s: CurvePiece[][]): import("../point-on-shape/point-on-shape.js").PrePointOnShape[];
|
|
10
10
|
export { getClosestPoints };
|
|
@@ -6,9 +6,9 @@ import { getCloseBoundaryPointsCertified } from '../closest-boundary-point/get-c
|
|
|
6
6
|
*
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
function getClosestPoints(
|
|
9
|
+
function getClosestPoints(x, curvePiece3s) {
|
|
10
10
|
return curvePiece3s.map(curvePieces => {
|
|
11
|
-
return getCloseBoundaryPointsCertified(
|
|
11
|
+
return getCloseBoundaryPointsCertified(curvePieces, x)[0];
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
export { getClosestPoints };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-closest-points.js","sourceRoot":"","sources":["../../src/find-3-prong/get-closest-points.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,kEAAkE,CAAC;AAGnH;;;;;;GAMG;AACH,SAAS,gBAAgB,CACjB,
|
|
1
|
+
{"version":3,"file":"get-closest-points.js","sourceRoot":"","sources":["../../src/find-3-prong/get-closest-points.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,kEAAkE,CAAC;AAGnH;;;;;;GAMG;AACH,SAAS,gBAAgB,CACjB,CAAW,EACX,YAA4B;IAEhC,OAAO,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;QAClC,OAAO,+BAA+B,CAClC,WAAW,EACX,CAAC,CACJ,CAAC,CAAC,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;AACP,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timed-cc.js","sourceRoot":"","sources":["../../src/find-3-prong/timed-cc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI5C,4DAA4D;AAC5D,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAGtC,OAAO,EAAE,gBAAgB,IAAI,YAAY,EAAE,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Loop } from 'flo-boolean';
|
|
2
2
|
import type { CpNode } from '../cp-node/cp-node.js';
|
|
3
3
|
import type { PrePointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
4
|
-
import {
|
|
4
|
+
import { RbTree } from 'flo-ll-rb-tree';
|
|
5
5
|
/**
|
|
6
6
|
* Creates the initial ContactPoint loops from the given sharp corners.
|
|
7
7
|
*
|
|
@@ -16,5 +16,5 @@ import { LlRbTree } from 'flo-ll-rb-tree';
|
|
|
16
16
|
*/
|
|
17
17
|
declare function createInitialCpTree(loops: Loop[], sharpCornerss: PrePointOnShape[][], lastInsertId: {
|
|
18
18
|
id: number;
|
|
19
|
-
}): Map<Loop,
|
|
19
|
+
}): Map<Loop, RbTree<CpNode>>;
|
|
20
20
|
export { createInitialCpTree };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RbTree } from 'flo-ll-rb-tree';
|
|
2
2
|
import { insertCpNode } from '../cp-node/fs/insert-cp-node.js';
|
|
3
3
|
import { cpNodeComparator } from '../cp-node/fs/cp-node-comparator.js';
|
|
4
4
|
/**
|
|
@@ -16,7 +16,7 @@ import { cpNodeComparator } from '../cp-node/fs/cp-node-comparator.js';
|
|
|
16
16
|
function createInitialCpTree(loops, sharpCornerss, lastInsertId) {
|
|
17
17
|
const cpTrees = new Map();
|
|
18
18
|
for (let k = 0; k < sharpCornerss.length; k++) {
|
|
19
|
-
const cpTree = new
|
|
19
|
+
const cpTree = new RbTree(cpNodeComparator);
|
|
20
20
|
cpTrees.set(loops[k], cpTree);
|
|
21
21
|
const sharpCorners = sharpCornerss[k];
|
|
22
22
|
let cpNode1 = undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-initial-cp-tree.js","sourceRoot":"","sources":["../../src/find-mat/create-initial-cp-tree.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create-initial-cp-tree.js","sourceRoot":"","sources":["../../src/find-mat/create-initial-cp-tree.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAGvE;;;;;;;;;;;GAWG;AACH,SAAS,mBAAmB,CACpB,KAAa,EACb,aAAkC,EAClC,YAA4B;IAEhC,MAAM,OAAO,GAA8B,IAAI,GAAG,EAAE,CAAC;IAErD,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,aAAa,CAAC,MAAM,EAA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,GAAG,OAAO,CAAC;QACnC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAGD,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CpNode } from '../cp-node/cp-node.js';
|
|
2
|
-
import { Loop } from 'flo-boolean';
|
|
3
|
-
import { MatOptions } from './mat-options.js';
|
|
4
|
-
import { MatMeta } from '../mat/mat-meta.js';
|
|
1
|
+
import type { CpNode } from '../cp-node/cp-node.js';
|
|
2
|
+
import type { Loop } from 'flo-boolean';
|
|
3
|
+
import type { MatOptions } from './mat-options.js';
|
|
4
|
+
import type { MatMeta } from '../mat/mat-meta.js';
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
* Find the MAT of the given loops.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findAndAdd3ProngsOnLoop } from '../find-3-prong/find-and-add-3-prongs-on-loop.js';
|
|
2
2
|
import { createInitialCpTree } from './create-initial-cp-tree.js';
|
|
3
|
-
import {
|
|
3
|
+
import { getPartialMeta, addDebugInfo2, addDebugInfo3, addDebugInfo4 } from './get-meta.js';
|
|
4
4
|
import { getSharpCornersOnLoop } from './get-sharp-corners.js';
|
|
5
5
|
import { getDullCornersOnLoop } from './get-dull-corners-on-loop.js';
|
|
6
6
|
import { findAndAdd2ProngsOnAllLoops } from '../find-2-prong/find-and-add-2-prongs-on-all-loops.js';
|
|
@@ -27,7 +27,6 @@ function findMat(loops, maxCoordPowerOf2, options) {
|
|
|
27
27
|
const lastInsertId = { id: 0 };
|
|
28
28
|
const cpTrees = createInitialCpTree(loops, sharpCornersPerLoop, lastInsertId);
|
|
29
29
|
const _meta = getPartialMeta(loops);
|
|
30
|
-
const pointToCpNode = getPointToCpNode(loops, cpTrees);
|
|
31
30
|
const meta = {
|
|
32
31
|
maxCoordPowerOf2, squaredDiagonalLength, loops, cpTrees, // pointToCpNode,
|
|
33
32
|
lastInsertId, ..._meta
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-mat.js","sourceRoot":"","sources":["../../src/find-mat/find-mat.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"find-mat.js","sourceRoot":"","sources":["../../src/find-mat/find-mat.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,uDAAuD,CAAC;AACrG,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG5D;;;;;GAKG;AACH,SAAS,OAAO,CACR,KAAa,EACb,gBAAwB,EACxB,OAA6B;IAKjC,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IAE1E,MAAM,sBAAsB,GAAG,qBAAqB,CAAC,YAAY,CAAC,CAAC;IACnE,MAAM,qBAAqB,GAAG,oBAAoB,CAAC,YAAY,CAAC,CAAC;IACjE,MAAM,oBAAoB,GAAG,mBAAmB,CAAC,YAAY,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;IACxF,MAAM,oBAAoB,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAE/D,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IAC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IAC1D,MAAM,GAAG,2BAA2B,CAAC,IAAI,EAAE,cAAc,EAAE,iBAAiB,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC;IAE9F,MAAM,iBAAiB,GAAG,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC1D,MAAM,GAAG,2BAA2B,CAAC,IAAI,EAAE,cAAc,EAAE,iBAAiB,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC;IAE/F,aAAa,EAAE,CAAC;IAEhB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;QACjC,IAAI,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAC;YAAC,OAAO,EAAE,MAAM,EAAE,MAAO,EAAE,IAAI,EAAE,CAAC;QAAC,CAAC;IACpF,CAAC;IAED,MAAM,GAAG,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAE/C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QAAC,OAAO,SAAU,CAAC;IAAC,CAAC;IAEhD,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;QACjC,IAAI,OAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC;YAAC,OAAO,EAAE,MAAM,EAAE,MAAO,EAAE,IAAI,EAAE,CAAC;QAAC,CAAC;IACtF,CAAC;IAED,gEAAgE;IAEhE,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAE7B,aAAa,EAAE,CAAC;IAEhB,OAAO,GAAG,CAAC;AACf,CAAC;AAGD,OAAO,EAAE,OAAO,EAAE,CAAA;AAIlB,wCAAwC;AACxC,mDAAmD;AACnD,8CAA8C"}
|
|
@@ -55,8 +55,8 @@ function findMats(bezierLoops, options) {
|
|
|
55
55
|
}
|
|
56
56
|
mats.push(mat);
|
|
57
57
|
}
|
|
58
|
-
// console.log(structuredClone(
|
|
59
|
-
//
|
|
58
|
+
// console.log(structuredClone(circumCenter.getStats()));
|
|
59
|
+
// circumCenter.resetStats();
|
|
60
60
|
return mats;
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-mats.js","sourceRoot":"","sources":["../../src/find-mat/find-mats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAG,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAc,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"find-mats.js","sourceRoot":"","sources":["../../src/find-mat/find-mats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAG,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAc,MAAM,kBAAkB,CAAC;AAIjE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;AAG5B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAS,QAAQ,CACT,WAA2B,EAC3B,OAAoB;IAExB,+EAA+E;IAC/E,MAAM,EAAE,aAAa,EAAE,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;IACvD,MAAM,gBAA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C;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import type { Loop } from 'flo-boolean';
|
|
2
|
-
import type { CpNode } from '../cp-node/cp-node.js';
|
|
3
|
-
import type { TriMap } from '../utils/tri-map.js';
|
|
4
2
|
import type { MatMeta } from '../mat/mat-meta.js';
|
|
5
|
-
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
6
|
-
/** @internal */
|
|
7
|
-
declare function getPointToCpNode(loops: Loop[], cpTrees: Map<Loop, LlRbTree<CpNode>>): TriMap<Loop, number, number, CpNode>;
|
|
8
3
|
/** @internal */
|
|
9
4
|
declare function getPartialMeta(loops: Loop[]): Omit<MatMeta, 'cpTrees' | 'loops' | 'maxCoordPowerOf2' | 'squaredDiagonalLength' | 'lastInsertId'>;
|
|
10
5
|
/** @internal */
|
|
11
6
|
declare function addDebugInfo2(): void;
|
|
12
7
|
declare function addDebugInfo3(): void;
|
|
13
8
|
declare function addDebugInfo4(): void;
|
|
14
|
-
export {
|
|
9
|
+
export { getPartialMeta, addDebugInfo2, addDebugInfo3, addDebugInfo4 };
|
|
@@ -3,22 +3,6 @@ import { getBoundingBox$ } from '../geometry/get-bounding-box-.js';
|
|
|
3
3
|
import { getCorner } from '../corner/get-corner.js';
|
|
4
4
|
let timingStart;
|
|
5
5
|
/** @internal */
|
|
6
|
-
function getPointToCpNode(loops, cpTrees) {
|
|
7
|
-
timingStart = performance.now();
|
|
8
|
-
// const pointToCpNode: TriMap<Loop,number,number,CpNode> = new Map();
|
|
9
|
-
// for (const loop of loops) {
|
|
10
|
-
// // Populate `posMap`
|
|
11
|
-
// const cpTree = cpTrees.get(loop)!;
|
|
12
|
-
// const cpNodes = cpTree.toArrayInOrder();
|
|
13
|
-
// for (const cpNode of cpNodes) {
|
|
14
|
-
// const { p, t } = cpNode.pointOnShape;
|
|
15
|
-
// TriMapFs.set(pointToCpNode,loop,p[0],p[1],cpNode);
|
|
16
|
-
// }
|
|
17
|
-
// }
|
|
18
|
-
// return pointToCpNode;
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
/** @internal */
|
|
22
6
|
function getPartialMeta(loops) {
|
|
23
7
|
const looseBoundingBoxes = [];
|
|
24
8
|
const tightBoundingBoxes = [];
|
|
@@ -56,28 +40,23 @@ function addDebugInfo2() {
|
|
|
56
40
|
if (typeof _debug_ === 'undefined') {
|
|
57
41
|
return;
|
|
58
42
|
}
|
|
59
|
-
const timing = _debug_.generated.timing;
|
|
60
43
|
const now = performance.now();
|
|
61
|
-
timing.holeClosers += now - timingStart;
|
|
44
|
+
_debug_.timing.holeClosers += now - timingStart;
|
|
62
45
|
timingStart = now;
|
|
63
46
|
}
|
|
64
47
|
function addDebugInfo3() {
|
|
65
48
|
if (typeof _debug_ === 'undefined') {
|
|
66
49
|
return;
|
|
67
50
|
}
|
|
68
|
-
const generated = _debug_.generated;
|
|
69
|
-
const timing = generated.timing;
|
|
70
51
|
const now = performance.now();
|
|
71
|
-
timing.oneAnd2Prongs += now - timingStart;
|
|
52
|
+
_debug_.timing.oneAnd2Prongs += now - timingStart;
|
|
72
53
|
timingStart = now;
|
|
73
54
|
}
|
|
74
55
|
function addDebugInfo4() {
|
|
75
56
|
if (typeof _debug_ === 'undefined') {
|
|
76
57
|
return;
|
|
77
58
|
}
|
|
78
|
-
|
|
79
|
-
const timing = generated.timing;
|
|
80
|
-
timing.threeProngs += performance.now() - timingStart;
|
|
59
|
+
_debug_.timing.threeProngs += performance.now() - timingStart;
|
|
81
60
|
}
|
|
82
|
-
export {
|
|
61
|
+
export { getPartialMeta, addDebugInfo2, addDebugInfo3, addDebugInfo4 };
|
|
83
62
|
//# sourceMappingURL=get-meta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-meta.js","sourceRoot":"","sources":["../../src/find-mat/get-meta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-meta.js","sourceRoot":"","sources":["../../src/find-mat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C,KAAK,CAAC,CAAC;YAC5B,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO;QACH,kBAAkB;QAClB,kBAAkB;QAClB,aAAa;QACb,YAAY;QACZ,WAAW;KACd,CAAA;AACL,CAAC;AAGD,gBAAgB;AAChB,SAAS,aAAa;IAClB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;QAAC,OAAO;IAAC,CAAC;IAE/C,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAC9B,OAAO,CAAC,MAAM,CAAC,WAAW,IAAI,GAAG,GAAG,WAAW,CAAC;IAChD,WAAW,GAAG,GAAG,CAAC;AACtB,CAAC;AAGD,SAAS,aAAa;IAClB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;QAAC,OAAO;IAAC,CAAC;IAE/C,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAE9B,OAAO,CAAC,MAAM,CAAC,aAAa,IAAI,GAAG,GAAG,WAAW,CAAC;IAClD,WAAW,GAAG,GAAG,CAAC;AACtB,CAAC;AAGD,SAAS,aAAa;IAClB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;QAAC,OAAO;IAAC,CAAC;IAE/C,OAAO,CAAC,MAAM,CAAC,WAAW,IAAI,WAAW,CAAC,GAAG,EAAE,GAAG,WAAW,CAAC;AAClE,CAAC;AAGD,OAAO,EACH,cAAc,EACd,aAAa,EACb,aAAa,EACb,aAAa,EAChB,CAAA"}
|
package/node/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type { PointOnShape } from './point-on-shape/point-on-shape.js';
|
|
|
7
7
|
export type { Circle } from './geometry/circle.js';
|
|
8
8
|
export type { CurvePiece } from './mat/curve-piece.js';
|
|
9
9
|
export type { DrawElemFunctions } from './debug/functions/draw-elem/draw-elem.js';
|
|
10
|
-
export type { ITiming } from './debug/debug.js';
|
|
10
|
+
export type { Timing as ITiming } from './debug/debug.js';
|
|
11
11
|
export type { DebugElems } from './debug/debug-elem-types.js';
|
|
12
12
|
export type { Debug } from './debug/debug.js';
|
|
13
13
|
export type { DebugElemKey } from './debug/debug-elem-types.js';
|
|
@@ -39,7 +39,7 @@ export { getSharpCornersOnLoop } from './find-mat/get-sharp-corners.js';
|
|
|
39
39
|
export { getFor2ProngsOnLoop } from './find-mat/get-for-2-prongs-on-loop.js';
|
|
40
40
|
export { getPotentialClosestPointsOnCurveCertified } from './closest-boundary-point/get-potential-closest-points-on-curve-certified.js';
|
|
41
41
|
export { getCloseBoundaryPointsCertified } from './closest-boundary-point/get-close-boundary-points-certified.js';
|
|
42
|
-
export { getPartialMeta
|
|
42
|
+
export { getPartialMeta } from './find-mat/get-meta.js';
|
|
43
43
|
export { findAndAddHoleClosing2Prongs } from './find-2-prong/find-and-add-hole-closing-2-prongs.js';
|
|
44
44
|
export { getChildren } from './cp-node/fs/get-children.js';
|
|
45
45
|
export { getVertexForwardChildren } from './cp-node/fs/get-vertex-forward-children.js';
|
|
@@ -75,3 +75,6 @@ export { getHoleClosers } from './cp-node/fs/get-hole-closers.js';
|
|
|
75
75
|
export { getInitialDegAngleBetweenMatCurves } from './cp-node/fs/get-angle-between-mat-curves.js';
|
|
76
76
|
export { getAllVertices } from './cp-node/fs/get-all-vertices.js';
|
|
77
77
|
export { isTrivial } from './cp-node/fs/is-trivial.js';
|
|
78
|
+
export { scaleCircle } from './geometry/circle.js';
|
|
79
|
+
export { isOnSameLoop } from './cp-node/fs/is-on-same-loop.js';
|
|
80
|
+
export { reconstructFromMats } from './reconstruct-from-mat/reconstruct-from-mat.js';
|
package/node/index.js
CHANGED
|
@@ -26,7 +26,7 @@ export { getSharpCornersOnLoop } from './find-mat/get-sharp-corners.js';
|
|
|
26
26
|
export { getFor2ProngsOnLoop } from './find-mat/get-for-2-prongs-on-loop.js';
|
|
27
27
|
export { getPotentialClosestPointsOnCurveCertified } from './closest-boundary-point/get-potential-closest-points-on-curve-certified.js';
|
|
28
28
|
export { getCloseBoundaryPointsCertified } from './closest-boundary-point/get-close-boundary-points-certified.js';
|
|
29
|
-
export { getPartialMeta
|
|
29
|
+
export { getPartialMeta } from './find-mat/get-meta.js';
|
|
30
30
|
export { findAndAddHoleClosing2Prongs } from './find-2-prong/find-and-add-hole-closing-2-prongs.js';
|
|
31
31
|
// CpNodeFs functions
|
|
32
32
|
export { getChildren } from './cp-node/fs/get-children.js';
|
|
@@ -63,4 +63,7 @@ export { getHoleClosers } from './cp-node/fs/get-hole-closers.js';
|
|
|
63
63
|
export { getInitialDegAngleBetweenMatCurves } from './cp-node/fs/get-angle-between-mat-curves.js';
|
|
64
64
|
export { getAllVertices } from './cp-node/fs/get-all-vertices.js';
|
|
65
65
|
export { isTrivial } from './cp-node/fs/is-trivial.js';
|
|
66
|
+
export { scaleCircle } from './geometry/circle.js';
|
|
67
|
+
export { isOnSameLoop } from './cp-node/fs/is-on-same-loop.js';
|
|
68
|
+
export { reconstructFromMats } from './reconstruct-from-mat/reconstruct-from-mat.js';
|
|
66
69
|
//# sourceMappingURL=index.js.map
|
package/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAepF,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,uB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AE,4BAA4B,EAAE,MAAM,mDAAmD,CAAC;AACjG,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,kCAAkC,EAAE,MAAM,8CAA8C,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Loop } from 'flo-boolean';
|
|
2
2
|
import type { CpNode } from '../cp-node/cp-node.js';
|
|
3
|
-
import {
|
|
3
|
+
import { RbTree } from 'flo-ll-rb-tree';
|
|
4
4
|
/**
|
|
5
5
|
* @param cpNode
|
|
6
6
|
*
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
declare function createNewCpTrees(cpNode: CpNode): Map<Loop,
|
|
9
|
+
declare function createNewCpTrees(cpNode: CpNode): Map<Loop, RbTree<CpNode>>;
|
|
10
10
|
export { createNewCpTrees };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RbTree } from 'flo-ll-rb-tree';
|
|
2
2
|
import { cpNodeComparator } from '../cp-node/fs/cp-node-comparator.js';
|
|
3
3
|
import { getAllOnLoop } from '../cp-node/fs/get-all-on-loop.js';
|
|
4
4
|
/**
|
|
@@ -13,7 +13,7 @@ function createNewCpTrees(cpNode) {
|
|
|
13
13
|
const loop = cpNode.pointOnShape.curve.loop;
|
|
14
14
|
let cpTree = cpTrees_.get(loop);
|
|
15
15
|
if (!cpTree) {
|
|
16
|
-
cpTree = new
|
|
16
|
+
cpTree = new RbTree(cpNodeComparator);
|
|
17
17
|
cpTrees_.set(loop, cpTree);
|
|
18
18
|
}
|
|
19
19
|
cpTree.insert(cpNode);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-new-cp-trees.js","sourceRoot":"","sources":["../../src/mat/create-new-cp-trees.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create-new-cp-trees.js","sourceRoot":"","sources":["../../src/mat/create-new-cp-trees.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAIhE;;;;GAIG;AACH,SAAS,gBAAgB,CACjB,MAAc;IAElB,MAAM,QAAQ,GAA6B,IAAI,GAAG,EAAE,CAAC;IAErD,YAAY,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE/C,SAAS,gBAAgB,CAAC,MAAc;QACpC,MAAM,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5C,IAAI,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,MAAM,GAAG,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAC;YACtC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/B,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PrePointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
2
2
|
import type { CpNode } from '../cp-node/cp-node.js';
|
|
3
|
-
import {
|
|
3
|
+
import { RbTree } from 'flo-ll-rb-tree';
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*
|
|
@@ -14,5 +14,5 @@ import { LlRbTree } from 'flo-ll-rb-tree';
|
|
|
14
14
|
* @param order
|
|
15
15
|
* @param order2
|
|
16
16
|
*/
|
|
17
|
-
declare function getCpNodeToLeftOrSame(cpTree:
|
|
17
|
+
declare function getCpNodeToLeftOrSame(cpTree: RbTree<CpNode>, pos: PrePointOnShape, order: number, order2: number): CpNode | undefined;
|
|
18
18
|
export { getCpNodeToLeftOrSame };
|
|
@@ -21,7 +21,8 @@ function getCpNodeToLeftOrSame(cpTree, pos, order, order2) {
|
|
|
21
21
|
if (cps[0] === undefined || cps[1] === undefined) {
|
|
22
22
|
// Smaller than all -> cptree.min() === cps[1].data OR
|
|
23
23
|
// Larger than all -> cptree.max() === cps[0].data
|
|
24
|
-
return cpTree.max(cpTree.root);
|
|
24
|
+
// return cpTree.max(cpTree.root);
|
|
25
|
+
return cpTree.getMaxNode()?.datum;
|
|
25
26
|
}
|
|
26
27
|
return cps[0].datum;
|
|
27
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-cp-node-to-left-or-same.js","sourceRoot":"","sources":["../../src/mat/get-cp-node-to-left-or-same.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AACH,SAAS,qBAAqB,CACtB,
|
|
1
|
+
{"version":3,"file":"get-cp-node-to-left-or-same.js","sourceRoot":"","sources":["../../src/mat/get-cp-node-to-left-or-same.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AACH,SAAS,qBAAqB,CACtB,MAAsB,EACtB,GAAoB,EACpB,KAAa,EACb,MAAc;IAElB,MAAM,YAAY,GAAG,EAAE,GAAG,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAC/C,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,EAAE,YAAY,EAAY,CAAC,CAAC;IAE1D,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;QAC/C,0BAA0B;QAC1B,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;QAC/C,sDAAsD;QACtD,mDAAmD;QACnD,kCAAkC;QAClC,OAAO,MAAM,CAAC,UAAU,EAAE,EAAE,KAAK,CAAC;IACtC,CAAC;IAED,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACxB,CAAC;AAGD,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
package/node/mat/mat-meta.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Loop } from 'flo-boolean';
|
|
2
2
|
import type { CpNode } from '../cp-node/cp-node.js';
|
|
3
3
|
import type { Curve } from 'flo-boolean';
|
|
4
|
-
import {
|
|
4
|
+
import { RbTree } from 'flo-ll-rb-tree';
|
|
5
5
|
interface MatMeta {
|
|
6
6
|
/** The minimum power of 2 such that `2**maxCoordPowerOf2 >= "the max coordinate"` */
|
|
7
7
|
readonly maxCoordPowerOf2: number;
|
|
@@ -17,7 +17,7 @@ interface MatMeta {
|
|
|
17
17
|
* `CpNode`s of the MAT by their compare order, i.e. their cyclic order
|
|
18
18
|
* around the shape boundary.
|
|
19
19
|
*/
|
|
20
|
-
readonly cpTrees: Map<Loop,
|
|
20
|
+
readonly cpTrees: Map<Loop, RbTree<CpNode>>;
|
|
21
21
|
/** A map from a bezier and t value to a `PointOnShape` */
|
|
22
22
|
/**
|
|
23
23
|
* Stores the last insert id so each `CpNode` can have a unique id for
|
|
@@ -12,7 +12,8 @@ function getOsculatingCircle(maxOsculatingCircleRadius, pos, norm) {
|
|
|
12
12
|
const { curve, p, t } = pos;
|
|
13
13
|
const { ps } = curve;
|
|
14
14
|
const minCurvature = 1 / maxOsculatingCircleRadius;
|
|
15
|
-
const
|
|
15
|
+
const kDd = ddCurvature(ps, t);
|
|
16
|
+
const k_ = -(kDd[0] + kDd[1]);
|
|
16
17
|
const k = k_ < minCurvature ? minCurvature : k_;
|
|
17
18
|
const [tx, ty] = norm;
|
|
18
19
|
const l = sqrt(tx * tx + ty * ty);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-osculating-circle.js","sourceRoot":"","sources":["../../src/point-on-shape/get-osculating-circle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;AAGtB;;;;;;;GAOG;AACH,SAAS,mBAAmB,CACpB,yBAAiC,EACjC,GAAoB,EACpB,IAAc;IAElB,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,GAAG,CAAC;IAC5B,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IAErB,MAAM,YAAY,GAAG,CAAC,GAAC,yBAAyB,CAAC;IAEjD,MAAM,
|
|
1
|
+
{"version":3,"file":"get-osculating-circle.js","sourceRoot":"","sources":["../../src/point-on-shape/get-osculating-circle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;AAGtB;;;;;;;GAOG;AACH,SAAS,mBAAmB,CACpB,yBAAiC,EACjC,GAAoB,EACpB,IAAc;IAElB,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,GAAG,CAAC;IAC5B,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC;IAErB,MAAM,YAAY,GAAG,CAAC,GAAC,yBAAyB,CAAC;IAEjD,MAAM,GAAG,GAAG,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/B,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,MAAM,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAEhD,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,GAAC,EAAE,GAAG,EAAE,GAAC,EAAE,CAAC,CAAC;IAC9B,MAAM,KAAK,GAAG,CAAC,GAAC,CAAC,CAAC;IAElB,OAAO;QACH,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAC,KAAK,CAAC;QAClC,CAAC,GAAC,CAAC;KACN,CAAC;AACN,CAAC;AAGD,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BezierPiece } from "flo-bezier3";
|
|
2
|
+
/**
|
|
3
|
+
* Filters out zero-length bezier pieces.
|
|
4
|
+
*
|
|
5
|
+
* * **note** will return at least one bezier piece, even if all pieces are zero-length.
|
|
6
|
+
*
|
|
7
|
+
* @param bezierPieces
|
|
8
|
+
*/
|
|
9
|
+
declare function filterZeroLength(bezierPieces: BezierPiece[]): BezierPiece[];
|
|
10
|
+
export { filterZeroLength };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { isBezierPieceZeroLength } from "flo-bezier3";
|
|
2
|
+
/**
|
|
3
|
+
* Filters out zero-length bezier pieces.
|
|
4
|
+
*
|
|
5
|
+
* * **note** will return at least one bezier piece, even if all pieces are zero-length.
|
|
6
|
+
*
|
|
7
|
+
* @param bezierPieces
|
|
8
|
+
*/
|
|
9
|
+
function filterZeroLength(bezierPieces) {
|
|
10
|
+
const bezierPieces_ = bezierPieces.filter(bezierPiece => !isBezierPieceZeroLength(bezierPiece));
|
|
11
|
+
return bezierPieces_.length > 0 ? bezierPieces_ : [bezierPieces[0]];
|
|
12
|
+
}
|
|
13
|
+
export { filterZeroLength };
|
|
14
|
+
//# sourceMappingURL=filter-zero-length.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-zero-length.js","sourceRoot":"","sources":["../../src/reconstruct-from-mat/filter-zero-length.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAGtD;;;;;;GAMG;AACH,SAAS,gBAAgB,CACjB,YAA2B;IAE/B,MAAM,aAAa,GAAG,YAAY,CAAC,MAAM,CACrC,WAAW,CAAC,EAAE,CAAC,CAAC,uBAAuB,CAAC,WAAW,CAAC,CACvD,CAAC;IAEF,OAAO,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AACxE,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CpNode } from '../cp-node/cp-node.js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns all `CpNode`s on the MAT that this `CpNode` is part of
|
|
4
|
+
* starting from the current one and going anti-clockwise around the shape.
|
|
5
|
+
*/
|
|
6
|
+
declare function getAllOnLoop_ByLoop(cpNode: CpNode): CpNode[][];
|
|
7
|
+
export { getAllOnLoop_ByLoop };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns all `CpNode`s on the MAT that this `CpNode` is part of
|
|
3
|
+
* starting from the current one and going anti-clockwise around the shape.
|
|
4
|
+
*/
|
|
5
|
+
function getAllOnLoop_ByLoop(cpNode) {
|
|
6
|
+
const cpNodess = [];
|
|
7
|
+
const cpStarts = [cpNode];
|
|
8
|
+
const cpStartSet = new Set(cpStarts);
|
|
9
|
+
if (cpNode.isHoleClosing) {
|
|
10
|
+
cpStartSet.add(cpNode.prevOnCircle.holeCloserTwin);
|
|
11
|
+
}
|
|
12
|
+
cpStartSet.add(cpNode);
|
|
13
|
+
while (cpStarts.length > 0) {
|
|
14
|
+
const cpNodes = [];
|
|
15
|
+
const cpStart = cpStarts.pop();
|
|
16
|
+
const _loop = cpStart.pointOnShape.curve.loop;
|
|
17
|
+
let cpNode = cpStart;
|
|
18
|
+
do {
|
|
19
|
+
const loop = cpNode.pointOnShape.curve.loop;
|
|
20
|
+
if (_loop === loop) {
|
|
21
|
+
cpNodes.push(cpNode);
|
|
22
|
+
cpNode = cpNode.next;
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const twin = cpNode.holeCloserTwin;
|
|
26
|
+
if (!cpStartSet.has(twin)) {
|
|
27
|
+
cpStartSet.add(twin);
|
|
28
|
+
cpStartSet.add(twin.prevOnCircle.holeCloserTwin);
|
|
29
|
+
cpStarts.push(twin);
|
|
30
|
+
}
|
|
31
|
+
cpNode = cpNode.prev.holeCloserTwin;
|
|
32
|
+
} while (cpNode !== cpStart);
|
|
33
|
+
cpNodess.push(cpNodes);
|
|
34
|
+
}
|
|
35
|
+
return cpNodess;
|
|
36
|
+
}
|
|
37
|
+
export { getAllOnLoop_ByLoop };
|
|
38
|
+
//# sourceMappingURL=get-all-on-loop-by-loop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-all-on-loop-by-loop.js","sourceRoot":"","sources":["../../src/reconstruct-from-mat/get-all-on-loop-by-loop.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,SAAS,mBAAmB,CACpB,MAAc;IAElB,MAAM,QAAQ,GAAe,EAAE,CAAC;IAEhC,MAAM,QAAQ,GAAa,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrC,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;QACvB,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,cAAe,CAAC,CAAC;IACxD,CAAC;IACD,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAEvB,OAAO,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAG,CAAC;QAChC,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC;QAC9C,IAAI,MAAM,GAAG,OAAO,CAAC;QAErB,GAAG,CAAC;YACA,MAAM,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC;YAC5C,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBACjB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACrB,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;gBACrB,SAAS;YACb,CAAC;YAED,MAAM,IAAI,GAAG,MAAM,CAAC,cAAe,CAAC;YACpC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxB,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBACrB,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,cAAe,CAAC,CAAC;gBAClD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC;YAED,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,cAAe,CAAC;QACzC,CAAC,QAAQ,MAAM,KAAK,OAAO,EAAE;QAE7B,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC;AAGD,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-bezier-piece-length.js","sourceRoot":"","sources":["../../src/reconstruct-from-mat/get-bezier-piece-length.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,SAAS,oBAAoB,CACrB,WAAwB;IAE5B,OAAO,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;AAClD,CAAC;AAGD,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getBoundaryBezierPartsToNext } from '../cp-node/fs/get-boundary-bezier-parts-to-next.js';
|
|
2
|
+
import { filterZeroLength } from "./filter-zero-length.js";
|
|
3
|
+
import { isFullyTerminating } from './is-fully-terminating.js';
|
|
4
|
+
function getBoundary(cpNode) {
|
|
5
|
+
const cpNodeOpp = isFullyTerminating(cpNode)
|
|
6
|
+
? undefined // no opposite boundary
|
|
7
|
+
: cpNode.next.prevOnCircle;
|
|
8
|
+
const boundaryBeziers = filterZeroLength(getBoundaryBezierPartsToNext(cpNode));
|
|
9
|
+
const boundaryBeziersOpp = cpNodeOpp === undefined
|
|
10
|
+
? undefined
|
|
11
|
+
: filterZeroLength(getBoundaryBezierPartsToNext(cpNodeOpp));
|
|
12
|
+
return {
|
|
13
|
+
boundaryBeziers,
|
|
14
|
+
boundaryBeziersOpp
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export { getBoundary };
|
|
18
|
+
//# sourceMappingURL=get-boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-boundary.js","sourceRoot":"","sources":["../../src/reconstruct-from-mat/get-boundary.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG/D,SAAS,WAAW,CACZ,MAAc;IAKlB,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAM,CAAC;QACxC,CAAC,CAAC,SAAS,CAAC,uBAAuB;QACnC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;IAE/B,MAAM,eAAe,GACjB,gBAAgB,CAAC,4BAA4B,CAAC,MAAM,CAAC,CAAC,CAAC;IAE3D,MAAM,kBAAkB,GAAG,SAAS,KAAK,SAAS;QAC9C,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,gBAAgB,CAAC,4BAA4B,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhE,OAAO;QACH,eAAe;QACf,kBAAkB;KACrB,CAAC;AACN,CAAC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { isOnSameLoop } from "../cp-node/fs/is-on-same-loop.js";
|
|
2
|
+
import { isFullyTerminating } from "./is-fully-terminating.js";
|
|
3
|
+
import { getAllOnLoop_ByLoop } from "./get-all-on-loop-by-loop.js";
|
|
4
|
+
function getCpNodessForSat(sat) {
|
|
5
|
+
let { cpNode } = sat;
|
|
6
|
+
while (!isFullyTerminating(cpNode)) {
|
|
7
|
+
cpNode = cpNode.next;
|
|
8
|
+
}
|
|
9
|
+
if (!isOnSameLoop(cpNode, cpNode.next)) {
|
|
10
|
+
cpNode = cpNode.holeCloserTwin;
|
|
11
|
+
}
|
|
12
|
+
return getAllOnLoop_ByLoop(cpNode);
|
|
13
|
+
}
|
|
14
|
+
export { getCpNodessForSat };
|
|
15
|
+
//# sourceMappingURL=get-cp-nodess-for-sat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-cp-nodess-for-sat.js","sourceRoot":"","sources":["../../src/reconstruct-from-mat/get-cp-nodess-for-sat.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAGnE,SAAS,iBAAiB,CAClB,GAAQ;IAEZ,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IAErB,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;IACzB,CAAC;IACD,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,MAAM,GAAG,MAAM,CAAC,cAAe,CAAC;IACpC,CAAC;IAED,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|