flo-mat 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +69 -0
- package/README.md +9 -27
- package/browser/index.js +29604 -7008
- package/browser/index.min.js +1 -2
- package/node/circle.d.ts +20 -20
- package/node/circle.js +31 -31
- package/node/circle.js.map +1 -1
- package/node/compare-curvatures-at-interface.d.ts +19 -19
- package/node/compare-curvatures-at-interface.js +124 -124
- package/node/compare-curvatures-at-interface.js.map +1 -1
- package/node/contact-point.d.ts +26 -26
- package/node/contact-point.js +25 -25
- package/node/cp-node/clone.d.ts +8 -8
- package/node/cp-node/clone.js +31 -31
- package/node/cp-node/clone.js.map +1 -1
- package/node/cp-node/remove.d.ts +9 -9
- package/node/cp-node/remove.js +19 -19
- package/node/cp-node/remove.js.map +1 -1
- package/node/cp-node.d.ts +202 -202
- package/node/cp-node.js +320 -320
- package/node/cp-node.js.map +1 -1
- package/node/curve.d.ts +46 -46
- package/node/curve.js +88 -88
- package/node/curve.js.map +1 -1
- package/node/debug/cp-node-for-debugging.d.ts +11 -11
- package/node/debug/cp-node-for-debugging.js +1 -1
- package/node/debug/debug-elem-types.d.ts +32 -32
- package/node/debug/debug-elem-types.js +1 -1
- package/node/debug/debug.d.ts +50 -50
- package/node/debug/debug.js +75 -75
- package/node/debug/functions/draw-elem/bounding-hull.d.ts +3 -3
- package/node/debug/functions/draw-elem/bounding-hull.js +7 -7
- package/node/debug/functions/draw-elem/bounding-hull.js.map +1 -1
- package/node/debug/functions/draw-elem/branch.d.ts +4 -4
- package/node/debug/functions/draw-elem/branch.js +22 -22
- package/node/debug/functions/draw-elem/branch.js.map +1 -1
- package/node/debug/functions/draw-elem/culls.d.ts +4 -4
- package/node/debug/functions/draw-elem/culls.js +21 -21
- package/node/debug/functions/draw-elem/culls.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.d.ts +3 -3
- package/node/debug/functions/draw-elem/draw-circle-percent.js +12 -12
- package/node/debug/functions/draw-elem/draw-circle-percent.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-elem.d.ts +8 -8
- package/node/debug/functions/draw-elem/draw-elem.js +45 -45
- package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
- package/node/debug/functions/draw-elem/dull-corner.d.ts +4 -4
- package/node/debug/functions/draw-elem/dull-corner.js +10 -10
- package/node/debug/functions/draw-elem/dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/leaves.d.ts +4 -4
- package/node/debug/functions/draw-elem/leaves.js +12 -12
- package/node/debug/functions/draw-elem/leaves.js.map +1 -1
- package/node/debug/functions/draw-elem/loop.d.ts +4 -4
- package/node/debug/functions/draw-elem/loop.js +11 -11
- package/node/debug/functions/draw-elem/loops.d.ts +4 -4
- package/node/debug/functions/draw-elem/loops.js +6 -6
- package/node/debug/functions/draw-elem/loose-bounding-box.d.ts +3 -3
- package/node/debug/functions/draw-elem/loose-bounding-box.js +9 -9
- package/node/debug/functions/draw-elem/loose-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/mat.d.ts +4 -4
- package/node/debug/functions/draw-elem/mat.js +30 -30
- package/node/debug/functions/draw-elem/mat.js.map +1 -1
- package/node/debug/functions/draw-elem/max-vertex.d.ts +4 -4
- package/node/debug/functions/draw-elem/max-vertex.js +8 -8
- package/node/debug/functions/draw-elem/max-vertex.js.map +1 -1
- package/node/debug/functions/draw-elem/min-y.d.ts +4 -4
- package/node/debug/functions/draw-elem/min-y.js +13 -13
- package/node/debug/functions/draw-elem/min-y.js.map +1 -1
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.d.ts +4 -4
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js +12 -12
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/one-prong.d.ts +4 -4
- package/node/debug/functions/draw-elem/one-prong.js +16 -16
- package/node/debug/functions/draw-elem/one-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/sharp-corner.d.ts +4 -4
- package/node/debug/functions/draw-elem/sharp-corner.js +9 -9
- package/node/debug/functions/draw-elem/sharp-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/three-prong.d.ts +4 -4
- package/node/debug/functions/draw-elem/three-prong.js +16 -16
- package/node/debug/functions/draw-elem/three-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/tight-bounding-box.d.ts +3 -3
- package/node/debug/functions/draw-elem/tight-bounding-box.js +7 -7
- package/node/debug/functions/draw-elem/tight-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/two-prong.d.ts +4 -4
- package/node/debug/functions/draw-elem/two-prong.js +36 -36
- package/node/debug/functions/draw-elem/two-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/vertex.d.ts +4 -4
- package/node/debug/functions/draw-elem/vertex.js +27 -27
- package/node/debug/functions/draw-elem/vertex.js.map +1 -1
- package/node/debug/functions/general.d.ts +48 -48
- package/node/debug/functions/general.js +52 -52
- package/node/debug/functions/general.js.map +1 -1
- package/node/debug/functions/three-prong.d.ts +11 -11
- package/node/debug/functions/three-prong.js +184 -184
- package/node/debug/functions/three-prong.js.map +1 -1
- package/node/debug/functions/two-prong.d.ts +13 -13
- package/node/debug/functions/two-prong.js +117 -117
- package/node/debug/functions/two-prong.js.map +1 -1
- package/node/debug/three-prong-for-debugging.d.ts +31 -31
- package/node/debug/three-prong-for-debugging.js +20 -20
- package/node/debug/two-prong-for-debugging.d.ts +26 -26
- package/node/debug/two-prong-for-debugging.js +1 -1
- package/node/find-mats.d.ts +26 -26
- package/node/find-mats.js +122 -125
- package/node/find-mats.js.map +1 -1
- package/node/get-boundary-bezier-parts-to-next.d.ts +9 -9
- package/node/get-boundary-bezier-parts-to-next.js +42 -42
- package/node/get-boundary-bezier-parts-to-next.js.map +1 -1
- package/node/get-boundary-beziers-to-next.d.ts +8 -8
- package/node/get-boundary-beziers-to-next.js +44 -44
- package/node/get-boundary-beziers-to-next.js.map +1 -1
- package/node/get-bounding-box-.d.ts +2 -2
- package/node/get-bounding-box-.js +4 -4
- package/node/get-branches.d.ts +12 -12
- package/node/get-branches.js +68 -68
- package/node/get-branches.js.map +1 -1
- package/node/get-curve/get-curve-between.d.ts +9 -9
- package/node/get-curve/get-curve-between.js +56 -56
- package/node/get-curve/get-curve-between.js.map +1 -1
- package/node/get-curve/get-edge-direction.d.ts +9 -9
- package/node/get-curve/get-edge-direction.js +53 -53
- package/node/get-curve/get-edge-direction.js.map +1 -1
- package/node/get-curve-to-next.d.ts +9 -9
- package/node/get-curve-to-next.js +11 -11
- package/node/get-interface-ccw.d.ts +24 -24
- package/node/get-interface-ccw.js +97 -97
- package/node/get-interface-ccw.js.map +1 -1
- package/node/index.d.ts +36 -36
- package/node/index.js +32 -32
- package/node/loop/get-max-coordinate.d.ts +10 -10
- package/node/loop/get-max-coordinate.js +43 -43
- package/node/loop/get-max-coordinate.js.map +1 -1
- package/node/loop.d.ts +16 -16
- package/node/loop.js +34 -34
- package/node/loop.js.map +1 -1
- package/node/mat/add-to-cp-graph.d.ts +16 -16
- package/node/mat/add-to-cp-graph.js +30 -30
- package/node/mat/add-to-cp-graph.js.map +1 -1
- package/node/mat/bezier-piece.d.ts +12 -12
- package/node/mat/bezier-piece.js +1 -1
- package/node/mat/closest-boundary-point/closest-points-on-curve.d.ts +14 -14
- package/node/mat/closest-boundary-point/closest-points-on-curve.js +72 -73
- package/node/mat/closest-boundary-point/closest-points-on-curve.js.map +1 -1
- package/node/mat/closest-boundary-point/cull-bezier-pieces.d.ts +9 -9
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js +19 -19
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js.map +1 -1
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.d.ts +11 -11
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js +24 -24
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -1
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.d.ts +11 -11
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js +26 -26
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -1
- package/node/mat/closest-boundary-point/get-best-distance-squared.d.ts +8 -8
- package/node/mat/closest-boundary-point/get-best-distance-squared.js +24 -24
- package/node/mat/closest-boundary-point/get-best-distance-squared.js.map +1 -1
- package/node/mat/closest-boundary-point/get-close-boundary-points.d.ts +17 -17
- package/node/mat/closest-boundary-point/get-close-boundary-points.js +80 -80
- package/node/mat/closest-boundary-point/get-close-boundary-points.js.map +1 -1
- package/node/mat/closest-boundary-point/get-closest-boundary-point.d.ts +18 -18
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js +40 -40
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js.map +1 -1
- package/node/mat/corner.d.ts +37 -37
- package/node/mat/corner.js +1 -1
- package/node/mat/create-new-cp-tree.d.ts +9 -9
- package/node/mat/create-new-cp-tree.js +23 -23
- package/node/mat/create-new-cp-tree.js.map +1 -1
- package/node/mat/elem-type-two-prong.d.ts +3 -3
- package/node/mat/elem-type-two-prong.js +1 -1
- package/node/mat/find-mat/add-1-prong.d.ts +12 -12
- package/node/mat/find-mat/add-1-prong.js +42 -42
- package/node/mat/find-mat/add-1-prong.js.map +1 -1
- package/node/mat/find-mat/add-2-prong.d.ts +21 -21
- package/node/mat/find-mat/add-2-prong.js +192 -192
- package/node/mat/find-mat/add-2-prong.js.map +1 -1
- package/node/mat/find-mat/add-3-prong.d.ts +19 -19
- package/node/mat/find-mat/add-3-prong.js +54 -54
- package/node/mat/find-mat/add-3-prong.js.map +1 -1
- package/node/mat/find-mat/add-debug-info.d.ts +9 -9
- package/node/mat/find-mat/add-debug-info.js +67 -69
- package/node/mat/find-mat/add-debug-info.js.map +1 -1
- package/node/mat/find-mat/create-get-interesting-points-on-loop.d.ts +11 -11
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js +51 -51
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js.map +1 -1
- package/node/mat/find-mat/create-initial-cp-graph.d.ts +12 -12
- package/node/mat/find-mat/create-initial-cp-graph.js +40 -40
- package/node/mat/find-mat/create-initial-cp-graph.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/add-debug-info.d.ts +8 -8
- package/node/mat/find-mat/find-2-prong/add-debug-info.js +21 -21
- package/node/mat/find-mat/find-2-prong/add-debug-info.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.d.ts +11 -11
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js +29 -29
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/find-2-prong.d.ts +37 -37
- package/node/mat/find-mat/find-2-prong/find-2-prong.js +232 -232
- package/node/mat/find-mat/find-2-prong/find-2-prong.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.d.ts +9 -9
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js +39 -39
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.d.ts +11 -11
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js +37 -37
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/x-for-debugging.d.ts +9 -9
- package/node/mat/find-mat/find-2-prong/x-for-debugging.js +1 -1
- package/node/mat/find-mat/find-3-prong/calc-better-x.d.ts +19 -19
- package/node/mat/find-mat/find-3-prong/calc-better-x.js +36 -36
- package/node/mat/find-mat/find-3-prong/calc-better-x.js.map +1 -1
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.d.ts +13 -13
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js +25 -25
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js.map +1 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.d.ts +22 -22
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js +159 -159
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js.map +1 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong.d.ts +16 -16
- package/node/mat/find-mat/find-3-prong/find-3-prong.js +76 -76
- package/node/mat/find-mat/find-3-prong/find-3-prong.js.map +1 -1
- package/node/mat/find-mat/find-3-prong/get-closest-points.d.ts +9 -9
- package/node/mat/find-mat/find-3-prong/get-closest-points.js +16 -16
- package/node/mat/find-mat/find-3-prong/get-closest-points.js.map +1 -1
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.d.ts +15 -15
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js +20 -20
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js.map +1 -1
- package/node/mat/find-mat/find-and-add-2-prongs.d.ts +16 -16
- package/node/mat/find-mat/find-and-add-2-prongs.js +73 -74
- package/node/mat/find-mat/find-and-add-2-prongs.js.map +1 -1
- package/node/mat/find-mat/find-and-add-3-prongs.d.ts +13 -13
- package/node/mat/find-mat/find-and-add-3-prongs.js +146 -147
- package/node/mat/find-mat/find-and-add-3-prongs.js.map +1 -1
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.d.ts +14 -14
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js +33 -33
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js.map +1 -1
- package/node/mat/find-mat/get-potential-2-prongs.d.ts +4 -4
- package/node/mat/find-mat/get-potential-2-prongs.js +16 -16
- package/node/mat/find-mat/get-potential-2-prongs.js.map +1 -1
- package/node/mat/find-mat/get-sharp-corners.d.ts +4 -4
- package/node/mat/find-mat/get-sharp-corners.js +17 -17
- package/node/mat/find-mat/get-sharp-corners.js.map +1 -1
- package/node/mat/geometry/get-closest-square-distance-to-rect.d.ts +5 -5
- package/node/mat/geometry/get-closest-square-distance-to-rect.js +49 -49
- package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.d.ts +5 -5
- package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js +15 -15
- package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -1
- package/node/mat/get-boundary-piece-beziers.d.ts +11 -11
- package/node/mat/get-boundary-piece-beziers.js +58 -58
- package/node/mat/get-boundary-piece-beziers.js.map +1 -1
- package/node/mat/get-contact-circles-at-interface.d.ts +8 -8
- package/node/mat/get-contact-circles-at-interface.js +20 -20
- package/node/mat/get-contact-circles-at-interface.js.map +1 -1
- package/node/mat/get-largest-vertex.d.ts +4 -4
- package/node/mat/get-largest-vertex.js +9 -9
- package/node/mat/get-leaves.d.ts +4 -4
- package/node/mat/get-leaves.js +12 -12
- package/node/mat/get-leaves.js.map +1 -1
- package/node/mat/get-neighboring-cps.d.ts +14 -14
- package/node/mat/get-neighboring-cps.js +30 -30
- package/node/mat/get-neighboring-cps.js.map +1 -1
- package/node/mat/get-two-prong-type.d.ts +5 -5
- package/node/mat/get-two-prong-type.js +8 -8
- package/node/mat/is-another-cp-closeby.d.ts +20 -20
- package/node/mat/is-another-cp-closeby.js +55 -55
- package/node/mat/is-another-cp-closeby.js.map +1 -1
- package/node/mat/simplify-mat-map-only.d.ts +23 -23
- package/node/mat/simplify-mat-map-only.js +80 -80
- package/node/mat/simplify-mat-map-only.js.map +1 -1
- package/node/mat/to-scale-axis/add-debug-info.d.ts +7 -7
- package/node/mat/to-scale-axis/add-debug-info.js +13 -13
- package/node/mat/to-scale-axis/add-debug-info.js.map +1 -1
- package/node/mat/to-scale-axis/cull-non-cycles.d.ts +9 -9
- package/node/mat/to-scale-axis/cull-non-cycles.js +51 -51
- package/node/mat/to-scale-axis/cull-non-cycles.js.map +1 -1
- package/node/mat/to-scale-axis/cull.d.ts +12 -12
- package/node/mat/to-scale-axis/cull.js +132 -132
- package/node/mat/to-scale-axis/cull.js.map +1 -1
- package/node/mat/trim-mat.d.ts +8 -8
- package/node/mat/trim-mat.js +16 -16
- package/node/mat/trim-mat.js.map +1 -1
- package/node/mat.d.ts +22 -22
- package/node/mat.js +1 -1
- package/node/point-on-shape.d.ts +73 -73
- package/node/point-on-shape.js +167 -167
- package/node/point-on-shape.js.map +1 -1
- package/node/simplify-mat.d.ts +16 -16
- package/node/simplify-mat.js +71 -71
- package/node/simplify-mat.js.map +1 -1
- package/node/svg/get-loop-bounds.d.ts +12 -12
- package/node/svg/get-loop-bounds.js +80 -80
- package/node/svg/get-loop-bounds.js.map +1 -1
- package/node/svg/get-min-y-pos.d.ts +8 -8
- package/node/svg/get-min-y-pos.js +9 -9
- package/node/svg/get-shape-bounds.d.ts +9 -9
- package/node/svg/get-shape-bounds.js +35 -35
- package/node/svg/get-shape-bounds.js.map +1 -1
- package/node/sweep-line/sweep-line.d.ts +18 -18
- package/node/sweep-line/sweep-line.js +72 -72
- package/node/sweep-line/sweep-line.js.map +1 -1
- package/node/to-scale-axis.d.ts +16 -16
- package/node/to-scale-axis.js +74 -73
- package/node/to-scale-axis.js.map +1 -1
- package/node/traverse-edges.d.ts +10 -10
- package/node/traverse-edges.js +21 -21
- package/node/traverse-edges.js.map +1 -1
- package/node/traverse-vertices.d.ts +12 -12
- package/node/traverse-vertices.js +27 -27
- package/node/traverse-vertices.js.map +1 -1
- package/package.json +29 -24
- package/src/circle.ts +3 -3
- package/src/compare-curvatures-at-interface.ts +36 -36
- package/src/cp-node/clone.ts +6 -6
- package/src/cp-node/remove.ts +4 -4
- package/src/cp-node.ts +20 -20
- package/src/curve.ts +19 -19
- package/src/debug/functions/draw-elem/bounding-hull.ts +2 -2
- package/src/debug/functions/draw-elem/branch.ts +4 -4
- package/src/debug/functions/draw-elem/culls.ts +4 -4
- package/src/debug/functions/draw-elem/draw-circle-percent.ts +2 -2
- package/src/debug/functions/draw-elem/draw-elem.ts +1 -1
- package/src/debug/functions/draw-elem/dull-corner.ts +3 -3
- package/src/debug/functions/draw-elem/leaves.ts +4 -4
- package/src/debug/functions/draw-elem/loose-bounding-box.ts +2 -2
- package/src/debug/functions/draw-elem/mat.ts +4 -4
- package/src/debug/functions/draw-elem/max-vertex.ts +2 -2
- package/src/debug/functions/draw-elem/min-y.ts +3 -3
- package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +4 -4
- package/src/debug/functions/draw-elem/one-prong.ts +4 -4
- package/src/debug/functions/draw-elem/sharp-corner.ts +2 -2
- package/src/debug/functions/draw-elem/three-prong.ts +7 -7
- package/src/debug/functions/draw-elem/tight-bounding-box.ts +1 -1
- package/src/debug/functions/draw-elem/two-prong.ts +1 -1
- package/src/debug/functions/draw-elem/vertex.ts +20 -14
- package/src/debug/functions/general.ts +3 -3
- package/src/debug/functions/three-prong.ts +37 -37
- package/src/debug/functions/two-prong.ts +15 -15
- package/src/find-mats.ts +19 -19
- package/src/get-boundary-bezier-parts-to-next.ts +8 -8
- package/src/get-boundary-beziers-to-next.ts +8 -8
- package/src/get-branches.ts +7 -7
- package/src/get-curve/get-curve-between.ts +21 -21
- package/src/get-curve/get-edge-direction.ts +13 -14
- package/src/get-interface-ccw.ts +12 -12
- package/src/loop/get-max-coordinate.ts +7 -7
- package/src/loop.ts +4 -4
- package/src/mat/add-to-cp-graph.ts +8 -8
- package/src/mat/closest-boundary-point/closest-points-on-curve.ts +5 -6
- package/src/mat/closest-boundary-point/cull-bezier-pieces.ts +1 -1
- package/src/mat/closest-boundary-point/cull-by-loose-bounding-box.ts +5 -5
- package/src/mat/closest-boundary-point/cull-by-tight-boundary-box.ts +5 -5
- package/src/mat/closest-boundary-point/get-best-distance-squared.ts +5 -5
- package/src/mat/closest-boundary-point/get-close-boundary-points.ts +15 -15
- package/src/mat/closest-boundary-point/get-closest-boundary-point.ts +4 -4
- package/src/mat/cmp-cp-on-delta.ts +5 -5
- package/src/mat/create-new-cp-tree.ts +3 -3
- package/src/mat/find-mat/add-1-prong.ts +5 -5
- package/src/mat/find-mat/add-2-prong.ts +42 -42
- package/src/mat/find-mat/add-3-prong.ts +1 -1
- package/src/mat/find-mat/add-debug-info.ts +18 -20
- package/src/mat/find-mat/create-get-interesting-points-on-loop.ts +4 -4
- package/src/mat/find-mat/create-initial-cp-graph.ts +11 -11
- package/src/mat/find-mat/find-2-prong/add-debug-info.ts +4 -4
- package/src/mat/find-mat/find-2-prong/cull-bezier-pieces.ts +5 -5
- package/src/mat/find-mat/find-2-prong/find-2-prong.ts +27 -27
- package/src/mat/find-mat/find-2-prong/find-equidistant-point-on-line.ts +7 -7
- package/src/mat/find-mat/find-2-prong/get-initial-bezier-pieces.ts +4 -4
- package/src/mat/find-mat/find-3-prong/calc-better-x.ts +4 -4
- package/src/mat/find-mat/find-3-prong/calc-initial-3-prong-center.ts +3 -3
- package/src/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.ts +37 -37
- package/src/mat/find-mat/find-3-prong/find-3-prong.ts +16 -16
- package/src/mat/find-mat/find-3-prong/get-closest-points.ts +1 -1
- package/src/mat/find-mat/find-and-add-2-prongs-on-all-paths.ts +2 -2
- package/src/mat/find-mat/find-and-add-2-prongs.ts +14 -16
- package/src/mat/find-mat/find-and-add-3-prongs.ts +19 -19
- package/src/mat/find-mat/find-and-add-hole-closing-2-prongs.ts +6 -6
- package/src/mat/find-mat/get-potential-2-prongs.ts +4 -4
- package/src/mat/find-mat/get-sharp-corners.ts +4 -4
- package/src/mat/find-mat/get-total-abs-curvature.ts +1 -1
- package/src/mat/geometry/get-closest-squared-distance-to-rotated-rect.ts +3 -3
- package/src/mat/get-boundary-piece-beziers.ts +5 -5
- package/src/mat/get-contact-circles-at-interface.ts +1 -1
- package/src/mat/get-edges-as-array.ts +2 -2
- package/src/mat/get-leaves.ts +2 -2
- package/src/mat/get-neighboring-cps.ts +1 -1
- package/src/mat/is-another-cp-closeby.ts +9 -9
- package/src/mat/simplify-mat-map-only.ts +15 -15
- package/src/mat/to-scale-axis/add-debug-info.ts +6 -3
- package/src/mat/to-scale-axis/add-to-tree.ts +10 -10
- package/src/mat/to-scale-axis/calc-groups.ts +19 -19
- package/src/mat/to-scale-axis/create-spacial-tree.ts +4 -4
- package/src/mat/to-scale-axis/cull-non-cycles.ts +5 -5
- package/src/mat/to-scale-axis/cull.ts +5 -5
- package/src/mat/to-scale-axis/get-engulfed-vertices.ts +18 -18
- package/src/mat/trim-mat.ts +1 -1
- package/src/point-on-shape.ts +16 -16
- package/src/simplify-mat.ts +10 -10
- package/src/svg/get-curvature-at-interface.ts +6 -8
- package/src/svg/get-extreme.ts +1 -1
- package/src/svg/get-loop-bounds.ts +13 -13
- package/src/svg/get-shape-bounds.ts +4 -4
- package/src/sweep-line/are-boxes-intersecting.ts +4 -4
- package/src/sweep-line/sweep-line.ts +8 -8
- package/src/to-scale-axis.ts +18 -17
- package/src/traverse-edges.ts +2 -2
- package/src/traverse-vertices.ts +2 -2
- package/tsconfig.json +0 -1
- package/webpack.config.cjs +12 -63
- package/browser/index.min.js.LICENSE.txt +0 -2819
- package/browser/index.module.js +0 -7149
- package/browser/index.module.min.js +0 -2
- package/browser/index.module.min.js.LICENSE.txt +0 -2819
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
/** @hidden */
|
|
2
|
-
const EVENT_LEFT = 0;
|
|
3
|
-
/** @hidden */
|
|
4
|
-
const EVENT_RIGHT = 1;
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
* Generalized sweepline algorithm.
|
|
8
|
-
*
|
|
9
|
-
* Typically used to turn O(n^2) algorithms into roughly O(n logn) algorithms.
|
|
10
|
-
*
|
|
11
|
-
* @param items An array of items that are to be compared. Items should
|
|
12
|
-
* typically be geometric objects in 2d space with well-defined left and right
|
|
13
|
-
* endpoints.
|
|
14
|
-
* @param getLeftmostPoint A function that returns the leftmost point of the
|
|
15
|
-
* geometric object of interest.
|
|
16
|
-
* @param getRightmostPoint A function that returns the rightmost point of the
|
|
17
|
-
* geometric object of interest.
|
|
18
|
-
* @param predicate A predicate that takes two geometric objects and returns
|
|
19
|
-
* true if they are of interest or false otherwise.
|
|
20
|
-
*/
|
|
21
|
-
function sweepLine(items, getLeftmost, getRightmost, predicate) {
|
|
22
|
-
// Initialize event queue to contain all endpoints.
|
|
23
|
-
|
|
24
|
-
for (
|
|
25
|
-
events.push({
|
|
26
|
-
type: EVENT_LEFT,
|
|
27
|
-
item,
|
|
28
|
-
x: getLeftmost(item)
|
|
29
|
-
});
|
|
30
|
-
events.push({
|
|
31
|
-
type: EVENT_RIGHT,
|
|
32
|
-
item,
|
|
33
|
-
x: getRightmost(item)
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
events.sort(compare);
|
|
37
|
-
|
|
38
|
-
/** A list of pairs of items that passed the predicate */
|
|
39
|
-
|
|
40
|
-
for (
|
|
41
|
-
|
|
42
|
-
if (event.type === EVENT_LEFT) {
|
|
43
|
-
for (
|
|
44
|
-
if (predicate(item, activeItem)) {
|
|
45
|
-
pairedItems.push([item, activeItem]);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
activeItems.add(item);
|
|
49
|
-
}
|
|
50
|
-
else if (event.type === EVENT_RIGHT) {
|
|
51
|
-
activeItems.delete(event.item);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return pairedItems;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* @hidden
|
|
58
|
-
* Compare two Events by their x-axis and then by their type. Since it is
|
|
59
|
-
* open boxes that are compared we must let the right endpoint type come
|
|
60
|
-
* before the left.
|
|
61
|
-
* @param a An event
|
|
62
|
-
* @param b Another event
|
|
63
|
-
*/
|
|
64
|
-
function compare(a, b) {
|
|
65
|
-
|
|
66
|
-
if (res !== 0) {
|
|
67
|
-
return res;
|
|
68
|
-
}
|
|
69
|
-
// Alwys put left events before right ones.
|
|
70
|
-
return a.type === EVENT_LEFT ? -1 : +1;
|
|
71
|
-
}
|
|
72
|
-
export { sweepLine };
|
|
1
|
+
/** @hidden */
|
|
2
|
+
const EVENT_LEFT = 0;
|
|
3
|
+
/** @hidden */
|
|
4
|
+
const EVENT_RIGHT = 1;
|
|
5
|
+
/**
|
|
6
|
+
* @hidden
|
|
7
|
+
* Generalized sweepline algorithm.
|
|
8
|
+
*
|
|
9
|
+
* Typically used to turn O(n^2) algorithms into roughly O(n logn) algorithms.
|
|
10
|
+
*
|
|
11
|
+
* @param items An array of items that are to be compared. Items should
|
|
12
|
+
* typically be geometric objects in 2d space with well-defined left and right
|
|
13
|
+
* endpoints.
|
|
14
|
+
* @param getLeftmostPoint A function that returns the leftmost point of the
|
|
15
|
+
* geometric object of interest.
|
|
16
|
+
* @param getRightmostPoint A function that returns the rightmost point of the
|
|
17
|
+
* geometric object of interest.
|
|
18
|
+
* @param predicate A predicate that takes two geometric objects and returns
|
|
19
|
+
* true if they are of interest or false otherwise.
|
|
20
|
+
*/
|
|
21
|
+
function sweepLine(items, getLeftmost, getRightmost, predicate) {
|
|
22
|
+
// Initialize event queue to contain all endpoints.
|
|
23
|
+
const events = [];
|
|
24
|
+
for (const item of items) {
|
|
25
|
+
events.push({
|
|
26
|
+
type: EVENT_LEFT,
|
|
27
|
+
item,
|
|
28
|
+
x: getLeftmost(item)
|
|
29
|
+
});
|
|
30
|
+
events.push({
|
|
31
|
+
type: EVENT_RIGHT,
|
|
32
|
+
item,
|
|
33
|
+
x: getRightmost(item)
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
events.sort(compare);
|
|
37
|
+
const activeItems = new Set();
|
|
38
|
+
/** A list of pairs of items that passed the predicate */
|
|
39
|
+
const pairedItems = [];
|
|
40
|
+
for (const event of events) {
|
|
41
|
+
const { item } = event;
|
|
42
|
+
if (event.type === EVENT_LEFT) {
|
|
43
|
+
for (const activeItem of activeItems.values()) {
|
|
44
|
+
if (predicate(item, activeItem)) {
|
|
45
|
+
pairedItems.push([item, activeItem]);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
activeItems.add(item);
|
|
49
|
+
}
|
|
50
|
+
else if (event.type === EVENT_RIGHT) {
|
|
51
|
+
activeItems.delete(event.item);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return pairedItems;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* @hidden
|
|
58
|
+
* Compare two Events by their x-axis and then by their type. Since it is
|
|
59
|
+
* open boxes that are compared we must let the right endpoint type come
|
|
60
|
+
* before the left.
|
|
61
|
+
* @param a An event
|
|
62
|
+
* @param b Another event
|
|
63
|
+
*/
|
|
64
|
+
function compare(a, b) {
|
|
65
|
+
const res = a.x - b.x;
|
|
66
|
+
if (res !== 0) {
|
|
67
|
+
return res;
|
|
68
|
+
}
|
|
69
|
+
// Alwys put left events before right ones.
|
|
70
|
+
return a.type === EVENT_LEFT ? -1 : +1;
|
|
71
|
+
}
|
|
72
|
+
export { sweepLine };
|
|
73
73
|
//# sourceMappingURL=sweep-line.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sweep-line.js","sourceRoot":"","sources":["../../src/sweep-line/sweep-line.ts"],"names":[],"mappings":"AACA,cAAc;AACd,MAAM,UAAU,GAAI,CAAC,CAAC;AACtB,cAAc;AACd,MAAM,WAAW,GAAG,CAAC,CAAC;AAOtB;;;;;;;;;;;;;;;GAeG;AACH,SAAS,SAAS,CACV,KAAU,EACV,WAAgC,EAChC,YAAiC,EACjC,SAA0C;IAE9C,mDAAmD;IACnD,
|
|
1
|
+
{"version":3,"file":"sweep-line.js","sourceRoot":"","sources":["../../src/sweep-line/sweep-line.ts"],"names":[],"mappings":"AACA,cAAc;AACd,MAAM,UAAU,GAAI,CAAC,CAAC;AACtB,cAAc;AACd,MAAM,WAAW,GAAG,CAAC,CAAC;AAOtB;;;;;;;;;;;;;;;GAeG;AACH,SAAS,SAAS,CACV,KAAU,EACV,WAAgC,EAChC,YAAiC,EACjC,SAA0C;IAE9C,mDAAmD;IACnD,MAAM,MAAM,GAAgB,EAAE,CAAC;IAClC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACzB,MAAM,CAAC,IAAI,CAAC;YACF,IAAI,EAAE,UAAU;YAChB,IAAI;YACJ,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC;SACvB,CAAC,CAAC;QACT,MAAM,CAAC,IAAI,CAAC;YACF,IAAI,EAAE,WAAW;YACjB,IAAI;YACJ,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC;SACxB,CAAC,CAAC;KACT;IAED,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAErB,MAAM,WAAW,GAAG,IAAI,GAAG,EAAK,CAAC;IAE9B,yDAAyD;IAC5D,MAAM,WAAW,GAAY,EAAE,CAAC;IAChC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QACxB,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;QAEvB,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE;YAC9B,KAAK,MAAM,UAAU,IAAI,WAAW,CAAC,MAAM,EAAE,EAAE;gBAC9C,IAAI,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE;oBACpB,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;iBACjD;aACD;YAED,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SACtB;aAAM,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,EAAE;YACtC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC/B;KACJ;IAED,OAAO,WAAW,CAAC;AACpB,CAAC;AAeD;;;;;;;GAOG;AACH,SAAS,OAAO,CAAI,CAAY,EAAE,CAAY;IAC1C,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAEtB,IAAI,GAAG,KAAK,CAAC,EAAE;QAAE,OAAO,GAAG,CAAC;KAAE;IAE9B,2CAA2C;IAC3C,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
package/node/to-scale-axis.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Mat } from './mat.js';
|
|
2
|
-
/** @hidden */
|
|
3
|
-
/**
|
|
4
|
-
* Apply and returns an enhanced version of the Scale Axis Transform (SAT) to
|
|
5
|
-
* the given MAT. The returned SAT is guaranteed to be a subset of the MAT and
|
|
6
|
-
* preserves topology at any scale.
|
|
7
|
-
*
|
|
8
|
-
* Typically the MAT contains too many branches caused by minute details on the
|
|
9
|
-
* boundary of the shape. The SAT is a simplification of the MAT that preserves
|
|
10
|
-
* less detail the higher the applied scale factor. The severity at which noise
|
|
11
|
-
* are removed depends on the local scale of the shape.
|
|
12
|
-
* @param mat The Medial Axis Transform ([[Mat]]) on which to apply the SAT.
|
|
13
|
-
* @param s The scale factor >= 1 (e.g. 1.3)
|
|
14
|
-
*/
|
|
15
|
-
declare function toScaleAxis(mat: Mat, s: number, f?: (s: number) => (r: number) => number): Mat;
|
|
16
|
-
export { toScaleAxis };
|
|
1
|
+
import { Mat } from './mat.js';
|
|
2
|
+
/** @hidden */
|
|
3
|
+
/**
|
|
4
|
+
* Apply and returns an enhanced version of the Scale Axis Transform (SAT) to
|
|
5
|
+
* the given MAT. The returned SAT is guaranteed to be a subset of the MAT and
|
|
6
|
+
* preserves topology at any scale.
|
|
7
|
+
*
|
|
8
|
+
* Typically the MAT contains too many branches caused by minute details on the
|
|
9
|
+
* boundary of the shape. The SAT is a simplification of the MAT that preserves
|
|
10
|
+
* less detail the higher the applied scale factor. The severity at which noise
|
|
11
|
+
* are removed depends on the local scale of the shape.
|
|
12
|
+
* @param mat The Medial Axis Transform ([[Mat]]) on which to apply the SAT.
|
|
13
|
+
* @param s The scale factor >= 1 (e.g. 1.3)
|
|
14
|
+
*/
|
|
15
|
+
declare function toScaleAxis(mat: Mat, s: number, f?: (s: number) => (r: number) => number): Mat;
|
|
16
|
+
export { toScaleAxis };
|
package/node/to-scale-axis.js
CHANGED
|
@@ -1,74 +1,75 @@
|
|
|
1
|
-
import { length } from 'flo-bezier3';
|
|
2
|
-
import { traverseEdges } from './traverse-edges.js';
|
|
3
|
-
import { traverseVertices } from './traverse-vertices.js';
|
|
4
|
-
import { getLargestVertex } from './mat/get-largest-vertex.js';
|
|
5
|
-
import { getLeaves } from './mat/get-leaves.js';
|
|
6
|
-
import { cull } from './mat/to-scale-axis/cull.js';
|
|
7
|
-
import { addDebugInfo } from './mat/to-scale-axis/add-debug-info.js';
|
|
8
|
-
import { clone } from './cp-node/clone.js';
|
|
9
|
-
import { getCurveToNext } from './get-curve-to-next.js';
|
|
10
|
-
function linearScale(s) {
|
|
11
|
-
return function (r) {
|
|
12
|
-
return s * r;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
/** @hidden */
|
|
16
|
-
//let len = length([0,1]);
|
|
17
|
-
/**
|
|
18
|
-
* Apply and returns an enhanced version of the Scale Axis Transform (SAT) to
|
|
19
|
-
* the given MAT. The returned SAT is guaranteed to be a subset of the MAT and
|
|
20
|
-
* preserves topology at any scale.
|
|
21
|
-
*
|
|
22
|
-
* Typically the MAT contains too many branches caused by minute details on the
|
|
23
|
-
* boundary of the shape. The SAT is a simplification of the MAT that preserves
|
|
24
|
-
* less detail the higher the applied scale factor. The severity at which noise
|
|
25
|
-
* are removed depends on the local scale of the shape.
|
|
26
|
-
* @param mat The Medial Axis Transform ([[Mat]]) on which to apply the SAT.
|
|
27
|
-
* @param s The scale factor >= 1 (e.g. 1.3)
|
|
28
|
-
*/
|
|
29
|
-
function toScaleAxis(mat, s, f = linearScale) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
*
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
1
|
+
import { length } from 'flo-bezier3';
|
|
2
|
+
import { traverseEdges } from './traverse-edges.js';
|
|
3
|
+
import { traverseVertices } from './traverse-vertices.js';
|
|
4
|
+
import { getLargestVertex } from './mat/get-largest-vertex.js';
|
|
5
|
+
import { getLeaves } from './mat/get-leaves.js';
|
|
6
|
+
import { cull } from './mat/to-scale-axis/cull.js';
|
|
7
|
+
import { addDebugInfo } from './mat/to-scale-axis/add-debug-info.js';
|
|
8
|
+
import { clone } from './cp-node/clone.js';
|
|
9
|
+
import { getCurveToNext } from './get-curve-to-next.js';
|
|
10
|
+
function linearScale(s) {
|
|
11
|
+
return function (r) {
|
|
12
|
+
return s * r;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** @hidden */
|
|
16
|
+
//let len = length([0,1]);
|
|
17
|
+
/**
|
|
18
|
+
* Apply and returns an enhanced version of the Scale Axis Transform (SAT) to
|
|
19
|
+
* the given MAT. The returned SAT is guaranteed to be a subset of the MAT and
|
|
20
|
+
* preserves topology at any scale.
|
|
21
|
+
*
|
|
22
|
+
* Typically the MAT contains too many branches caused by minute details on the
|
|
23
|
+
* boundary of the shape. The SAT is a simplification of the MAT that preserves
|
|
24
|
+
* less detail the higher the applied scale factor. The severity at which noise
|
|
25
|
+
* are removed depends on the local scale of the shape.
|
|
26
|
+
* @param mat The Medial Axis Transform ([[Mat]]) on which to apply the SAT.
|
|
27
|
+
* @param s The scale factor >= 1 (e.g. 1.3)
|
|
28
|
+
*/
|
|
29
|
+
function toScaleAxis(mat, s, f = linearScale) {
|
|
30
|
+
let timingStart = 0;
|
|
31
|
+
if (typeof _debug_ !== 'undefined') {
|
|
32
|
+
timingStart = performance.now();
|
|
33
|
+
const leaves = getLeaves(mat.cpNode);
|
|
34
|
+
_debug_.generated.elems.leaves.push(leaves);
|
|
35
|
+
}
|
|
36
|
+
/** The largest vertex (as measured by its inscribed disk) */
|
|
37
|
+
const cpNodes = [];
|
|
38
|
+
traverseVertices(clone(mat.cpNode), cpNode => { cpNodes.push(cpNode); });
|
|
39
|
+
const cpNode = getLargestVertex(cpNodes);
|
|
40
|
+
const f_ = f(s);
|
|
41
|
+
if (typeof _debug_ !== 'undefined') {
|
|
42
|
+
_debug_.generated.elems.maxVertex.push(cpNode);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* All vertices that are set to be culled initially. This may change later
|
|
46
|
+
* in order to preserve topology.
|
|
47
|
+
*/
|
|
48
|
+
const culls = new Set();
|
|
49
|
+
const rMap = new Map();
|
|
50
|
+
traverseEdges(cpNode, function (cpNode) {
|
|
51
|
+
/** The occulating radius stored with this vertex. */
|
|
52
|
+
const R = rMap.get(cpNode) || f_(cpNode.cp.circle.radius);
|
|
53
|
+
const cpNode_ = cpNode.next;
|
|
54
|
+
const l = length([0, 1], getCurveToNext(cpNode));
|
|
55
|
+
const r = cpNode_.cp.circle.radius;
|
|
56
|
+
const r_ = f_(r);
|
|
57
|
+
if (R - l > r_) {
|
|
58
|
+
for (const cpNode of cpNode_.getCpNodesOnCircle()) {
|
|
59
|
+
rMap.set(cpNode, R - l); // Update osculating radii
|
|
60
|
+
}
|
|
61
|
+
culls.add(cpNode_.cp.circle);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
cull(culls, cpNode);
|
|
65
|
+
if (typeof _debug_ !== 'undefined') {
|
|
66
|
+
_debug_.generated.elems.culls.push(Array.from(culls));
|
|
67
|
+
}
|
|
68
|
+
// TODO - put line below back - goes into infinite loop
|
|
69
|
+
//const sat: Mat = { cpNode, cpTrees: createNewCpTree(cpNode) };
|
|
70
|
+
const sat = { cpNode, cpTrees: undefined };
|
|
71
|
+
addDebugInfo(sat, timingStart);
|
|
72
|
+
return sat;
|
|
73
|
+
}
|
|
74
|
+
export { toScaleAxis };
|
|
74
75
|
//# sourceMappingURL=to-scale-axis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-scale-axis.js","sourceRoot":"","sources":["../src/to-scale-axis.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAKrC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,SAAS,WAAW,CAAC,CAAS;IAC7B,OAAO,UAAS,CAAS;QACxB,OAAO,CAAC,GAAC,CAAC,CAAC;IACZ,CAAC,CAAA;AACF,CAAC;AAGD,cAAc;AACd,0BAA0B;AAG1B;;;;;;;;;;;GAWG;AACH,SAAS,WAAW,CAClB,GAAQ,EACR,CAAS,EACT,IAA0C,WAAW;IAEtD,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QACnC,
|
|
1
|
+
{"version":3,"file":"to-scale-axis.js","sourceRoot":"","sources":["../src/to-scale-axis.ts"],"names":[],"mappings":"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"}
|
package/node/traverse-edges.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CpNode } from './cp-node.js';
|
|
2
|
-
/**
|
|
3
|
-
* Traverses all edges (depth first) of the given MAT tree starting at the given
|
|
4
|
-
* vertex (represented by a [[CpNode]]).
|
|
5
|
-
* @param cpNode Any [[CpNode]] representing the start vertex.
|
|
6
|
-
* @param f A callback function for each CpNode representing the vertex at the
|
|
7
|
-
* start of an edge.
|
|
8
|
-
*/
|
|
9
|
-
declare function traverseEdges(cpNode: CpNode, f: (cpNode: CpNode) => void): void;
|
|
10
|
-
export { traverseEdges };
|
|
1
|
+
import { CpNode } from './cp-node.js';
|
|
2
|
+
/**
|
|
3
|
+
* Traverses all edges (depth first) of the given MAT tree starting at the given
|
|
4
|
+
* vertex (represented by a [[CpNode]]).
|
|
5
|
+
* @param cpNode Any [[CpNode]] representing the start vertex.
|
|
6
|
+
* @param f A callback function for each CpNode representing the vertex at the
|
|
7
|
+
* start of an edge.
|
|
8
|
+
*/
|
|
9
|
+
declare function traverseEdges(cpNode: CpNode, f: (cpNode: CpNode) => void): void;
|
|
10
|
+
export { traverseEdges };
|
package/node/traverse-edges.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Traverses all edges (depth first) of the given MAT tree starting at the given
|
|
3
|
-
* vertex (represented by a [[CpNode]]).
|
|
4
|
-
* @param cpNode Any [[CpNode]] representing the start vertex.
|
|
5
|
-
* @param f A callback function for each CpNode representing the vertex at the
|
|
6
|
-
* start of an edge.
|
|
7
|
-
*/
|
|
8
|
-
function traverseEdges(cpNode, f) {
|
|
9
|
-
// Since the tree is unrooted we must iterate in all directions from the
|
|
10
|
-
// given vertex.
|
|
11
|
-
|
|
12
|
-
while (cps.length) {
|
|
13
|
-
|
|
14
|
-
f(cp);
|
|
15
|
-
if (cp.isTerminating()) {
|
|
16
|
-
continue;
|
|
17
|
-
}
|
|
18
|
-
cps.push(...cp.getChildren());
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
export { traverseEdges };
|
|
1
|
+
/**
|
|
2
|
+
* Traverses all edges (depth first) of the given MAT tree starting at the given
|
|
3
|
+
* vertex (represented by a [[CpNode]]).
|
|
4
|
+
* @param cpNode Any [[CpNode]] representing the start vertex.
|
|
5
|
+
* @param f A callback function for each CpNode representing the vertex at the
|
|
6
|
+
* start of an edge.
|
|
7
|
+
*/
|
|
8
|
+
function traverseEdges(cpNode, f) {
|
|
9
|
+
// Since the tree is unrooted we must iterate in all directions from the
|
|
10
|
+
// given vertex.
|
|
11
|
+
const cps = cpNode.getCpNodesOnCircle();
|
|
12
|
+
while (cps.length) {
|
|
13
|
+
const cp = cps.pop();
|
|
14
|
+
f(cp);
|
|
15
|
+
if (cp.isTerminating()) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
cps.push(...cp.getChildren());
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export { traverseEdges };
|
|
22
22
|
//# sourceMappingURL=traverse-edges.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse-edges.js","sourceRoot":"","sources":["../src/traverse-edges.ts"],"names":[],"mappings":"AAGA;;;;;;IAMI;AACJ,SAAS,aAAa,CACpB,MAAc,EACd,CAA2B;IAE5B,wEAAwE;IACxE,gBAAgB;IAChB,
|
|
1
|
+
{"version":3,"file":"traverse-edges.js","sourceRoot":"","sources":["../src/traverse-edges.ts"],"names":[],"mappings":"AAGA;;;;;;IAMI;AACJ,SAAS,aAAa,CACpB,MAAc,EACd,CAA2B;IAE5B,wEAAwE;IACxE,gBAAgB;IAChB,MAAM,GAAG,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC;IAExC,OAAO,GAAG,CAAC,MAAM,EAAE;QAClB,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;QACrB,CAAC,CAAC,EAAE,CAAC,CAAC;QAEN,IAAI,EAAE,CAAC,aAAa,EAAE,EAAE;YAAE,SAAS;SAAE;QACrC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;KAC9B;AACF,CAAC;AAGD,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CpNode } from './cp-node.js';
|
|
2
|
-
/**
|
|
3
|
-
* Traverses the MAT tree and calls the given callback function for each vertex
|
|
4
|
-
* (represented by a [[CpNode]]) on the MAT.
|
|
5
|
-
*
|
|
6
|
-
* It is usually preferable to use [[traverseEdges]] as it allows for the
|
|
7
|
-
* traversal of all the smooth curves representing the MAT.
|
|
8
|
-
* @param cpNode Any [[CpNode]] representing the start vertex.
|
|
9
|
-
* @param f A callback function taking a single [[CpNode]] as parameter.
|
|
10
|
-
*/
|
|
11
|
-
declare function traverseVertices(cpNode: CpNode, f: (cpNode: CpNode) => void): void;
|
|
12
|
-
export { traverseVertices };
|
|
1
|
+
import { CpNode } from './cp-node.js';
|
|
2
|
+
/**
|
|
3
|
+
* Traverses the MAT tree and calls the given callback function for each vertex
|
|
4
|
+
* (represented by a [[CpNode]]) on the MAT.
|
|
5
|
+
*
|
|
6
|
+
* It is usually preferable to use [[traverseEdges]] as it allows for the
|
|
7
|
+
* traversal of all the smooth curves representing the MAT.
|
|
8
|
+
* @param cpNode Any [[CpNode]] representing the start vertex.
|
|
9
|
+
* @param f A callback function taking a single [[CpNode]] as parameter.
|
|
10
|
+
*/
|
|
11
|
+
declare function traverseVertices(cpNode: CpNode, f: (cpNode: CpNode) => void): void;
|
|
12
|
+
export { traverseVertices };
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Traverses the MAT tree and calls the given callback function for each vertex
|
|
3
|
-
* (represented by a [[CpNode]]) on the MAT.
|
|
4
|
-
*
|
|
5
|
-
* It is usually preferable to use [[traverseEdges]] as it allows for the
|
|
6
|
-
* traversal of all the smooth curves representing the MAT.
|
|
7
|
-
* @param cpNode Any [[CpNode]] representing the start vertex.
|
|
8
|
-
* @param f A callback function taking a single [[CpNode]] as parameter.
|
|
9
|
-
*/
|
|
10
|
-
function traverseVertices(cpNode, f) {
|
|
11
|
-
f(cpNode);
|
|
12
|
-
// Since the tree is unrooted we must iterate in all directions from the
|
|
13
|
-
// given cpNode.
|
|
14
|
-
cpNode.getCpNodesOnCircle()
|
|
15
|
-
.filter(cpNode => !cpNode.isTerminating())
|
|
16
|
-
.map(cpNode => cpNode.next)
|
|
17
|
-
.forEach(f_);
|
|
18
|
-
function f_(cpNode) {
|
|
19
|
-
|
|
20
|
-
while (cps.length) {
|
|
21
|
-
|
|
22
|
-
f(cp);
|
|
23
|
-
cps.push(...cp.vertexChildren);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export { traverseVertices };
|
|
1
|
+
/**
|
|
2
|
+
* Traverses the MAT tree and calls the given callback function for each vertex
|
|
3
|
+
* (represented by a [[CpNode]]) on the MAT.
|
|
4
|
+
*
|
|
5
|
+
* It is usually preferable to use [[traverseEdges]] as it allows for the
|
|
6
|
+
* traversal of all the smooth curves representing the MAT.
|
|
7
|
+
* @param cpNode Any [[CpNode]] representing the start vertex.
|
|
8
|
+
* @param f A callback function taking a single [[CpNode]] as parameter.
|
|
9
|
+
*/
|
|
10
|
+
function traverseVertices(cpNode, f) {
|
|
11
|
+
f(cpNode);
|
|
12
|
+
// Since the tree is unrooted we must iterate in all directions from the
|
|
13
|
+
// given cpNode.
|
|
14
|
+
cpNode.getCpNodesOnCircle()
|
|
15
|
+
.filter(cpNode => !cpNode.isTerminating())
|
|
16
|
+
.map(cpNode => cpNode.next)
|
|
17
|
+
.forEach(f_);
|
|
18
|
+
function f_(cpNode) {
|
|
19
|
+
const cps = [cpNode];
|
|
20
|
+
while (cps.length) {
|
|
21
|
+
const cp = cps.pop();
|
|
22
|
+
f(cp);
|
|
23
|
+
cps.push(...cp.vertexChildren);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export { traverseVertices };
|
|
28
28
|
//# sourceMappingURL=traverse-vertices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse-vertices.js","sourceRoot":"","sources":["../src/traverse-vertices.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,SAAS,gBAAgB,CACvB,MAAc,EACd,CAA2B;IAE5B,CAAC,CAAC,MAAM,CAAC,CAAC;IAEV,wEAAwE;IACxE,iBAAiB;IACjB,MAAM,CAAC,kBAAkB,EAAE;SACzB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;SACzC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;SAC1B,OAAO,CAAC,EAAE,CAAC,CAAC;IAEd,SAAS,EAAE,CAAC,MAAc;QACzB,
|
|
1
|
+
{"version":3,"file":"traverse-vertices.js","sourceRoot":"","sources":["../src/traverse-vertices.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,SAAS,gBAAgB,CACvB,MAAc,EACd,CAA2B;IAE5B,CAAC,CAAC,MAAM,CAAC,CAAC;IAEV,wEAAwE;IACxE,iBAAiB;IACjB,MAAM,CAAC,kBAAkB,EAAE;SACzB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;SACzC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;SAC1B,OAAO,CAAC,EAAE,CAAC,CAAC;IAEd,SAAS,EAAE,CAAC,MAAc;QACzB,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;QACrB,OAAO,GAAG,CAAC,MAAM,EAAE;YAClB,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,EAAE,CAAC;YACrB,CAAC,CAAC,EAAE,CAAC,CAAC;YACN,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,CAAC;SAC/B;IACF,CAAC;AACF,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flo-mat",
|
|
3
|
+
"sideEffects": false,
|
|
3
4
|
"description": "Medial / Scale Axis Transform (MAT/SAT) Library.",
|
|
4
|
-
"version": "2.0.
|
|
5
|
+
"version": "2.0.3",
|
|
5
6
|
"author": {
|
|
6
7
|
"name": "Floris Steenkamp"
|
|
7
8
|
},
|
|
@@ -30,33 +31,37 @@
|
|
|
30
31
|
"skeleton"
|
|
31
32
|
],
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"big-float-ts": "^3.0.
|
|
34
|
-
"double-double": "^2.0.
|
|
35
|
-
"flo-bezier3": "^4.
|
|
36
|
-
"flo-boolean": "^2.1.
|
|
37
|
-
"flo-draw": "^2.0.
|
|
38
|
-
"flo-gauss-quadrature": "^2.1.
|
|
39
|
-
"flo-ll-rb-tree": "^0.3.
|
|
40
|
-
"flo-memoize": "^1.0.
|
|
41
|
-
"flo-poly": "^6.0.
|
|
42
|
-
"flo-vector2d": "^4.0.
|
|
34
|
+
"big-float-ts": "^3.0.3",
|
|
35
|
+
"double-double": "^2.0.7",
|
|
36
|
+
"flo-bezier3": "^4.1.4",
|
|
37
|
+
"flo-boolean": "^2.1.6",
|
|
38
|
+
"flo-draw": "^2.0.2",
|
|
39
|
+
"flo-gauss-quadrature": "^2.1.2",
|
|
40
|
+
"flo-ll-rb-tree": "^0.3.3",
|
|
41
|
+
"flo-memoize": "^1.0.2",
|
|
42
|
+
"flo-poly": "^6.0.5",
|
|
43
|
+
"flo-vector2d": "^4.0.2"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
|
-
"@types/chai": "^4.3.
|
|
46
|
-
"@types/mocha": "^10.0.
|
|
47
|
-
"@types/node": "^18.11
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
46
|
+
"@types/chai": "^4.3.4",
|
|
47
|
+
"@types/mocha": "^10.0.1",
|
|
48
|
+
"@types/node": "^18.15.11",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
|
50
|
+
"@typescript-eslint/parser": "^5.58.0",
|
|
51
|
+
"c8": "^7.13.0",
|
|
52
|
+
"chai": "^4.3.7",
|
|
53
|
+
"circular-dependency-plugin": "^5.2.2",
|
|
54
|
+
"eslint": "^8.38.0",
|
|
55
|
+
"eslint-plugin-tree-shaking": "^1.10.0",
|
|
56
|
+
"mocha": "^10.2.0",
|
|
57
|
+
"resolve-typescript-plugin": "^2.0.1",
|
|
58
|
+
"rimraf": "^5.0.0",
|
|
52
59
|
"source-map-support": "^0.5.21",
|
|
53
|
-
"ts-loader": "^9.4.
|
|
60
|
+
"ts-loader": "^9.4.2",
|
|
54
61
|
"ts-node": "^10.9.1",
|
|
55
|
-
"typescript": "^
|
|
56
|
-
"webpack": "^5.
|
|
57
|
-
"webpack-cli": "^
|
|
58
|
-
"circular-dependency-plugin": "^5.2.2",
|
|
59
|
-
"resolve-typescript-plugin": "^1.2.0"
|
|
62
|
+
"typescript": "^5.0.4",
|
|
63
|
+
"webpack": "^5.78.0",
|
|
64
|
+
"webpack-cli": "^5.0.1"
|
|
60
65
|
},
|
|
61
66
|
"scripts": {
|
|
62
67
|
"build": "npm run build-browser && npm run build-node",
|
package/src/circle.ts
CHANGED
|
@@ -30,9 +30,9 @@ function engulfsCircle(c1: Circle, c2: Circle) {
|
|
|
30
30
|
return false;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const d = squaredDistanceBetween(c1.center, c2.center);
|
|
34
|
+
const dr = c1.radius - c2.radius;
|
|
35
|
+
const δ = dr*dr;
|
|
36
36
|
|
|
37
37
|
return δ > d;
|
|
38
38
|
}
|