flo-mat 4.1.4 → 5.0.1
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/__tests__/closest-boundary-point/get-endpoint-info.spec.ts +140 -0
- package/__tests__/closest-boundary-point/root-interval-to-distance-squared-interval.spec.ts +87 -0
- package/__tests__/cp-node/circle-identity.spec.ts +56 -0
- package/__tests__/cp-node/fs/get-all-on-loop-by-loop.spec.ts +55 -0
- package/__tests__/cp-node/fs/get-angle-between-mat-curves.spec.ts +39 -3
- package/__tests__/cp-node/fs/get-boundary-bezier-parts-to-next.spec.ts +87 -3
- package/__tests__/cp-node/fs/get-boundary-beziers-between.spec.ts +68 -3
- package/__tests__/cp-node/fs/get-boundary-beziers-to-next.spec.ts +41 -3
- package/__tests__/cp-node/fs/get-boundary-distance-to-next.spec.ts +20 -3
- package/__tests__/cp-node/fs/get-branch-beziers.spec.ts +42 -3
- package/__tests__/cp-node/fs/get-branch.spec.ts +60 -3
- package/__tests__/cp-node/fs/get-cp-node-ordering.spec.ts +19 -3
- package/__tests__/cp-node/fs/get-distance-to-next.spec.ts +37 -4
- package/__tests__/cp-node/fs/get-edge-direction.spec.ts +50 -3
- package/__tests__/cp-node/fs/get-first-exit.spec.ts +78 -3
- package/__tests__/cp-node/fs/get-hole-closers.spec.ts +32 -3
- package/__tests__/cp-node/fs/get-implied-boundary-bezier-between.spec.ts +48 -3
- package/__tests__/cp-node/fs/get-mat-curve-between.spec.ts +77 -3
- package/__tests__/cp-node/fs/get-mat-curve-to-next.spec.ts +17 -4
- package/__tests__/cp-node/fs/get-mat-curves-between.spec.ts +38 -3
- package/__tests__/cp-node/fs/get-salience.spec.ts +68 -3
- package/__tests__/cp-node/fs/get-vertex-forward-children.spec.ts +40 -3
- package/__tests__/cp-node/fs/insert-cp-node.spec.ts +87 -3
- package/__tests__/cp-node/fs/is-special.spec.ts +1 -1
- package/__tests__/cp-node/fs/remove-cp-node.spec.ts +42 -3
- package/__tests__/find-2-prong/calc-seperation-tolerance.spec.ts +46 -0
- package/__tests__/find-2-prong/get-medial/dd-get-medial-point-coeffs-same-curve.spec.ts +7 -5
- package/__tests__/find-2-prong/get-medial/dd-get-medial-point-coeffs.spec.ts +4 -2
- package/__tests__/find-2-prong/get-medial/get-closest-points.spec.ts +1 -1
- package/__tests__/floyd-warshall/get-graph.spec.ts +100 -0
- package/__tests__/get-mats-with-hole.ts +28 -0
- package/__tests__/get-mats1.spec.ts +61 -0
- package/__tests__/get-mats1.ts +75 -67
- package/__tests__/helpers/cp-node-by-id.ts +27 -0
- package/__tests__/helpers/expect-point-close.ts +42 -0
- package/__tests__/mat/hausdorff-distance-one-sided-exceeds.spec.ts +129 -0
- package/__tests__/mat/simplify-mat.spec.ts +85 -0
- package/__tests__/reconstruct-from-mat/reconstruct-from-mat.spec.ts +39 -0
- package/__tests__/specific-cases/test-svgs/achispado.svg +14 -0
- package/__tests__/utils/get-beziers-from-tangents.spec.ts +142 -0
- package/browser/index.js +17882 -13800
- package/browser/index.min.js +1 -1
- package/node/add-n-prong.ts/join-spokes.js +3 -2
- package/node/add-n-prong.ts/join-spokes.js.map +1 -1
- package/node/closest-boundary-point/cull-curve-pieces.d.ts +21 -0
- package/node/closest-boundary-point/cull-curve-pieces.js +40 -0
- package/node/closest-boundary-point/cull-curve-pieces.js.map +1 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.js +5 -2
- package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -1
- package/node/closest-boundary-point/get-endpoint-info.d.ts +39 -0
- package/node/closest-boundary-point/get-endpoint-info.js +78 -0
- package/node/closest-boundary-point/get-endpoint-info.js.map +1 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js +5 -19
- 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 +17 -5
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js +37 -50
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js.map +1 -1
- package/node/corner/get-corner.d.ts +18 -1
- package/node/corner/get-corner.js +8 -1
- package/node/corner/get-corner.js.map +1 -1
- package/node/corner/get-interface-ccw.js.map +1 -1
- package/node/cp-node/cp-node.d.ts +4 -3
- package/node/cp-node/fs/enhance-cp-node.d.ts +9 -9
- package/node/cp-node/fs/get-all-on-loop-by-loop.js +0 -4
- package/node/cp-node/fs/get-all-on-loop-by-loop.js.map +1 -1
- package/node/cp-node/fs/get-angle-between-mat-curves.d.ts +1 -1
- package/node/cp-node/fs/get-angle-between-mat-curves.js +7 -4
- package/node/cp-node/fs/get-angle-between-mat-curves.js.map +1 -1
- package/node/cp-node/fs/get-boundary-beziers-between.d.ts +6 -4
- package/node/cp-node/fs/get-boundary-beziers-between.js +6 -4
- package/node/cp-node/fs/get-boundary-beziers-between.js.map +1 -1
- package/node/cp-node/fs/get-branch-beziers.d.ts +2 -1
- package/node/cp-node/fs/get-branch-beziers.js +3 -2
- package/node/cp-node/fs/get-branch-beziers.js.map +1 -1
- package/node/cp-node/fs/get-branch.js +1 -2
- package/node/cp-node/fs/get-branch.js.map +1 -1
- package/node/cp-node/fs/get-distance-to-next.js +4 -2
- package/node/cp-node/fs/get-distance-to-next.js.map +1 -1
- package/node/cp-node/fs/get-edge-direction.js +3 -2
- package/node/cp-node/fs/get-edge-direction.js.map +1 -1
- package/node/cp-node/fs/get-first-exit.d.ts +7 -3
- package/node/cp-node/fs/get-first-exit.js +13 -11
- package/node/cp-node/fs/get-first-exit.js.map +1 -1
- package/node/cp-node/fs/get-implied-boundary-bezier-between.d.ts +10 -2
- package/node/cp-node/fs/get-implied-boundary-bezier-between.js +11 -54
- package/node/cp-node/fs/get-implied-boundary-bezier-between.js.map +1 -1
- package/node/cp-node/fs/get-mat-curve-between.d.ts +5 -3
- package/node/cp-node/fs/get-mat-curve-between.js +6 -49
- package/node/cp-node/fs/get-mat-curve-between.js.map +1 -1
- package/node/cp-node/fs/get-mat-curve-to-next.d.ts +1 -1
- package/node/cp-node/fs/get-mat-curves-between.d.ts +8 -0
- package/node/cp-node/fs/get-mat-curves-between.js +9 -2
- package/node/cp-node/fs/get-mat-curves-between.js.map +1 -1
- package/node/cp-node/fs/get-real-prong-count.d.ts +2 -1
- package/node/cp-node/fs/get-real-prong-count.js +11 -5
- package/node/cp-node/fs/get-real-prong-count.js.map +1 -1
- package/node/cp-node/fs/get-salience.d.ts +10 -0
- package/node/cp-node/fs/get-salience.js +17 -1
- package/node/cp-node/fs/get-salience.js.map +1 -1
- package/node/cp-node/fs/is-fully-terminating.d.ts +4 -2
- package/node/cp-node/fs/is-fully-terminating.js +6 -17
- package/node/cp-node/fs/is-fully-terminating.js.map +1 -1
- package/node/cp-node/fs/is-on-same-circle.d.ts +3 -0
- package/node/cp-node/fs/is-on-same-circle.js +4 -4
- package/node/cp-node/fs/is-on-same-circle.js.map +1 -1
- package/node/cp-node/fs/is-on-same-loop.d.ts +1 -1
- package/node/cp-node/fs/is-special.d.ts +7 -0
- package/node/cp-node/fs/is-special.js +9 -2
- package/node/cp-node/fs/is-special.js.map +1 -1
- package/node/cp-node/fs/is-vertex.d.ts +1 -1
- package/node/cp-node/fs/traverse-edges.d.ts +7 -3
- package/node/cp-node/fs/traverse-edges.js +7 -3
- package/node/cp-node/fs/traverse-edges.js.map +1 -1
- package/node/cp-node/stringification/from-stringifyable.d.ts +2 -2
- package/node/cp-node/stringification/from-stringifyable.js +17 -1
- package/node/cp-node/stringification/from-stringifyable.js.map +1 -1
- package/node/cp-node/stringification/to-stringifyable.d.ts +3 -3
- package/node/cp-node/stringification/to-stringifyable.js +3 -3
- package/node/debug/debug.d.ts +26 -3
- package/node/debug/debug.js +16 -5
- package/node/debug/debug.js.map +1 -1
- package/node/find-2-prong/add-2-prong.js +7 -9
- package/node/find-2-prong/add-2-prong.js.map +1 -1
- package/node/find-2-prong/calc-seperation-tolerance.d.ts +28 -5
- package/node/find-2-prong/calc-seperation-tolerance.js +32 -89
- package/node/find-2-prong/calc-seperation-tolerance.js.map +1 -1
- package/node/find-2-prong/find-2-prong.js +8 -10
- package/node/find-2-prong/find-2-prong.js.map +1 -1
- package/node/find-2-prong/find-and-add-2-prongs.js +2 -2
- package/node/find-2-prong/find-and-add-2-prongs.js.map +1 -1
- package/node/find-2-prong/get-medial/get-antipodal-points.d.ts +1 -2
- package/node/find-2-prong/get-medial/get-antipodal-points.js +2 -3
- package/node/find-2-prong/get-medial/get-antipodal-points.js.map +1 -1
- package/node/find-2-prong/get-medial/get-closest-points.d.ts +1 -8
- package/node/find-2-prong/get-medial/get-closest-points.js +4 -40
- package/node/find-2-prong/get-medial/get-closest-points.js.map +1 -1
- package/node/find-2-prong/reduce-radius.d.ts +1 -1
- package/node/find-2-prong/reduce-radius.js +6 -3
- package/node/find-2-prong/reduce-radius.js.map +1 -1
- package/node/find-3-prong/calc-better-x.js +1 -1
- package/node/find-3-prong/calc-better-x.js.map +1 -1
- package/node/find-3-prong/find-3-prong-for-delta3s.d.ts +3 -2
- package/node/find-3-prong/find-3-prong-for-delta3s.js +36 -42
- package/node/find-3-prong/find-3-prong-for-delta3s.js.map +1 -1
- package/node/find-3-prong/find-3-prong.js +3 -1
- package/node/find-3-prong/find-3-prong.js.map +1 -1
- package/node/find-3-prong/find-and-add-3-prongs.js +16 -0
- package/node/find-3-prong/find-and-add-3-prongs.js.map +1 -1
- 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.js +3 -4
- package/node/find-mat/find-mat.js.map +1 -1
- package/node/find-mat/find-mats.d.ts +6 -12
- package/node/find-mat/find-mats.js +10 -27
- package/node/find-mat/find-mats.js.map +1 -1
- package/node/find-mat/get-dull-corners-on-loop.js +2 -2
- package/node/find-mat/get-dull-corners-on-loop.js.map +1 -1
- package/node/find-mat/get-for-1-prongs-on-loop.js +36 -8
- package/node/find-mat/get-for-1-prongs-on-loop.js.map +1 -1
- package/node/find-mat/get-meta.d.ts +14 -4
- package/node/find-mat/get-meta.js +30 -24
- package/node/find-mat/get-meta.js.map +1 -1
- package/node/find-mat/get-sharp-corners.js +2 -2
- package/node/find-mat/get-sharp-corners.js.map +1 -1
- package/node/find-mat/mat-options.d.ts +2 -2
- package/node/floyd-warshall/get-graph.d.ts +12 -1
- package/node/floyd-warshall/get-graph.js +41 -38
- package/node/floyd-warshall/get-graph.js.map +1 -1
- package/node/geometry/get-bounding-box-.d.ts +16 -2
- package/node/geometry/get-bounding-box-.js +5 -2
- package/node/geometry/get-bounding-box-.js.map +1 -1
- package/node/geometry/get-closest-square-distance-to-rect.d.ts +3 -0
- package/node/geometry/get-closest-square-distance-to-rect.js +7 -5
- package/node/geometry/get-closest-square-distance-to-rect.js.map +1 -1
- package/node/geometry/get-closest-squared-distance-to-rotated-rect.d.ts +4 -0
- package/node/geometry/get-closest-squared-distance-to-rotated-rect.js +12 -5
- package/node/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -1
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.js +1 -2
- package/node/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.js.map +1 -1
- package/node/index.d.ts +3 -2
- package/node/index.js +2 -1
- package/node/index.js.map +1 -1
- package/node/mat/clone-mat.d.ts +9 -0
- package/node/mat/clone-mat.js +17 -0
- package/node/mat/clone-mat.js.map +1 -0
- package/node/mat/clone-meta.d.ts +12 -0
- package/node/mat/clone-meta.js +24 -0
- package/node/mat/clone-meta.js.map +1 -0
- package/node/mat/get-boundary-piece-beziers.d.ts +5 -0
- package/node/mat/get-boundary-piece-beziers.js +7 -93
- package/node/mat/get-boundary-piece-beziers.js.map +1 -1
- package/node/mat/get-closeby-cp-if-exist.js +2 -1
- package/node/mat/get-closeby-cp-if-exist.js.map +1 -1
- package/node/mat/get-largest-3-prong.d.ts +6 -0
- package/node/mat/get-largest-3-prong.js +8 -5
- package/node/mat/get-largest-3-prong.js.map +1 -1
- package/node/mat/get-largest-vertex.d.ts +15 -1
- package/node/mat/get-largest-vertex.js +20 -7
- package/node/mat/get-largest-vertex.js.map +1 -1
- package/node/mat/hausdorff-distance-one-sided-exceeds.d.ts +79 -0
- package/node/mat/hausdorff-distance-one-sided-exceeds.js +251 -0
- package/node/mat/hausdorff-distance-one-sided-exceeds.js.map +1 -0
- package/node/mat/mat-meta.d.ts +0 -6
- package/node/mat/simplify-mat.d.ts +25 -8
- package/node/mat/simplify-mat.js +182 -53
- package/node/mat/simplify-mat.js.map +1 -1
- package/node/mat/trim-mat.d.ts +4 -2
- package/node/mat/trim-mat.js +3 -1
- package/node/mat/trim-mat.js.map +1 -1
- package/node/point-on-shape/get-boundary-tangent-line.d.ts +19 -0
- package/node/point-on-shape/get-boundary-tangent-line.js +33 -0
- package/node/point-on-shape/get-boundary-tangent-line.js.map +1 -0
- package/node/point-on-shape/get-osculating-circle.d.ts +6 -4
- package/node/point-on-shape/get-osculating-circle.js +6 -4
- package/node/point-on-shape/get-osculating-circle.js.map +1 -1
- package/node/point-on-shape/get-pos-corner.js +2 -2
- package/node/point-on-shape/get-pos-corner.js.map +1 -1
- package/node/point-on-shape/point-on-shape.d.ts +5 -0
- package/node/reconstruct-from-mat/reconstruct-from-mat.js +20 -80
- package/node/reconstruct-from-mat/reconstruct-from-mat.js.map +1 -1
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.d.ts +4 -0
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js +4 -0
- package/node/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.js.map +1 -1
- package/node/sat/cull.d.ts +7 -6
- package/node/sat/cull.js +13 -16
- package/node/sat/cull.js.map +1 -1
- package/node/sat/get-sat-culls.d.ts +12 -2
- package/node/sat/get-sat-culls.js +21 -16
- package/node/sat/get-sat-culls.js.map +1 -1
- package/node/svg/get-shape-bounds.d.ts +1 -12
- package/node/svg/get-shape-bounds.js +2 -3
- package/node/svg/get-shape-bounds.js.map +1 -1
- package/node/sweep-line/sweep-line.js.map +1 -1
- package/node/utils/get-beziers-from-tangents.d.ts +28 -0
- package/node/utils/get-beziers-from-tangents.js +92 -0
- package/node/utils/get-beziers-from-tangents.js.map +1 -0
- package/node/vertex/remove-vertex.d.ts +5 -3
- package/node/vertex/remove-vertex.js +5 -3
- package/node/vertex/remove-vertex.js.map +1 -1
- package/package.json +16 -16
- package/qv-infinite-loop.md +120 -0
- package/src/add-n-prong.ts/join-spokes.ts +4 -2
- package/src/closest-boundary-point/cull-curve-pieces.ts +49 -0
- package/src/closest-boundary-point/get-close-boundary-points-certified.ts +5 -2
- package/src/closest-boundary-point/get-endpoint-info.ts +96 -0
- package/src/closest-boundary-point/get-potential-closest-points-on-curve-certified.ts +5 -23
- package/src/closest-boundary-point/root-interval-to-distance-squared-interval.ts +42 -60
- package/src/corner/get-corner.ts +10 -1
- package/src/corner/get-interface-ccw.ts +2 -2
- package/src/cp-node/cp-node.ts +4 -3
- package/src/cp-node/fs/get-all-on-loop-by-loop.ts +0 -4
- package/src/cp-node/fs/get-angle-between-mat-curves.ts +9 -5
- package/src/cp-node/fs/get-boundary-beziers-between.ts +10 -8
- package/src/cp-node/fs/get-branch-beziers.ts +3 -2
- package/src/cp-node/fs/get-branch.ts +1 -2
- package/src/cp-node/fs/get-distance-to-next.ts +4 -2
- package/src/cp-node/fs/get-edge-direction.ts +4 -2
- package/src/cp-node/fs/get-first-exit.ts +15 -14
- package/src/cp-node/fs/get-implied-boundary-bezier-between.ts +18 -70
- package/src/cp-node/fs/get-mat-curve-between.ts +10 -67
- package/src/cp-node/fs/get-mat-curves-between.ts +9 -2
- package/src/cp-node/fs/get-real-prong-count.ts +11 -7
- package/src/cp-node/fs/get-salience.ts +15 -2
- package/src/cp-node/fs/is-fully-terminating.ts +6 -22
- package/src/cp-node/fs/is-on-same-circle.ts +6 -7
- package/src/cp-node/fs/is-on-same-loop.ts +2 -2
- package/src/cp-node/fs/is-special.ts +11 -6
- package/src/cp-node/fs/is-vertex.ts +1 -1
- package/src/cp-node/fs/traverse-edges.ts +8 -4
- package/src/cp-node/stringification/from-stringifyable.ts +75 -58
- package/src/cp-node/stringification/to-stringifyable.ts +3 -3
- package/src/debug/debug.ts +44 -8
- package/src/find-2-prong/add-2-prong.ts +9 -11
- package/src/find-2-prong/calc-seperation-tolerance.ts +34 -115
- package/src/find-2-prong/find-2-prong.ts +9 -11
- package/src/find-2-prong/find-and-add-2-prongs.ts +2 -2
- package/src/find-2-prong/get-medial/get-antipodal-points.ts +1 -3
- package/src/find-2-prong/get-medial/get-closest-points.ts +6 -51
- package/src/find-2-prong/reduce-radius.ts +6 -4
- package/src/find-3-prong/calc-better-x.ts +2 -2
- package/src/find-3-prong/find-3-prong-for-delta3s.ts +197 -214
- package/src/find-3-prong/find-3-prong.ts +54 -51
- package/src/find-3-prong/find-and-add-3-prongs.ts +20 -1
- package/src/find-mat/create-initial-cp-tree.ts +2 -2
- package/src/find-mat/find-mat.ts +4 -6
- package/src/find-mat/find-mats.ts +83 -105
- package/src/find-mat/get-dull-corners-on-loop.ts +2 -2
- package/src/find-mat/get-for-1-prongs-on-loop.ts +40 -8
- package/src/find-mat/get-meta.ts +34 -39
- package/src/find-mat/get-sharp-corners.ts +2 -2
- package/src/find-mat/mat-options.ts +2 -2
- package/src/floyd-warshall/get-graph.ts +46 -47
- package/src/geometry/get-bounding-box-.ts +5 -2
- package/src/geometry/get-closest-square-distance-to-rect.ts +7 -7
- package/src/geometry/get-closest-squared-distance-to-rotated-rect.ts +15 -13
- package/src/get-medial-points/double-double/dd-get-medial-point-coeffs-bez3.ts +1 -2
- package/src/index.ts +3 -2
- package/src/mat/clone-mat.ts +9 -3
- package/src/mat/clone-meta.ts +8 -0
- package/src/mat/get-boundary-piece-beziers.ts +16 -117
- package/src/mat/get-closeby-cp-if-exist.ts +3 -1
- package/src/mat/get-largest-3-prong.ts +9 -6
- package/src/mat/get-largest-vertex.ts +25 -9
- package/src/mat/hausdorff-distance-one-sided-exceeds.ts +314 -0
- package/src/mat/mat-meta.ts +0 -9
- package/src/mat/simplify-mat.ts +254 -116
- package/src/mat/trim-mat.ts +6 -4
- package/src/point-on-shape/get-boundary-tangent-line.ts +36 -0
- package/src/point-on-shape/get-osculating-circle.ts +7 -5
- package/src/point-on-shape/get-pos-corner.ts +2 -2
- package/src/point-on-shape/point-on-shape.ts +5 -0
- package/src/reconstruct-from-mat/reconstruct-from-mat.ts +22 -111
- package/src/reconstruct-from-mat/remove-sat-induced-trivial-3prongs.ts +4 -0
- package/src/sat/cull.ts +16 -20
- package/src/sat/get-sat-culls.ts +28 -23
- package/src/svg/get-shape-bounds.ts +2 -3
- package/src/sweep-line/sweep-line.ts +1 -1
- package/src/utils/deg-to-rad.ts +4 -2
- package/src/utils/get-beziers-from-tangents.ts +110 -0
- package/src/utils/map-map.ts +1 -1
- package/src/utils/rad-to-deg.ts +4 -1
- package/src/vertex/remove-vertex.ts +5 -3
- package/webpack.config.cjs +7 -2
- package/__tests__/cp-node/fs/get-distance-between.spec.ts +0 -7
- package/__tests__/cp-node/fs/get-terminating-on-circle.spec.ts +0 -24
- package/__tests__/cp-node/fs/is-single-3-prong.spec.ts +0 -17
- package/__tests__/cp-node/fs/iterate-all-on-loop.spec.ts +0 -17
- package/__tests__/cp-node/fs/traverse-all-forward.spec.ts +0 -14
- package/node/closest-boundary-point/cull-bezier-pieces-1.d.ts +0 -9
- package/node/closest-boundary-point/cull-bezier-pieces-1.js +0 -17
- package/node/closest-boundary-point/cull-bezier-pieces-1.js.map +0 -1
- package/node/closest-boundary-point/cull-by-loose-bounding-box.d.ts +0 -13
- package/node/closest-boundary-point/cull-by-loose-bounding-box.js +0 -27
- package/node/closest-boundary-point/cull-by-loose-bounding-box.js.map +0 -1
- package/node/closest-boundary-point/cull-by-tight-boundary-box.d.ts +0 -11
- package/node/closest-boundary-point/cull-by-tight-boundary-box.js +0 -27
- package/node/closest-boundary-point/cull-by-tight-boundary-box.js.map +0 -1
- package/node/cp-node/fs/find-first.d.ts +0 -10
- package/node/cp-node/fs/find-first.js +0 -19
- package/node/cp-node/fs/find-first.js.map +0 -1
- package/node/debug/functions/check-ordering.d.ts +0 -4
- package/node/debug/functions/check-ordering.js +0 -43
- package/node/debug/functions/check-ordering.js.map +0 -1
- package/node/find-2-prong/cull-bezier-pieces.d.ts +0 -13
- package/node/find-2-prong/cull-bezier-pieces.js +0 -43
- package/node/find-2-prong/cull-bezier-pieces.js.map +0 -1
- package/node/floyd-warshall/get-hole-closer-pairs.d.ts +0 -8
- package/node/floyd-warshall/get-hole-closer-pairs.js +0 -27
- package/node/floyd-warshall/get-hole-closer-pairs.js.map +0 -1
- package/node/utils/dual-set.d.ts +0 -27
- package/node/utils/dual-set.js +0 -55
- package/node/utils/dual-set.js.map +0 -1
- package/node/utils/tri-map.d.ts +0 -27
- package/node/utils/tri-map.js +0 -49
- package/node/utils/tri-map.js.map +0 -1
- package/src/closest-boundary-point/cull-bezier-pieces-1.ts +0 -36
- package/src/closest-boundary-point/cull-by-loose-bounding-box.ts +0 -42
- package/src/closest-boundary-point/cull-by-tight-boundary-box.ts +0 -43
- package/src/closest-boundary-point/get-p-from-box.ts +0 -14
- package/src/cp-node/fs/add-distance-from.ts +0 -49
- package/src/cp-node/fs/get-distance-between.ts +0 -16
- package/src/cp-node/fs/get-terminating-on-circle.ts +0 -24
- package/src/cp-node/fs/is-single-3-prong.ts +0 -15
- package/src/cp-node/fs/iterate-all-on-loop.ts +0 -15
- package/src/cp-node/fs/traverse-all-forward.ts +0 -24
- package/src/debug/functions/draw/draw-beziers-as-single-path.ts +0 -40
- package/src/debug/functions/draw/draw-disk.ts +0 -34
- package/src/debug/functions/draw/xmlns.ts +0 -5
- package/src/find-2-prong/cull-bezier-pieces.ts +0 -61
- package/src/find-2-prong/find-and-add-2-prong.ts +0 -30
- package/src/find-2-prong/get-medial/get-closest-points-d.ts +0 -213
- package/src/find-2-prong/x-for-debugging.ts +0 -13
- package/src/floyd-warshall/get-hole-closer-pairs.ts +0 -35
- package/src/mat/get-two-prong-type.ts +0 -13
- package/src/point-on-shape/is-pos-dull-corner.ts +0 -18
- package/src/point-on-shape/is-pos-quite-dull-corner.ts +0 -18
- package/src/point-on-shape/is-pos-quite-sharp-corner.ts +0 -18
- package/src/point-on-shape/pos-to-human-string.ts +0 -18
- package/src/sweep-line/are-boxes-intersecting.ts +0 -37
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { CpNode } from "../cp-node.js";
|
|
2
2
|
/**
|
|
3
|
-
* Returns
|
|
3
|
+
* Returns the bezier curves of the shape boundary from the contact point of
|
|
4
|
+
* the first given `CpNode` to that of the second (following `next`), together
|
|
5
|
+
* with whether a hole closer was passed on the way.
|
|
4
6
|
*
|
|
5
|
-
* * If the second `CpNode` is never encountered
|
|
7
|
+
* * If the second `CpNode` is never encountered the entire boundary is
|
|
6
8
|
* returned.
|
|
7
9
|
*
|
|
8
10
|
* @param cpNode1
|
|
9
11
|
* @param cpNode2
|
|
10
|
-
* @param inclAllIfEqual if `true` and
|
|
11
|
-
*
|
|
12
|
+
* @param inclAllIfEqual if `true` and the two `CpNode`s are equal then return
|
|
13
|
+
* the entire boundary, otherwise return nothing.
|
|
12
14
|
*/
|
|
13
15
|
declare function getBoundaryBeziersBetween(cpNode1: CpNode, cpNode2: CpNode, inclAllIfEqual?: boolean): {
|
|
14
16
|
pss: number[][][];
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { getAllBetween } from "./get-all-between.js";
|
|
2
2
|
import { getBoundaryBeziersToNext } from "./get-boundary-beziers-to-next.js";
|
|
3
3
|
/**
|
|
4
|
-
* Returns
|
|
4
|
+
* Returns the bezier curves of the shape boundary from the contact point of
|
|
5
|
+
* the first given `CpNode` to that of the second (following `next`), together
|
|
6
|
+
* with whether a hole closer was passed on the way.
|
|
5
7
|
*
|
|
6
|
-
* * If the second `CpNode` is never encountered
|
|
8
|
+
* * If the second `CpNode` is never encountered the entire boundary is
|
|
7
9
|
* returned.
|
|
8
10
|
*
|
|
9
11
|
* @param cpNode1
|
|
10
12
|
* @param cpNode2
|
|
11
|
-
* @param inclAllIfEqual if `true` and
|
|
12
|
-
*
|
|
13
|
+
* @param inclAllIfEqual if `true` and the two `CpNode`s are equal then return
|
|
14
|
+
* the entire boundary, otherwise return nothing.
|
|
13
15
|
*/
|
|
14
16
|
function getBoundaryBeziersBetween(cpNode1, cpNode2, inclAllIfEqual = true) {
|
|
15
17
|
const { cpNodes, hasHoleCloser } = getAllBetween(cpNode1, cpNode2, inclAllIfEqual);
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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;;;;;;;;;;;;GAYG;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,6 +1,7 @@
|
|
|
1
1
|
import { CpNode } from '../cp-node.js';
|
|
2
2
|
/**
|
|
3
|
-
* Returns the
|
|
3
|
+
* Returns the (flattened) array of bezier curves (lines or quadratics)
|
|
4
|
+
* representing the branch associated with the given cpNode
|
|
4
5
|
*
|
|
5
6
|
* @param cpNode `CpNode` representing the start vertex.
|
|
6
7
|
*/
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { getBranch } from './get-branch.js';
|
|
2
2
|
import { getMatCurveToNext } from './get-mat-curve-to-next.js';
|
|
3
3
|
/**
|
|
4
|
-
* Returns the
|
|
4
|
+
* Returns the (flattened) array of bezier curves (lines or quadratics)
|
|
5
|
+
* representing the branch associated with the given cpNode
|
|
5
6
|
*
|
|
6
7
|
* @param cpNode `CpNode` representing the start vertex.
|
|
7
8
|
*/
|
|
8
9
|
function getBranchBeziers(cpNode) {
|
|
9
|
-
return getBranch(cpNode).
|
|
10
|
+
return getBranch(cpNode).flatMap(getMatCurveToNext);
|
|
10
11
|
}
|
|
11
12
|
export { getBranchBeziers };
|
|
12
13
|
//# sourceMappingURL=get-branch-beziers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-branch-beziers.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-branch-beziers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D
|
|
1
|
+
{"version":3,"file":"get-branch-beziers.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-branch-beziers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D;;;;;GAKG;AACH,SAAS,gBAAgB,CACjB,MAAc;IAElB,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACxD,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getRealProngCount } from './get-real-prong-count.js';
|
|
2
|
-
import { isFullyTerminating } from './is-fully-terminating.js';
|
|
3
2
|
import { isTerminating } from './is-terminating.js';
|
|
4
3
|
import { isTrivial } from './is-trivial.js';
|
|
5
4
|
/**
|
|
@@ -26,7 +25,7 @@ function getBranch(cpNode) {
|
|
|
26
25
|
do {
|
|
27
26
|
branch.push(cpNode);
|
|
28
27
|
cpNode = cpNode.next;
|
|
29
|
-
} while (
|
|
28
|
+
} while (getRealProngCount(cpNode) === 2);
|
|
30
29
|
return branch;
|
|
31
30
|
}
|
|
32
31
|
export { getBranch };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-branch.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-branch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"get-branch.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-branch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C;;;;;;GAMG;AACH,SAAS,SAAS,CACV,MAAc;IAElB,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC;IACd,CAAC;IAED,+BAA+B;IAC/B,OAAO,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC;IACjC,CAAC;IAED,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;IACrB,OAAO,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;IACzB,CAAC;IACD,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC;IAE7B,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,GAAG,CAAC;QACA,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpB,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;IACzB,CAAC,QAAQ,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAC;IAEzC,OAAO,MAAM,CAAC;AAClB,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -2,8 +2,10 @@ import { totalLength } from "flo-bezier3";
|
|
|
2
2
|
import { memoize } from "flo-memoize";
|
|
3
3
|
import { getMatCurveToNext } from "./get-mat-curve-to-next.js";
|
|
4
4
|
function getMatDistanceToNext(cpNode) {
|
|
5
|
-
|
|
6
|
-
const
|
|
5
|
+
let l = 0;
|
|
6
|
+
for (const ps of getMatCurveToNext(cpNode)) {
|
|
7
|
+
l += totalLength(ps);
|
|
8
|
+
}
|
|
7
9
|
return l;
|
|
8
10
|
}
|
|
9
11
|
const getMatDistanceToNext$ = memoize(getMatDistanceToNext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-distance-to-next.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-distance-to-next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,SAAS,oBAAoB,CACrB,MAAc;IAElB,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"get-distance-to-next.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-distance-to-next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,SAAS,oBAAoB,CACrB,MAAc;IAElB,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,KAAK,MAAM,EAAE,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,CAAC,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,CAAC,CAAC;AACb,CAAC;AAGD,MAAM,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAE3D,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { toUnitVector, fromTo, rotate, translate, rotate90Degrees, reverse as reverseVec, dot } from 'flo-vector2d';
|
|
2
2
|
import { tangent } from 'flo-bezier3';
|
|
3
3
|
import { isPosSharpCorner } from '../../point-on-shape/is-pos-sharp-corner.js';
|
|
4
|
+
const { sqrt } = Math;
|
|
4
5
|
/**
|
|
5
6
|
* Returns a line segment of unit length starting in the given Vertex center and
|
|
6
7
|
* pointing in the direction of the medial axis (viewed as a rooted tree).
|
|
@@ -43,8 +44,8 @@ function getEdgeDirection(cpNode) {
|
|
|
43
44
|
// Recall the identities sin(acos(x)) = sqrt(1-x^2), etc. Also
|
|
44
45
|
// recall the half angle formulas. Then the rotation matrix, R, can
|
|
45
46
|
// be calculated.
|
|
46
|
-
const cosθ =
|
|
47
|
-
const sinθ =
|
|
47
|
+
const cosθ = sqrt((1 + x) / 2);
|
|
48
|
+
const sinθ = sqrt((1 - x) / 2);
|
|
48
49
|
vDir = rotate(sinθ, cosθ, tan2);
|
|
49
50
|
}
|
|
50
51
|
const v = translate(toUnitVector(vDir), circleCenter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-edge-direction.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-edge-direction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,IAAI,UAAU,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACpH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"get-edge-direction.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-edge-direction.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,IAAI,UAAU,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACpH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAE/E,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;AAGtB;;;;;;;GAOG;AACH,SAAS,gBAAgB,CACjB,MAAc;IAElB,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC;IAEvD,MAAM,GAAG,GAAG,MAAM,CAAC;IACnB,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC;IAEhC,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC;IAC9B,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC;IAE9B,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IAClB,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IAElB,IAAI,IAAI,CAAC;IAET,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACrC,IAAI,GAAG,MAAM,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC,YAAY;QACjD,CAAC;aAAM,CAAC;YACJ,IAAI,GAAG,eAAe,CAAE,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAE,CAAC,CAAC,iBAAiB;QAC/D,CAAC;IACL,CAAC;SAAM,CAAC;QACJ,IAAI,MAAa,CAAC;QAClB,IAAI,MAAa,CAAC;QAElB,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;YACf,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;YACpB,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QAC7B,CAAC;aAAM,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACzB,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,CAAC;QAED,MAAM,IAAI,GAAG,YAAY,CAAC,OAAO,CAAC,MAAO,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAClD,MAAM,IAAI,GAAG,UAAU,CAAE,YAAY,CAAC,OAAO,CAAC,MAAO,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC;QAEhE,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC1B,+DAA+D;QAC/D,oEAAoE;QACpE,iBAAiB;QACjB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC;QAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC;QAE7B,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,GAAG,SAAS,CACf,YAAY,CAAC,IAAI,CAAC,EAClB,YAAY,CACf,CAAC;IAEF,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;AAC7B,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { CpNode } from "../cp-node.js";
|
|
1
|
+
import type { CpNode } from "../cp-node.js";
|
|
2
2
|
/**
|
|
3
|
-
* Returns the first `CpNode`
|
|
4
|
-
*
|
|
3
|
+
* Returns the first `CpNode` *after* the given one (by successively applying
|
|
4
|
+
* `.nextOnCircle`) that exits the circle, i.e. the first one that is not
|
|
5
|
+
* terminating - the given `CpNode` itself is never returned.
|
|
6
|
+
*
|
|
7
|
+
* * returns `undefined` if no other `CpNode` on the circle exits (e.g. the
|
|
8
|
+
* other `CpNode` of a 1-prong, or the MAT is a single point)
|
|
5
9
|
*/
|
|
6
10
|
declare function getFirstExit(cpNode: CpNode): CpNode | undefined;
|
|
7
11
|
export { getFirstExit };
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
+
import { isTerminating } from "./is-terminating.js";
|
|
1
2
|
/**
|
|
2
|
-
* Returns the first `CpNode`
|
|
3
|
-
*
|
|
3
|
+
* Returns the first `CpNode` *after* the given one (by successively applying
|
|
4
|
+
* `.nextOnCircle`) that exits the circle, i.e. the first one that is not
|
|
5
|
+
* terminating - the given `CpNode` itself is never returned.
|
|
6
|
+
*
|
|
7
|
+
* * returns `undefined` if no other `CpNode` on the circle exits (e.g. the
|
|
8
|
+
* other `CpNode` of a 1-prong, or the MAT is a single point)
|
|
4
9
|
*/
|
|
5
10
|
function getFirstExit(cpNode) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
cpNode_ = cpNode_.next;
|
|
11
|
-
if (cpNode_ === startNode) {
|
|
12
|
-
// The very special case the MAT is a single point.
|
|
13
|
-
return undefined;
|
|
11
|
+
let cpNode_ = cpNode.nextOnCircle;
|
|
12
|
+
while (cpNode_ !== cpNode) {
|
|
13
|
+
if (!isTerminating(cpNode_)) {
|
|
14
|
+
return cpNode_;
|
|
14
15
|
}
|
|
16
|
+
cpNode_ = cpNode_.nextOnCircle;
|
|
15
17
|
}
|
|
16
|
-
return
|
|
18
|
+
return undefined;
|
|
17
19
|
}
|
|
18
20
|
export { getFirstExit };
|
|
19
21
|
//# sourceMappingURL=get-first-exit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-first-exit.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-first-exit.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-first-exit.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-first-exit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD;;;;;;;GAOG;AACH,SAAS,YAAY,CAAC,MAAc;IAChC,IAAI,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC;IAElC,OAAO,OAAO,KAAK,MAAM,EAAE,CAAC;QACxB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1B,OAAO,OAAO,CAAC;QACnB,CAAC;QACD,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC;IACnC,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import { CpNode } from '../cp-node.js';
|
|
2
|
-
|
|
1
|
+
import type { CpNode } from '../cp-node.js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the bezier curves (an array of 1 or 2 lines or quadratics joined
|
|
4
|
+
* smoothly) approximating the shape boundary between the contact points of
|
|
5
|
+
* two `CpNode`s.
|
|
6
|
+
*
|
|
7
|
+
* @param cpNodeA
|
|
8
|
+
* @param cpNodeB
|
|
9
|
+
*/
|
|
10
|
+
declare function getImpliedBoundaryBezierBetween(cpNodeA: CpNode, cpNodeB: CpNode): number[][][];
|
|
3
11
|
export { getImpliedBoundaryBezierBetween };
|
|
@@ -1,58 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { getBoundaryTangentLine } from '../../point-on-shape/get-boundary-tangent-line.js';
|
|
2
|
+
import { getBeziersFromTangents } from '../../utils/get-beziers-from-tangents.js';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the bezier curves (an array of 1 or 2 lines or quadratics joined
|
|
5
|
+
* smoothly) approximating the shape boundary between the contact points of
|
|
6
|
+
* two `CpNode`s.
|
|
7
|
+
*
|
|
8
|
+
* @param cpNodeA
|
|
9
|
+
* @param cpNodeB
|
|
10
|
+
*/
|
|
7
11
|
function getImpliedBoundaryBezierBetween(cpNodeA, cpNodeB) {
|
|
8
|
-
|
|
9
|
-
const posB = cpNodeB.pointOnShape;
|
|
10
|
-
let { curve: curveA, p: pA, t: tA } = posA;
|
|
11
|
-
let { curve: curveB, p: pB, t: tB } = posB;
|
|
12
|
-
if (pA[0] === pB[0] && pA[1] === pB[1]) {
|
|
13
|
-
return [pA];
|
|
14
|
-
}
|
|
15
|
-
if (tA === 1) {
|
|
16
|
-
tA = 0;
|
|
17
|
-
curveA = curveA.next;
|
|
18
|
-
}
|
|
19
|
-
if (tB === 0) {
|
|
20
|
-
tB = 1;
|
|
21
|
-
curveB = curveB.prev;
|
|
22
|
-
}
|
|
23
|
-
const { ps: psA } = curveA;
|
|
24
|
-
const { ps: psB } = curveB;
|
|
25
|
-
const lA = [pA, translate(pA)(toUnitVector(tangent(psA, tA)))];
|
|
26
|
-
const lB = [pB, translate(pB)(toUnitVector(tangent(psB, tB)))];
|
|
27
|
-
const mid = lineLineIntersection(lA, lB);
|
|
28
|
-
const c = fromTo(pA, pB);
|
|
29
|
-
let twisted;
|
|
30
|
-
if (!mid) {
|
|
31
|
-
twisted = true;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
const a = fromTo(pA, mid);
|
|
35
|
-
const b = fromTo(pB, mid);
|
|
36
|
-
twisted = dot(a, c) < 0 || dot(b, c) > 0;
|
|
37
|
-
}
|
|
38
|
-
if (!twisted) {
|
|
39
|
-
// drawFs.bezier(g, [pA, mid!, pB], 'thin10 pink nofill', 0)
|
|
40
|
-
return [pA, mid, pB];
|
|
41
|
-
}
|
|
42
|
-
const w1 = fromTo(lA[0], lA[1]); // This is a unit vector
|
|
43
|
-
const w2 = fromTo(lB[0], lB[1]); // This is a unit vector
|
|
44
|
-
const d1 = Math.abs(cross(c, w1)) / (3 * 3);
|
|
45
|
-
const d2 = Math.abs(cross(c, w2)) / (3 * 3);
|
|
46
|
-
if (d1 > TOLERANCE_ADD_2PRONG || d2 > TOLERANCE_ADD_2PRONG) {
|
|
47
|
-
// not within tolerance
|
|
48
|
-
return undefined;
|
|
49
|
-
}
|
|
50
|
-
if (d1 > TOLERANCE_USE_LINE || d2 > TOLERANCE_USE_LINE) {
|
|
51
|
-
// approximate with cubic bezier?
|
|
52
|
-
return undefined; // add 2-prong
|
|
53
|
-
}
|
|
54
|
-
// Within tolerance - approximate with a straight line.
|
|
55
|
-
return [pA, pB];
|
|
12
|
+
return getBeziersFromTangents(getBoundaryTangentLine(cpNodeA.pointOnShape, true), getBoundaryTangentLine(cpNodeB.pointOnShape, false));
|
|
56
13
|
}
|
|
57
14
|
export { getImpliedBoundaryBezierBetween };
|
|
58
15
|
//# sourceMappingURL=get-implied-boundary-bezier-between.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-implied-boundary-bezier-between.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-implied-boundary-bezier-between.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-implied-boundary-bezier-between.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-implied-boundary-bezier-between.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mDAAmD,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAGlF;;;;;;;GAOG;AACH,SAAS,+BAA+B,CAChC,OAAe,EACf,OAAe;IAEnB,OAAO,sBAAsB,CACzB,sBAAsB,CAAC,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,EAClD,sBAAsB,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CACtD,CAAC;AACN,CAAC;AAGD,OAAO,EAAE,+BAA+B,EAAE,CAAA"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { CpNode } from '../cp-node.js';
|
|
2
2
|
/**
|
|
3
|
-
* Returns the bezier
|
|
4
|
-
* `CpNode`'s
|
|
3
|
+
* Returns the bezier curves (an array of 1 or 2 lines or quadratics joined
|
|
4
|
+
* smoothly) from the maximal disk of one `CpNode` to another `CpNode`'s
|
|
5
|
+
* maximal disk.
|
|
6
|
+
*
|
|
5
7
|
* @param cpNodeFrom
|
|
6
8
|
* @param cpNodeTo
|
|
7
9
|
*/
|
|
8
|
-
declare function getMatCurveBetween(cpNodeFrom: CpNode, cpNodeTo: CpNode): number[][];
|
|
10
|
+
declare function getMatCurveBetween(cpNodeFrom: CpNode, cpNodeTo: CpNode): number[][][];
|
|
9
11
|
export { getMatCurveBetween };
|
|
@@ -1,58 +1,15 @@
|
|
|
1
|
-
import { fromTo as fromToVec, dot, cross, rotate90Degrees, interpolate, translate, lineLineIntersection } from 'flo-vector2d';
|
|
2
1
|
import { getEdgeDirection } from './get-edge-direction.js';
|
|
3
|
-
|
|
4
|
-
/** @internal */
|
|
5
|
-
const TOLERANCE_ADD_2PRONG = 0.01;
|
|
6
|
-
/** @internal */
|
|
7
|
-
const TOLERANCE_USE_LINE = 0.0001; // else cubic
|
|
2
|
+
import { getBeziersFromTangents } from '../../utils/get-beziers-from-tangents.js';
|
|
8
3
|
/**
|
|
9
|
-
* Returns the bezier
|
|
10
|
-
* `CpNode`'s
|
|
4
|
+
* Returns the bezier curves (an array of 1 or 2 lines or quadratics joined
|
|
5
|
+
* smoothly) from the maximal disk of one `CpNode` to another `CpNode`'s
|
|
6
|
+
* maximal disk.
|
|
7
|
+
*
|
|
11
8
|
* @param cpNodeFrom
|
|
12
9
|
* @param cpNodeTo
|
|
13
10
|
*/
|
|
14
11
|
function getMatCurveBetween(cpNodeFrom, cpNodeTo) {
|
|
15
|
-
|
|
16
|
-
const fromL = getEdgeDirection(cpNodeFrom);
|
|
17
|
-
const toCc = cpNodeTo.pointOnShape.circle.center;
|
|
18
|
-
const toL = getEdgeDirection(cpNodeTo.prevOnCircle);
|
|
19
|
-
const mid = lineLineIntersection(fromL, toL);
|
|
20
|
-
const c = fromToVec(fromCc, toCc);
|
|
21
|
-
let twisted;
|
|
22
|
-
if (!mid) {
|
|
23
|
-
twisted = true;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
const a = fromToVec(fromCc, mid);
|
|
27
|
-
const b = fromToVec(toCc, mid);
|
|
28
|
-
twisted = dot(a, c) < 0 || dot(b, c) > 0;
|
|
29
|
-
}
|
|
30
|
-
if (!twisted) {
|
|
31
|
-
return [fromCc, mid, toCc];
|
|
32
|
-
}
|
|
33
|
-
const r = rotate90Degrees(c);
|
|
34
|
-
const w1 = fromToVec(fromL[0], fromL[1]); // This is a unit vector
|
|
35
|
-
const w2 = fromToVec(toL[0], toL[1]); // This is a unit vector
|
|
36
|
-
const d1 = abs(cross(c, w1)) / (3 * 3);
|
|
37
|
-
const d2 = abs(cross(c, w2)) / (3 * 3);
|
|
38
|
-
if (d1 > TOLERANCE_ADD_2PRONG || d2 > TOLERANCE_ADD_2PRONG) {
|
|
39
|
-
// FUTURE - not within tolerance - must add additional 2-prong
|
|
40
|
-
return [fromCc, toCc];
|
|
41
|
-
}
|
|
42
|
-
if (d1 > TOLERANCE_USE_LINE || d2 > TOLERANCE_USE_LINE) {
|
|
43
|
-
// approximate with cubic bezier
|
|
44
|
-
const m1 = interpolate(fromCc, toCc, 1 / 3);
|
|
45
|
-
const m2 = interpolate(fromCc, toCc, 2 / 3);
|
|
46
|
-
const v1 = translate(r, m1);
|
|
47
|
-
const v2 = translate(r, m2);
|
|
48
|
-
const l1 = [m1, v1];
|
|
49
|
-
const l2 = [m2, v2];
|
|
50
|
-
const mid1 = lineLineIntersection(fromL, l1);
|
|
51
|
-
const mid2 = lineLineIntersection(toL, l2);
|
|
52
|
-
return [fromCc, mid1, mid2, toCc];
|
|
53
|
-
}
|
|
54
|
-
// Within tolerance - approximate with a straight line.
|
|
55
|
-
return [fromCc, toCc];
|
|
12
|
+
return getBeziersFromTangents(getEdgeDirection(cpNodeFrom), getEdgeDirection(cpNodeTo.prevOnCircle));
|
|
56
13
|
}
|
|
57
14
|
export { getMatCurveBetween };
|
|
58
15
|
//# sourceMappingURL=get-mat-curve-between.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-mat-curve-between.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-mat-curve-between.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"get-mat-curve-between.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-mat-curve-between.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAGlF;;;;;;;GAOG;AACH,SAAS,kBAAkB,CACnB,UAAkB,EAClB,QAAgB;IAEpB,OAAO,sBAAsB,CACzB,gBAAgB,CAAC,UAAU,CAAC,EAC5B,gBAAgB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAC1C,CAAC;AACN,CAAC;AAGD,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -5,7 +5,7 @@ import { CpNode } from '../cp-node.js';
|
|
|
5
5
|
* medial axis.
|
|
6
6
|
* @param cpNode
|
|
7
7
|
*/
|
|
8
|
-
declare function getMatCurveToNext(cpNode: CpNode): number[][];
|
|
8
|
+
declare function getMatCurveToNext(cpNode: CpNode): number[][][];
|
|
9
9
|
declare const getMatCurveToNext$: typeof getMatCurveToNext & {
|
|
10
10
|
readonly weakMapS: WeakMap<object, {
|
|
11
11
|
readonly weakMap: WeakMap<object, any>;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import { CpNode } from '../cp-node.js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the (flattened) array of bezier curves (lines or quadratics)
|
|
4
|
+
* representing the medial axis from one `CpNode` to another by following
|
|
5
|
+
* `next` repeatedly.
|
|
6
|
+
*
|
|
7
|
+
* @param cpNodeS
|
|
8
|
+
* @param cpNodeE
|
|
9
|
+
*/
|
|
2
10
|
declare function getMatCurvesBetween(cpNodeS: CpNode, cpNodeE: CpNode): number[][][];
|
|
3
11
|
export { getMatCurvesBetween };
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { getMatCurveBetween } from './get-mat-curve-between.js';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the (flattened) array of bezier curves (lines or quadratics)
|
|
4
|
+
* representing the medial axis from one `CpNode` to another by following
|
|
5
|
+
* `next` repeatedly.
|
|
6
|
+
*
|
|
7
|
+
* @param cpNodeS
|
|
8
|
+
* @param cpNodeE
|
|
9
|
+
*/
|
|
2
10
|
function getMatCurvesBetween(cpNodeS, cpNodeE) {
|
|
3
11
|
let cpNode = cpNodeS;
|
|
4
12
|
const pss = [];
|
|
5
13
|
while (cpNode !== cpNodeE) {
|
|
6
|
-
|
|
7
|
-
pss.push(ps);
|
|
14
|
+
pss.push(...getMatCurveBetween(cpNode, cpNode.next));
|
|
8
15
|
cpNode = cpNode.next;
|
|
9
16
|
}
|
|
10
17
|
return pss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-mat-curves-between.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-mat-curves-between.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE,SAAS,mBAAmB,CACpB,OAAe,EACf,OAAe;IAEnB,IAAI,MAAM,GAAG,OAAO,CAAC;IACrB,MAAM,GAAG,GAAiB,EAAE,CAAC;IAC7B,OAAO,MAAM,KAAK,OAAO,EAAE,CAAC;QACxB,
|
|
1
|
+
{"version":3,"file":"get-mat-curves-between.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-mat-curves-between.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE;;;;;;;GAOG;AACH,SAAS,mBAAmB,CACpB,OAAe,EACf,OAAe;IAEnB,IAAI,MAAM,GAAG,OAAO,CAAC;IACrB,MAAM,GAAG,GAAiB,EAAE,CAAC;IAC7B,OAAO,MAAM,KAAK,OAAO,EAAE,CAAC;QACxB,GAAG,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QAErD,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC;AAGD,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CpNode } from "../cp-node.js";
|
|
2
2
|
/**
|
|
3
3
|
* Returns the number of contact points (up to planar coordinates) on the
|
|
4
|
-
* maximal disk circle implied by this `CpNode
|
|
4
|
+
* maximal disk circle implied by this `CpNode`, i.e. the number of
|
|
5
|
+
* non-terminating `CpNode`s on its circle.
|
|
5
6
|
*
|
|
6
7
|
* See also `getProngCount`.
|
|
7
8
|
*/
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import { getAllOnCircle } from "./get-all-on-circle.js";
|
|
2
1
|
import { isTerminating } from "./is-terminating.js";
|
|
3
2
|
/**
|
|
4
3
|
* Returns the number of contact points (up to planar coordinates) on the
|
|
5
|
-
* maximal disk circle implied by this `CpNode
|
|
4
|
+
* maximal disk circle implied by this `CpNode`, i.e. the number of
|
|
5
|
+
* non-terminating `CpNode`s on its circle.
|
|
6
6
|
*
|
|
7
7
|
* See also `getProngCount`.
|
|
8
8
|
*/
|
|
9
9
|
function getRealProngCount(cpNode) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
let count = 0;
|
|
11
|
+
let cpNode_ = cpNode;
|
|
12
|
+
do {
|
|
13
|
+
if (!isTerminating(cpNode_)) {
|
|
14
|
+
count++;
|
|
15
|
+
}
|
|
16
|
+
cpNode_ = cpNode_.nextOnCircle;
|
|
17
|
+
} while (cpNode_ !== cpNode);
|
|
18
|
+
return count;
|
|
13
19
|
}
|
|
14
20
|
export { getRealProngCount };
|
|
15
21
|
//# sourceMappingURL=get-real-prong-count.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-real-prong-count.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-real-prong-count.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"get-real-prong-count.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-real-prong-count.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD;;;;;;GAMG;AACH,SAAS,iBAAiB,CAAC,MAAc;IACrC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,OAAO,GAAG,MAAM,CAAC;IACrB,GAAG,CAAC;QACA,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;YAAC,KAAK,EAAE,CAAC;QAAC,CAAC;QACzC,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC;IACnC,CAAC,QAAQ,OAAO,KAAK,MAAM,EAAE;IAE7B,OAAO,KAAK,CAAC;AACjB,CAAC;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import type { CpNode } from "../cp-node.js";
|
|
2
2
|
/**
|
|
3
|
+
* Returns the salience of the given `CpNode`: the ratio of the boundary length
|
|
4
|
+
* from its contact point forward to the next contact point on its circle to
|
|
5
|
+
* the straight distance between those two points.
|
|
6
|
+
*
|
|
7
|
+
* * `Infinity` if that stretch of boundary passes a hole closer
|
|
8
|
+
* * `0` if the two contact points coincide with no boundary in between (the
|
|
9
|
+
* terminating `CpNode` of a 1-prong) - the other `CpNode` of a 1-prong,
|
|
10
|
+
* whose stretch is the entire boundary, gives `Infinity`
|
|
11
|
+
*
|
|
3
12
|
* See https://research.gold.ac.uk/id/eprint/31944/
|
|
13
|
+
*
|
|
4
14
|
* @param cpNode
|
|
5
15
|
*/
|
|
6
16
|
declare function getSalience(cpNode: CpNode): number;
|
|
@@ -3,7 +3,17 @@ import { totalLength } from "flo-bezier3";
|
|
|
3
3
|
import { getBoundaryBeziersBetween } from "./get-boundary-beziers-between.js";
|
|
4
4
|
import { sum } from '../../utils/sum.js';
|
|
5
5
|
/**
|
|
6
|
+
* Returns the salience of the given `CpNode`: the ratio of the boundary length
|
|
7
|
+
* from its contact point forward to the next contact point on its circle to
|
|
8
|
+
* the straight distance between those two points.
|
|
9
|
+
*
|
|
10
|
+
* * `Infinity` if that stretch of boundary passes a hole closer
|
|
11
|
+
* * `0` if the two contact points coincide with no boundary in between (the
|
|
12
|
+
* terminating `CpNode` of a 1-prong) - the other `CpNode` of a 1-prong,
|
|
13
|
+
* whose stretch is the entire boundary, gives `Infinity`
|
|
14
|
+
*
|
|
6
15
|
* See https://research.gold.ac.uk/id/eprint/31944/
|
|
16
|
+
*
|
|
7
17
|
* @param cpNode
|
|
8
18
|
*/
|
|
9
19
|
function getSalience(cpNode) {
|
|
@@ -14,7 +24,13 @@ function getSalience(cpNode) {
|
|
|
14
24
|
const d = distanceBetween(bp1, bp2);
|
|
15
25
|
const { pss, hasHoleCloser } = getBoundaryBeziersBetween(cpNode1, cpNode2);
|
|
16
26
|
const s = sum(pss.map(ps => totalLength(ps)));
|
|
17
|
-
|
|
27
|
+
if (hasHoleCloser) {
|
|
28
|
+
return Infinity;
|
|
29
|
+
}
|
|
30
|
+
if (s === 0) {
|
|
31
|
+
return 0;
|
|
32
|
+
} // (avoids `0/0` for the 1-prong case)
|
|
33
|
+
return s / d;
|
|
18
34
|
}
|
|
19
35
|
export { getSalience };
|
|
20
36
|
//# sourceMappingURL=get-salience.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-salience.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-salience.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAGzC
|
|
1
|
+
{"version":3,"file":"get-salience.js","sourceRoot":"","sources":["../../../src/cp-node/fs/get-salience.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAGzC;;;;;;;;;;;;;GAaG;AACH,SAAS,WAAW,CAAC,MAAc;IAC/B,MAAM,OAAO,GAAG,MAAM,CAAC;IACvB,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC;IACpC,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;IACnC,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnC,MAAM,CAAC,GAAG,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAEpC,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,yBAAyB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAE3E,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE9C,IAAI,aAAa,EAAE,CAAC;QAAC,OAAO,QAAQ,CAAC;IAAC,CAAC;IACvC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAAC,OAAO,CAAC,CAAC;IAAC,CAAC,CAAE,sCAAsC;IAElE,OAAO,CAAC,GAAC,CAAC,CAAC;AACf,CAAC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { CpNode } from "../cp-node.js";
|
|
2
2
|
/**
|
|
3
|
-
* Like isTerminating
|
|
4
|
-
* (except this.prevOnCircle)
|
|
3
|
+
* Like `isTerminating` but only returns `true` if all `CpNode`s on the circle
|
|
4
|
+
* (except possibly the one leading back, i.e. `this.prevOnCircle`) are
|
|
5
|
+
* terminating - i.e. the `CpNode` is terminating and its vertex has at most
|
|
6
|
+
* one real prong.
|
|
5
7
|
*/
|
|
6
8
|
declare function isFullyTerminating(cpNode: CpNode): boolean;
|
|
7
9
|
export { isFullyTerminating };
|
|
@@ -1,24 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getRealProngCount } from "./get-real-prong-count.js";
|
|
2
2
|
import { isTerminating } from "./is-terminating.js";
|
|
3
|
-
import { isTrivial } from "./is-trivial.js";
|
|
4
3
|
/**
|
|
5
|
-
* Like isTerminating
|
|
6
|
-
* (except this.prevOnCircle)
|
|
4
|
+
* Like `isTerminating` but only returns `true` if all `CpNode`s on the circle
|
|
5
|
+
* (except possibly the one leading back, i.e. `this.prevOnCircle`) are
|
|
6
|
+
* terminating - i.e. the `CpNode` is terminating and its vertex has at most
|
|
7
|
+
* one real prong.
|
|
7
8
|
*/
|
|
8
9
|
function isFullyTerminating(cpNode) {
|
|
9
|
-
|
|
10
|
-
// return otherOnCircle.every(isTerminating);
|
|
11
|
-
if (!isTerminating(cpNode)) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
if (isTrivial(cpNode)) {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
while (cpNode.prev === cpNode.prevOnCircle) {
|
|
18
|
-
cpNode = cpNode.prev;
|
|
19
|
-
}
|
|
20
|
-
const otherOnCircle = getAllOnCircle(cpNode.prevOnCircle, true);
|
|
21
|
-
return otherOnCircle.every(isTerminating);
|
|
10
|
+
return isTerminating(cpNode) && getRealProngCount(cpNode) <= 1;
|
|
22
11
|
}
|
|
23
12
|
export { isFullyTerminating };
|
|
24
13
|
//# sourceMappingURL=is-fully-terminating.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-fully-terminating.js","sourceRoot":"","sources":["../../../src/cp-node/fs/is-fully-terminating.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"is-fully-terminating.js","sourceRoot":"","sources":["../../../src/cp-node/fs/is-fully-terminating.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD;;;;;GAKG;AACH,SAAS,kBAAkB,CAAC,MAAc;IACtC,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC;AAGD,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|