flo-mat 4.1.5 → 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/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/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 +13944 -10307
- package/browser/index.min.js +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/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.js +6 -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-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 +9 -1
- package/node/cp-node/fs/get-implied-boundary-bezier-between.js +11 -55
- 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 +4 -3
- package/node/cp-node/fs/get-mat-curve-between.js +5 -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 -15
- package/node/cp-node/fs/is-fully-terminating.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 +1 -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 +1 -7
- 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 +35 -41
- 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 +11 -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-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/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 +8 -8
- package/qv-infinite-loop.md +120 -0
- 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 +6 -4
- 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-first-exit.ts +15 -14
- package/src/cp-node/fs/get-implied-boundary-bezier-between.ts +17 -69
- package/src/cp-node/fs/get-mat-curve-between.ts +9 -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 -18
- 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 -75
- 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 +2 -9
- 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 +12 -10
- 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-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/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/get-beziers-from-tangents.ts +110 -0
- package/src/utils/map-map.ts +1 -1
- package/src/vertex/remove-vertex.ts +5 -3
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"from-stringifyable.js","sourceRoot":"","sources":["../../../src/cp-node/stringification/from-stringifyable.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"from-stringifyable.js","sourceRoot":"","sources":["../../../src/cp-node/stringification/from-stringifyable.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAGrE,SAAS,iBAAiB,CAClB,oBAAyC;IAE7C,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,oBAAoB,CAAC;IAClE,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC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E,KAAK,SAAS,EAAE,CAAC;gBAAC,SAAS;YAAC,CAAC;YAEnC,aAAa;YACb,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC;QACpC,CAAC;IACL,CAAC;IAED,4EAA4E;IAC5E,yEAAyE;IACzE,kEAAkE;IAClE,4EAA4E;IAC5E,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAAC,SAAS;QAAC,CAAC;QAEnC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,YAAY,CAAC;QACvC,KAAK,MAAM,EAAE,IAAI,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;YACtC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACZ,EAAE,CAAC,YAAsC,CAAC,MAAM,GAAG,MAAM,CAAC;QAC/D,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { CpNodeStringifyable } from "./cp-node-stringifyable.js";
|
|
2
2
|
import type { CpNode } from "../cp-node.js";
|
|
3
3
|
/**
|
|
4
|
-
* Returns a
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Returns a plain, acyclic representation of the entire MAT the given `CpNode`
|
|
5
|
+
* is part of (the `CpNode` edges replaced by ids and the boundary loops
|
|
6
|
+
* included) suitable for `JSON.stringify`; `fromStringifyable` reverses it.
|
|
7
7
|
*/
|
|
8
8
|
declare function toStringifyable(cpNode: CpNode): CpNodeStringifyable;
|
|
9
9
|
export { toStringifyable };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { loopToStringifyable } from "./loop-to-stringifyable.js";
|
|
2
2
|
/**
|
|
3
|
-
* Returns a
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Returns a plain, acyclic representation of the entire MAT the given `CpNode`
|
|
4
|
+
* is part of (the `CpNode` edges replaced by ids and the boundary loops
|
|
5
|
+
* included) suitable for `JSON.stringify`; `fromStringifyable` reverses it.
|
|
6
6
|
*/
|
|
7
7
|
function toStringifyable(cpNode) {
|
|
8
8
|
const cpNodes_ = [];
|
package/node/debug/debug.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { Curve } from 'flo-boolean';
|
|
1
2
|
/** @internal */
|
|
2
3
|
interface Debug {
|
|
3
4
|
/** Generated by debug object for later inspection */
|
|
4
|
-
elems:
|
|
5
|
+
elems: Elems;
|
|
5
6
|
timing: Timing;
|
|
6
7
|
/**
|
|
7
8
|
* These functions are meant to be used in the console, e.g. in the
|
|
@@ -10,6 +11,26 @@ interface Debug {
|
|
|
10
11
|
fs: {};
|
|
11
12
|
directives: Directives;
|
|
12
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Elements generated during `findMats` for later inspection (only available
|
|
16
|
+
* if debug has been enabled via `enableDebugForMat(true)`).
|
|
17
|
+
*
|
|
18
|
+
* The arrays are reset at the start of each `findMats` call and accumulate
|
|
19
|
+
* over all MATs found in that call, one entry per boundary bezier curve in the
|
|
20
|
+
* order the curves are encountered.
|
|
21
|
+
*/
|
|
22
|
+
interface Elems {
|
|
23
|
+
/** The loose (axis-aligned) bounding box of each boundary bezier curve */
|
|
24
|
+
readonly looseBoundingBoxes: number[][][];
|
|
25
|
+
/** The tight (rotated) bounding box of each boundary bezier curve */
|
|
26
|
+
readonly tightBoundingBoxes: number[][][];
|
|
27
|
+
/** The bounding hull of each boundary bezier curve */
|
|
28
|
+
readonly boundingHulls: number[][][];
|
|
29
|
+
/** The curves whose end point forms a quite sharp corner with the next curve */
|
|
30
|
+
readonly sharpCorners: Curve[];
|
|
31
|
+
/** The curves whose end point forms a quite dull corner with the next curve */
|
|
32
|
+
readonly dullCorners: Curve[];
|
|
33
|
+
}
|
|
13
34
|
/** @internal */
|
|
14
35
|
interface Timing {
|
|
15
36
|
holeClosers: number;
|
|
@@ -27,6 +48,8 @@ interface Directives {
|
|
|
27
48
|
stopAfterThreeProngs: boolean;
|
|
28
49
|
stopAfterThreeProngsNum: number;
|
|
29
50
|
}
|
|
51
|
+
/** Returns a fresh (empty) set of debug `Elems`. */
|
|
52
|
+
declare function createEmptyElems(): Elems;
|
|
30
53
|
declare function enableDebugForMat(debugOn: boolean): void;
|
|
31
|
-
export type { Debug, Timing, Directives };
|
|
32
|
-
export { enableDebugForMat };
|
|
54
|
+
export type { Debug, Elems, Timing, Directives };
|
|
55
|
+
export { enableDebugForMat, createEmptyElems };
|
package/node/debug/debug.js
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
|
+
/** Returns a fresh (empty) set of debug `Elems`. */
|
|
2
|
+
function createEmptyElems() {
|
|
3
|
+
return {
|
|
4
|
+
looseBoundingBoxes: [],
|
|
5
|
+
tightBoundingBoxes: [],
|
|
6
|
+
boundingHulls: [],
|
|
7
|
+
sharpCorners: [],
|
|
8
|
+
dullCorners: []
|
|
9
|
+
};
|
|
10
|
+
}
|
|
1
11
|
function enableDebugForMat(debugOn) {
|
|
2
12
|
if (!debugOn) {
|
|
3
|
-
|
|
13
|
+
globalThis._debug_ = undefined;
|
|
4
14
|
return;
|
|
5
15
|
}
|
|
6
|
-
let debug =
|
|
16
|
+
let debug = globalThis._debug_;
|
|
7
17
|
debug = {
|
|
8
18
|
...debug,
|
|
9
19
|
elems: {
|
|
10
|
-
...debug?.elems
|
|
20
|
+
...debug?.elems,
|
|
21
|
+
...createEmptyElems()
|
|
11
22
|
},
|
|
12
23
|
timing: {
|
|
13
24
|
...debug?.timing,
|
|
@@ -31,7 +42,7 @@ function enableDebugForMat(debugOn) {
|
|
|
31
42
|
stopAfterThreeProngsNum: undefined,
|
|
32
43
|
}
|
|
33
44
|
};
|
|
34
|
-
|
|
45
|
+
globalThis._debug_ = debug;
|
|
35
46
|
}
|
|
36
|
-
export { enableDebugForMat };
|
|
47
|
+
export { enableDebugForMat, createEmptyElems };
|
|
37
48
|
//# sourceMappingURL=debug.js.map
|
package/node/debug/debug.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../src/debug/debug.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../src/debug/debug.ts"],"names":[],"mappings":"AA6DA,oDAAoD;AACpD,SAAS,gBAAgB;IACrB,OAAO;QACH,kBAAkB,EAAE,EAAE;QACtB,kBAAkB,EAAE,EAAE;QACtB,aAAa,EAAE,EAAE;QACjB,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,EAAE;KAClB,CAAC;AACN,CAAC;AAGD,SAAS,iBAAiB,CAAC,OAAgB;IACvC,IAAI,CAAC,OAAO,EAAE,CAAC;QACV,UAAkB,CAAC,OAAO,GAAG,SAAS,CAAC;QACxC,OAAO;IACX,CAAC;IAED,IAAI,KAAK,GAAW,UAAkB,CAAC,OAAO,CAAC;IAE/C,KAAK,GAAG;QACJ,GAAG,KAAK;QACR,KAAK,EAAE;YACH,GAAG,KAAK,EAAE,KAAK;YACf,GAAG,gBAAgB,EAAE;SACxB;QACD,MAAM,EAAE;YACJ,GAAG,KAAK,EAAE,MAAM;YAChB,WAAW,EAAE,CAAC;YACd,aAAa,EAAE,CAAC;YAChB,WAAW,EAAE,CAAC;YACd,IAAI,EAAE,CAAC;YACP,WAAW,EAAE,CAAC;SACjB;QACD,EAAE,EAAE;YACA,GAAG,KAAK,EAAE,EAAE;SACf;QACD,UAAU,EAAE;YACR,uBAAuB;YACvB,GAAG,KAAK,EAAE,UAAU;YACpB,oBAAoB,EAAE,KAAK;YAC3B,uBAAuB,EAAE,SAAU;YACnC,kBAAkB,EAAE,KAAK;YACzB,qBAAqB,EAAE,SAAU;YACjC,oBAAoB,EAAE,KAAK;YAC3B,uBAAuB,EAAE,SAAU;SACtC;KACJ,CAAC;IAED,UAAkB,CAAC,OAAO,GAAG,KAAK,CAAC;AACxC,CAAC;AAID,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -20,12 +20,6 @@ function add2Prong(meta, circle, pposSource, pposAntipode, isHoleClosing) {
|
|
|
20
20
|
: pposSource;
|
|
21
21
|
const orderSource = calcPosOrder(circle.center, pposSource);
|
|
22
22
|
const orderAntipode = calcPosOrder(circle.center, pposAntipode);
|
|
23
|
-
const posAntipode = {
|
|
24
|
-
...pposAntipode, circle, order: orderAntipode, order2: 0
|
|
25
|
-
};
|
|
26
|
-
const posSource = {
|
|
27
|
-
...pposSource, circle, order: orderSource, order2: 0
|
|
28
|
-
};
|
|
29
23
|
// Make sure there isn't already a ContactPoint close by - it can cause
|
|
30
24
|
// floating point stability issues.
|
|
31
25
|
if (!!getCloseByCpIfExist(meta, pposSource, circle, orderSource, 0, 2)) {
|
|
@@ -34,7 +28,7 @@ function add2Prong(meta, circle, pposSource, pposAntipode, isHoleClosing) {
|
|
|
34
28
|
if (!!getCloseByCpIfExist(meta, pposAntipode, circle, orderAntipode, 0, 2)) {
|
|
35
29
|
return undefined;
|
|
36
30
|
}
|
|
37
|
-
const { anyFailed, cpNodes } = addToCpTree(isHoleClosing, isHoleClosing, circle, [orderSource, orderAntipode], meta, [
|
|
31
|
+
const { anyFailed, cpNodes } = addToCpTree(isHoleClosing, isHoleClosing, circle, [orderSource, orderAntipode], meta, [pposSource, pposAntipode]);
|
|
38
32
|
if (anyFailed) {
|
|
39
33
|
cpNodes.forEach(cpNode => {
|
|
40
34
|
if (cpNode !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-2-prong.js","sourceRoot":"","sources":["../../src/find-2-prong/add-2-prong.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAq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C;IACnD,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;IACnD,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;IAEnD,cAAc,CAAC,IAAI,GAAG,YAAY,CAAC;IACnC,YAAY,CAAC,IAAI,GAAG,cAAc,CAAC;IAEnC,gBAAgB,CAAC,IAAI,GAAG,kBAAkB,CAAC;IAC3C,kBAAkB,CAAC,IAAI,GAAG,gBAAgB,CAAC;AAC/C,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Returns the *squared* separation tolerance between the two contact points
|
|
3
|
+
* `y` (the source point) and `z` (the antipode) of a candidate 2-prong: if
|
|
4
|
+
* `|yz|²` is below it the antipode is indistinguishable (to within the error
|
|
5
|
+
* tolerance `δ`) from the circle merely grazing the boundary at `y` - the
|
|
6
|
+
* near-1-prong case - and the 2-prong should be rejected.
|
|
3
7
|
*
|
|
4
|
-
*
|
|
8
|
+
* Derivation: the MAT circle (radius `r`) is tangent to the boundary at `y`
|
|
9
|
+
* and so is the osculating circle there (radius `R`), both centers lying on
|
|
10
|
+
* the inward normal at `y`. Approximating the boundary near `y` by the
|
|
11
|
+
* osculating circle, the MAT circle enlarged by `δ` crosses it at the angle
|
|
12
|
+
* `θ` (at the MAT center, measured from `y`) given by the law of cosines:
|
|
13
|
+
*
|
|
14
|
+
* cos θ = (r(R-r) - rδ - δ²/2) / ((R-r)(r+δ))
|
|
15
|
+
*
|
|
16
|
+
* Points of the MAT circle within that angle of `y` are within `δ` of the
|
|
17
|
+
* boundary. The chord `|yz|` subtending `θ` is `2r·sin(θ/2)`, and since
|
|
18
|
+
* `2sin²(θ/2) = 1 - cos θ = (Rδ + δ²/2) / ((R-r)(r+δ))` the squared chord is
|
|
19
|
+
*
|
|
20
|
+
* |yz|² = r²(2Rδ + δ²) / ((R-r)(r+δ))
|
|
21
|
+
*
|
|
22
|
+
* which is what is returned - in closed form, without the cancellation that
|
|
23
|
+
* recovering a tiny `θ` from `cos θ` suffers from.
|
|
24
|
+
*
|
|
25
|
+
* @param R radius of the osculating circle of the boundary at `y`
|
|
5
26
|
* @param r radius of the MAT circle
|
|
6
|
-
* @param
|
|
27
|
+
* @param δ the error tolerance on distances
|
|
28
|
+
*
|
|
29
|
+
* @internal
|
|
7
30
|
*/
|
|
8
|
-
declare function
|
|
9
|
-
export {
|
|
31
|
+
declare function calcSquaredSeperationTolerance(R: number, r: number, δ: number): number;
|
|
32
|
+
export { calcSquaredSeperationTolerance };
|
|
@@ -1,97 +1,40 @@
|
|
|
1
|
-
import { ddAddDd, twoProduct, ddDiffDd, ddDivDd, twoDiff, ddMultDouble1 } from 'double-double';
|
|
2
|
-
const tp = twoProduct;
|
|
3
|
-
const qaq = ddAddDd;
|
|
4
|
-
const qdq = ddDiffDd;
|
|
5
|
-
const qmd = ddMultDouble1;
|
|
6
|
-
const { acos } = Math;
|
|
7
1
|
/**
|
|
8
|
-
*
|
|
2
|
+
* Returns the *squared* separation tolerance between the two contact points
|
|
3
|
+
* `y` (the source point) and `z` (the antipode) of a candidate 2-prong: if
|
|
4
|
+
* `|yz|²` is below it the antipode is indistinguishable (to within the error
|
|
5
|
+
* tolerance `δ`) from the circle merely grazing the boundary at `y` - the
|
|
6
|
+
* near-1-prong case - and the 2-prong should be rejected.
|
|
9
7
|
*
|
|
10
|
-
*
|
|
8
|
+
* Derivation: the MAT circle (radius `r`) is tangent to the boundary at `y`
|
|
9
|
+
* and so is the osculating circle there (radius `R`), both centers lying on
|
|
10
|
+
* the inward normal at `y`. Approximating the boundary near `y` by the
|
|
11
|
+
* osculating circle, the MAT circle enlarged by `δ` crosses it at the angle
|
|
12
|
+
* `θ` (at the MAT center, measured from `y`) given by the law of cosines:
|
|
13
|
+
*
|
|
14
|
+
* cos θ = (r(R-r) - rδ - δ²/2) / ((R-r)(r+δ))
|
|
15
|
+
*
|
|
16
|
+
* Points of the MAT circle within that angle of `y` are within `δ` of the
|
|
17
|
+
* boundary. The chord `|yz|` subtending `θ` is `2r·sin(θ/2)`, and since
|
|
18
|
+
* `2sin²(θ/2) = 1 - cos θ = (Rδ + δ²/2) / ((R-r)(r+δ))` the squared chord is
|
|
19
|
+
*
|
|
20
|
+
* |yz|² = r²(2Rδ + δ²) / ((R-r)(r+δ))
|
|
21
|
+
*
|
|
22
|
+
* which is what is returned - in closed form, without the cancellation that
|
|
23
|
+
* recovering a tiny `θ` from `cos θ` suffers from.
|
|
24
|
+
*
|
|
25
|
+
* @param R radius of the osculating circle of the boundary at `y`
|
|
11
26
|
* @param r radius of the MAT circle
|
|
12
|
-
* @param
|
|
27
|
+
* @param δ the error tolerance on distances
|
|
28
|
+
*
|
|
29
|
+
* @internal
|
|
13
30
|
*/
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
31
|
+
function calcSquaredSeperationTolerance(R, r, δ) {
|
|
32
|
+
if (r + δ >= R) {
|
|
33
|
+
// The enlarged MAT circle is at least as large as the osculating
|
|
34
|
+
// circle: every point on it is within tolerance of the boundary.
|
|
17
35
|
return Infinity;
|
|
18
36
|
}
|
|
19
|
-
|
|
20
|
-
const A_ = qmd(r, R_r_);
|
|
21
|
-
const N_ = qdq(qdq(A_, tp(r, δ)), tp(δ, δ / 2));
|
|
22
|
-
const D_ = qaq(A_, qmd(δ, R_r_));
|
|
23
|
-
const R_r = R - r;
|
|
24
|
-
const A = r * R_r;
|
|
25
|
-
const N = A - r * δ - (δ * δ) / 2;
|
|
26
|
-
const D = A + R_r * δ;
|
|
27
|
-
const cosC = N / D;
|
|
28
|
-
const Q = ddDivDd(N_, D_)[1];
|
|
29
|
-
// const Q = N_[1]/D_[1];
|
|
30
|
-
const C = acos(cosC);
|
|
31
|
-
const CC = acos(Q);
|
|
32
|
-
const θ = CC;
|
|
33
|
-
// return r*θ;
|
|
34
|
-
return r * θ;
|
|
37
|
+
return r * r * (2 * R * δ + δ * δ) / ((R - r) * (r + δ));
|
|
35
38
|
}
|
|
36
|
-
export {
|
|
37
|
-
// Quokka tests
|
|
38
|
-
// /**
|
|
39
|
-
// * Calculates and returns an appropriate seperation tolerance between `CpNode`s.
|
|
40
|
-
// *
|
|
41
|
-
// * @param R radius of the circle implied by the curvature at the boundary
|
|
42
|
-
// * @param r radius of the MAT circle
|
|
43
|
-
// * @param θ angle between point...
|
|
44
|
-
// */
|
|
45
|
-
// function calcSeperationTolerance2(
|
|
46
|
-
// R: number,
|
|
47
|
-
// r: number,
|
|
48
|
-
// δ: number) {
|
|
49
|
-
// const a = r + δ;
|
|
50
|
-
// if (a >= R) {
|
|
51
|
-
// return Infinity;
|
|
52
|
-
// }
|
|
53
|
-
// const b = R - r;
|
|
54
|
-
// const c = R;
|
|
55
|
-
// const N = c*c - a*a - b*b;
|
|
56
|
-
// const N_ = qdq(qdq(tp(c,c), tp(a,a)), tp(b,b));
|
|
57
|
-
// const D = 2*a*b;
|
|
58
|
-
// const D_ = tp(-2*a,b);
|
|
59
|
-
// const Q = ddDivDd(N_,D_)[1];
|
|
60
|
-
// const cosC = -N/D;
|
|
61
|
-
// const C = acos(cosC);
|
|
62
|
-
// const CC = acos(Q);
|
|
63
|
-
// const θ = π - CC;
|
|
64
|
-
// return θ;
|
|
65
|
-
// // return r*θ; // approximate arc with line
|
|
66
|
-
// }
|
|
67
|
-
// function degToRad(degrees: number) {
|
|
68
|
-
// return degrees/360*2*PI;
|
|
69
|
-
// }
|
|
70
|
-
// function radToDeg(rad: number) {
|
|
71
|
-
// return rad*360/2/PI;
|
|
72
|
-
// }
|
|
73
|
-
// const R = 699;
|
|
74
|
-
// const r = 698;
|
|
75
|
-
// const δ = 1000*2**-46;
|
|
76
|
-
// calcSeperationTolerance(R,r,δ);
|
|
77
|
-
// calcSeperationTolerance2(R,r,δ);
|
|
78
|
-
// calcSeperationTolerance3(R,r,δ);
|
|
79
|
-
// // * see https://en.wikipedia.org/wiki/Law_of_cosines, Version suited to small angles
|
|
80
|
-
// function calcSeperationTolerance3(
|
|
81
|
-
// R: number,
|
|
82
|
-
// r: number,
|
|
83
|
-
// δ: number) {
|
|
84
|
-
// const a = r + δ;
|
|
85
|
-
// const c = R - r;
|
|
86
|
-
// const b = R;
|
|
87
|
-
// // c² = (a - b)² + 4ab*sin²(θ/2) OR
|
|
88
|
-
// // (c² - (a - b)²)/4ab = sin²(θ/2)
|
|
89
|
-
// const cc = c*c;
|
|
90
|
-
// const abc = a*a + b*b - 2*a*b;
|
|
91
|
-
// const A = cc - abc;
|
|
92
|
-
// const B = sqrt(A/(4*a*b));
|
|
93
|
-
// const θ = 2*asin(B);
|
|
94
|
-
// return θ;
|
|
95
|
-
// // return r*θ; // approximate arc with line
|
|
96
|
-
// }
|
|
39
|
+
export { calcSquaredSeperationTolerance };
|
|
97
40
|
//# sourceMappingURL=calc-seperation-tolerance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calc-seperation-tolerance.js","sourceRoot":"","sources":["../../src/find-2-prong/calc-seperation-tolerance.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"calc-seperation-tolerance.js","sourceRoot":"","sources":["../../src/find-2-prong/calc-seperation-tolerance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAS,8BAA8B,CAC/B,CAAS,EACT,CAAS,EACT,CAAS;IAEb,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QACb,iEAAiE;QACjE,iEAAiE;QACjE,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED,OAAO,CAAC,GAAC,CAAC,GAAC,CAAC,CAAC,GAAC,CAAC,GAAC,CAAC,GAAG,CAAC,GAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC;AAGD,OAAO,EAAE,8BAA8B,EAAE,CAAA"}
|
|
@@ -2,10 +2,10 @@ import { getInitialCurvePieces } from './get-initial-bezier-pieces.js';
|
|
|
2
2
|
import { getAntipodalPoints } from './get-medial/get-antipodal-points.js';
|
|
3
3
|
import { reduceRadius } from './reduce-radius.js';
|
|
4
4
|
import { squaredDistanceBetweenDd } from './squared-distance-between-dd.js';
|
|
5
|
-
import { cullCurvePieces } from '
|
|
5
|
+
import { cullCurvePieces } from '../closest-boundary-point/cull-curve-pieces.js';
|
|
6
6
|
import { add1Prong } from './add-1-prong.js';
|
|
7
7
|
import { toP } from '../point-on-shape/to-p.js';
|
|
8
|
-
import {
|
|
8
|
+
import { calcSquaredSeperationTolerance } from './calc-seperation-tolerance.js';
|
|
9
9
|
import { getInitialX } from './get-initial-x.js';
|
|
10
10
|
import { ddNormal } from 'flo-bezier3';
|
|
11
11
|
import { rotate } from 'flo-vector2d';
|
|
@@ -58,18 +58,16 @@ function find2Prong(meta) {
|
|
|
58
58
|
// the 2-prong circle. (Defined by start and end points).
|
|
59
59
|
const curvePieces = getInitialCurvePieces(angle, isHoleClosing, loop, loops, meta, yPos, xO);
|
|
60
60
|
// The lines below is an optimization.
|
|
61
|
-
const xy2 = reduceRadius(
|
|
61
|
+
const xy2 = reduceRadius(rO, curvePieces, y, nnorm);
|
|
62
62
|
const xy = sqrt(xy2);
|
|
63
63
|
const l = sqrt(nnorm[0] ** 2 + nnorm[1] ** 2);
|
|
64
64
|
xO = [y[0] + nnorm[0] / l * xy, y[1] + nnorm[1] / l * xy];
|
|
65
|
-
|
|
66
|
-
const
|
|
65
|
+
// (the extra multiplier accounts for floating point error)
|
|
66
|
+
const culledCurvePieces = cullCurvePieces(curvePieces, xO, (1 + 2 ** -20) * xy2);
|
|
67
|
+
const antipodalPoints = getAntipodalPoints(maxCoordPowerOf2, nnormDd, yPos, for1Prong, angle, culledCurvePieces);
|
|
67
68
|
// FUTURE - if antipodalPoints.length > 1 let's just add an n-prong;
|
|
68
69
|
if (antipodalPoints.length !== 1) {
|
|
69
70
|
if (antipodalPoints.length === 0) {
|
|
70
|
-
if (isHoleClosing) {
|
|
71
|
-
console.log(yPos);
|
|
72
|
-
}
|
|
73
71
|
return undefined;
|
|
74
72
|
}
|
|
75
73
|
if (!isHoleClosing && !areAllAntipodesSame(antipodalPoints, maxCoordPowerOf2)) {
|
|
@@ -99,7 +97,7 @@ function find2Prong(meta) {
|
|
|
99
97
|
}
|
|
100
98
|
// The lines below eliminate cases where the found 2-prong is too
|
|
101
99
|
// close to a one-prong
|
|
102
|
-
const squaredSeperationTolerance = max(
|
|
100
|
+
const squaredSeperationTolerance = max(calcSquaredSeperationTolerance(rO, sqrt(xz), (2 ** 2) * errorTolerance), minSquaredSeperationTolerance);
|
|
103
101
|
if (yz <= squaredSeperationTolerance) {
|
|
104
102
|
return undefined;
|
|
105
103
|
}
|
|
@@ -117,7 +115,7 @@ function areAllAntipodesSame(point, maxCoordPowerOf2) {
|
|
|
117
115
|
// return false;
|
|
118
116
|
// }
|
|
119
117
|
const { x: x_ } = point[i];
|
|
120
|
-
if (abs(x[0] - x_[0]) > tol || abs(x[
|
|
118
|
+
if (abs(x[0] - x_[0]) > tol || abs(x[1] - x_[1]) > tol) {
|
|
121
119
|
return false;
|
|
122
120
|
}
|
|
123
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-2-prong.js","sourceRoot":"","sources":["../../src/find-2-prong/find-2-prong.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"find-2-prong.js","sourceRoot":"","sources":["../../src/find-2-prong/find-2-prong.ts"],"names":[],"mappings":"AAIA,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6BAA6B,CAChC,CAAC;YACF,IAAI,EAAE,IAAI,0BAA0B,EAAE,CAAC;gBACnC,OAAO,SAAS,CAAC;YACrB,CAAC;QACL,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACzB,CAAC,CAAA;AACL,CAAC;AAGD,gBAAgB;AAChB,SAAS,mBAAmB,CACpB,KAAuB,EACvB,gBAAwB;IAE5B,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,GAAG,GAAG,CAAC,IAAE,CAAC,gBAAgB,GAAG,EAAE,CAAC,CAAC;IACvC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChC,6CAA6C;QAC7C,sCAAsC;QACtC,oBAAoB;QACpB,IAAI;QAEJ,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC;YACrD,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { find2Prong } from './find-2-prong.js';
|
|
2
2
|
import { add2Prong } from './add-2-prong.js';
|
|
3
3
|
import { rotateNeg90Degrees } from 'flo-vector2d';
|
|
4
|
-
import { getCorner } from '../corner/get-corner.js';
|
|
4
|
+
import { getCorner$ } from '../corner/get-corner.js';
|
|
5
5
|
const { PI, atan2 } = Math;
|
|
6
6
|
// const ANGLE = 15*PI/180; // 15 degrees - don't make smaller than 2 degrees
|
|
7
7
|
/**
|
|
@@ -40,7 +40,7 @@ function getValidAngles(angleIncrement_, ppos) {
|
|
|
40
40
|
const angles = [0];
|
|
41
41
|
if (ppos.t === 1) {
|
|
42
42
|
const { curve } = ppos;
|
|
43
|
-
const corner = getCorner(curve.ps, curve.next.ps);
|
|
43
|
+
const corner = getCorner$(curve.ps, curve.next.ps);
|
|
44
44
|
if (corner.isQuiteDull) {
|
|
45
45
|
const tangentI = rotateNeg90Degrees(corner.tangents[0]);
|
|
46
46
|
const tangentO = rotateNeg90Degrees(corner.tangents[1]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-and-add-2-prongs.js","sourceRoot":"","sources":["../../src/find-2-prong/find-and-add-2-prongs.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"find-and-add-2-prongs.js","sourceRoot":"","sources":["../../src/find-2-prong/find-and-add-2-prongs.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;AAC3B,8EAA8E;AAG9E;;;;;;;;GAQG;AACH,SAAS,iBAAiB,CAClB,IAAa,EACb,cAAsB,EACtB,UAA6B,EAC7B,SAAkB;IAEtB,IAAI,OAAO,CAAC;IAEZ,MAAM,WAAW,GA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
-
* @param nnorm
|
|
10
9
|
* @param yPos
|
|
11
10
|
* @param for1Prong defaults to `false`;
|
|
12
11
|
* @param angle angle from normal
|
|
@@ -14,5 +13,5 @@ import type { AntipodalPoint } from './antipodal-point.js';
|
|
|
14
13
|
*
|
|
15
14
|
* @internal
|
|
16
15
|
*/
|
|
17
|
-
declare function getAntipodalPoints(maxCoordPowerOf2: number,
|
|
16
|
+
declare function getAntipodalPoints(maxCoordPowerOf2: number, nnormDd: number[][], yPos: PrePointOnShape, for1Prong: boolean, angle: number, curvePieces: CurvePiece[]): AntipodalPoint[];
|
|
18
17
|
export { getAntipodalPoints };
|
|
@@ -4,7 +4,6 @@ import { getClosestPoint } from './get-closest-points.js';
|
|
|
4
4
|
* bezier pieces, including the beziers actually checked after culling.
|
|
5
5
|
*
|
|
6
6
|
* @param maxCoordPowerOf2
|
|
7
|
-
* @param nnorm
|
|
8
7
|
* @param yPos
|
|
9
8
|
* @param for1Prong defaults to `false`;
|
|
10
9
|
* @param angle angle from normal
|
|
@@ -12,11 +11,11 @@ import { getClosestPoint } from './get-closest-points.js';
|
|
|
12
11
|
*
|
|
13
12
|
* @internal
|
|
14
13
|
*/
|
|
15
|
-
function getAntipodalPoints(maxCoordPowerOf2,
|
|
14
|
+
function getAntipodalPoints(maxCoordPowerOf2, nnormDd, yPos, for1Prong, angle, curvePieces) {
|
|
16
15
|
const pInfoss = [];
|
|
17
16
|
for (let i = 0; i < curvePieces.length; i++) {
|
|
18
17
|
const curvePiece = curvePieces[i];
|
|
19
|
-
const pInfos = getClosestPoint(maxCoordPowerOf2,
|
|
18
|
+
const pInfos = getClosestPoint(maxCoordPowerOf2, nnormDd, yPos, for1Prong, angle, curvePiece);
|
|
20
19
|
pInfoss.push(...pInfos);
|
|
21
20
|
}
|
|
22
21
|
/** the minimum max value */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-antipodal-points.js","sourceRoot":"","sources":["../../../src/find-2-prong/get-medial/get-antipodal-points.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D
|
|
1
|
+
{"version":3,"file":"get-antipodal-points.js","sourceRoot":"","sources":["../../../src/find-2-prong/get-medial/get-antipodal-points.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D;;;;;;;;;;;GAWG;AACH,SAAS,kBAAkB,CACnB,gBAAwB,EACxB,OAAmB,EACnB,IAAqB,EACrB,SAAkB,EAClB,KAAa,EACb,WAAyB;IAE7B,MAAM,OAAO,GAAqB,EAAE,CAAC;IACrC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,UAAU,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;QAElC,MAAM,MAAM,GAAG,eAAe,CAC1B,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EACjD,UAAU,CACb,CAAC;QAEF,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;IAC5B,CAAC;IAGD,4BAA4B;IAC5B,IAAI,MAAM,GAAG,QAAQ,CAAC;IACtB,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,GAAG,CAAC,IAAE,CAAC,EAAE,CAAC,CAAC;QACxC,IAAI,KAAK,GAAG,MAAM,EAAE,CAAC;YACjB,MAAM,GAAG,KAAK,CAAC;QACnB,CAAC;IACL,CAAC;IAED,MAAM,eAAe,GAAqB,EAAE,CAAC;IAC7C,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACxB,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,GAAC,CAAC,CAAC,GAAG,CAAC,IAAE,CAAC,EAAE,CAAC,CAAC;QAC9B,IAAI,CAAC,IAAI,MAAM,EAAE,CAAC;YACd,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;IACL,CAAC;IAED,OAAO,eAAe,CAAC;AAC3B,CAAC;AAGD,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -3,7 +3,6 @@ import type { PrePointOnShape } from "../../point-on-shape/point-on-shape.js";
|
|
|
3
3
|
import type { AntipodalPoint } from './antipodal-point.js';
|
|
4
4
|
/**
|
|
5
5
|
* @param maxCoordPowerOf2
|
|
6
|
-
* @param nnorm
|
|
7
6
|
* @param yPos The point on the shape
|
|
8
7
|
* @param for1Prong defaults to `false`;
|
|
9
8
|
* @param angle defaults to `0`;
|
|
@@ -11,11 +10,5 @@ import type { AntipodalPoint } from './antipodal-point.js';
|
|
|
11
10
|
*
|
|
12
11
|
* @internal
|
|
13
12
|
*/
|
|
14
|
-
declare function getClosestPoint(maxCoordPowerOf2: number,
|
|
13
|
+
declare function getClosestPoint(maxCoordPowerOf2: number, nnormDd: number[][], yPos: PrePointOnShape, for1Prong: boolean, angle: number, curvePiece: CurvePiece): AntipodalPoint[];
|
|
15
14
|
export { getClosestPoint };
|
|
16
|
-
/**
|
|
17
|
-
* Recovers a numerically stable ray parameter `t` from linear equations
|
|
18
|
-
* `A*t + B = 0` and (optionally) `C*t + D = 0` evaluated at a fixed `s`.
|
|
19
|
-
*
|
|
20
|
-
* If `C,D` are unavailable, this falls back to `-B/A`.
|
|
21
|
-
*/
|
|
@@ -6,11 +6,10 @@ import { ddGetMedialPointCoeffs } from '../../get-medial-points/double-double/dd
|
|
|
6
6
|
import { ddGetMedialPointCoeffsBez2_SameCurve } from '../../get-medial-points/double-double/dd-get-medial-point-coeffs-bez2-same-curve.js';
|
|
7
7
|
import { ddGetMedialPointCoeffsBez3_SameCurve } from '../../get-medial-points/double-double/dd-get-medial-point-coeffs-bez3-same-curve.js';
|
|
8
8
|
import { ddGetMedialPointCoeffsBez0 } from '../../get-medial-points/double-double/dd-get-medial-point-coeffs-bez0.js';
|
|
9
|
-
const { sqrt, abs
|
|
9
|
+
const { sqrt, abs } = Math;
|
|
10
10
|
const qmd = ddMultDouble1;
|
|
11
11
|
/**
|
|
12
12
|
* @param maxCoordPowerOf2
|
|
13
|
-
* @param nnorm
|
|
14
13
|
* @param yPos The point on the shape
|
|
15
14
|
* @param for1Prong defaults to `false`;
|
|
16
15
|
* @param angle defaults to `0`;
|
|
@@ -18,7 +17,7 @@ const qmd = ddMultDouble1;
|
|
|
18
17
|
*
|
|
19
18
|
* @internal
|
|
20
19
|
*/
|
|
21
|
-
function getClosestPoint(maxCoordPowerOf2,
|
|
20
|
+
function getClosestPoint(maxCoordPowerOf2, nnormDd, yPos, for1Prong, angle, curvePiece) {
|
|
22
21
|
const { curve, ts: [tS, tE] } = curvePiece;
|
|
23
22
|
const { ps } = curve;
|
|
24
23
|
const { curve: touchedCurve, t, p: y, pDd: yDd } = yPos;
|
|
@@ -64,8 +63,7 @@ function getClosestPoint(maxCoordPowerOf2, nnorm, nnormDd, yPos, for1Prong, angl
|
|
|
64
63
|
// const DS = Horner(D, s);
|
|
65
64
|
const _AS = abs(AS);
|
|
66
65
|
// const _CS = abs(CS);
|
|
67
|
-
|
|
68
|
-
if (max(_AS) < 2 ** -40) {
|
|
66
|
+
if (_AS < 2 ** -40) {
|
|
69
67
|
continue;
|
|
70
68
|
}
|
|
71
69
|
// const w = _AS > _CS
|
|
@@ -106,7 +104,7 @@ function getClosestPoint(maxCoordPowerOf2, nnorm, nnormDd, yPos, for1Prong, angl
|
|
|
106
104
|
}
|
|
107
105
|
//------------------------------------------
|
|
108
106
|
const pLast = ps[ps.length - 1];
|
|
109
|
-
|
|
107
|
+
const dontPush1 = ((t === 0 && curve === touchedCurve.prev) ||
|
|
110
108
|
(t === 1 && curve === touchedCurve));
|
|
111
109
|
//--------------------------------------
|
|
112
110
|
// Also check curve start control point
|
|
@@ -138,7 +136,6 @@ function getClosestPoint(maxCoordPowerOf2, nnorm, nnormDd, yPos, for1Prong, angl
|
|
|
138
136
|
else if (tE === 1) {
|
|
139
137
|
if (!dontPush1 && !endPushed) {
|
|
140
138
|
PS.push({ P: pLast, t: 1 });
|
|
141
|
-
dontPush1 = true;
|
|
142
139
|
}
|
|
143
140
|
}
|
|
144
141
|
else {
|
|
@@ -177,37 +174,4 @@ function getClosestPoint(maxCoordPowerOf2, nnorm, nnormDd, yPos, for1Prong, angl
|
|
|
177
174
|
return infos;
|
|
178
175
|
}
|
|
179
176
|
export { getClosestPoint };
|
|
180
|
-
/**
|
|
181
|
-
* Recovers a numerically stable ray parameter `t` from linear equations
|
|
182
|
-
* `A*t + B = 0` and (optionally) `C*t + D = 0` evaluated at a fixed `s`.
|
|
183
|
-
*
|
|
184
|
-
* If `C,D` are unavailable, this falls back to `-B/A`.
|
|
185
|
-
*/
|
|
186
|
-
// function chooseStableT(
|
|
187
|
-
// A: number,
|
|
188
|
-
// B: number,
|
|
189
|
-
// C: number,
|
|
190
|
-
// D: number) {
|
|
191
|
-
// const epsScale = max(1, abs(A), abs(B), abs(C), abs(D));
|
|
192
|
-
// const eps = Number.EPSILON * epsScale;
|
|
193
|
-
// const denomAB = abs(A);
|
|
194
|
-
// const hasAB = denomAB > eps;
|
|
195
|
-
// const denomCD = abs(C);
|
|
196
|
-
// const hasCD = denomCD > eps;
|
|
197
|
-
// if (!hasAB && !hasCD) {
|
|
198
|
-
// return undefined;
|
|
199
|
-
// }
|
|
200
|
-
// if (hasAB && !hasCD) {
|
|
201
|
-
// return -B / A;
|
|
202
|
-
// }
|
|
203
|
-
// if (!hasAB && hasCD) {
|
|
204
|
-
// return -D / C;
|
|
205
|
-
// }
|
|
206
|
-
// const tAB = -B / A;
|
|
207
|
-
// const tCD = -D / C;
|
|
208
|
-
// // Score each candidate by how well it satisfies the *other* equation.
|
|
209
|
-
// const scoreAB = abs(C*tAB + D) / (abs(C) + abs(D) + eps);
|
|
210
|
-
// const scoreCD = abs(A*tCD + B) / (abs(A) + abs(B) + eps);
|
|
211
|
-
// return scoreAB <= scoreCD ? tAB : tCD;
|
|
212
|
-
// }
|
|
213
177
|
//# sourceMappingURL=get-closest-points.js.map
|