flo-mat 1.2.0 → 2.0.0
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/.mocharc.cjs +17 -0
- package/README.md +12 -1
- package/browser/index.js +7348 -0
- package/browser/index.min.js +2 -1
- package/browser/index.min.js.LICENSE.txt +2907 -0
- package/browser/index.module.js +7369 -0
- package/browser/index.module.min.js +2 -0
- package/browser/index.module.min.js.LICENSE.txt +2907 -0
- package/node/circle.js +3 -7
- package/node/circle.js.map +1 -1
- package/node/compare-curvatures-at-interface.d.ts +19 -0
- package/node/compare-curvatures-at-interface.js +125 -0
- package/node/compare-curvatures-at-interface.js.map +1 -0
- package/node/contact-point.d.ts +2 -2
- package/node/contact-point.js +3 -6
- package/node/contact-point.js.map +1 -1
- package/node/cp-node/clone.d.ts +1 -1
- package/node/cp-node/clone.js +4 -7
- package/node/cp-node/clone.js.map +1 -1
- package/node/cp-node/remove.d.ts +2 -2
- package/node/cp-node/remove.js +1 -4
- package/node/cp-node/remove.js.map +1 -1
- package/node/cp-node.d.ts +4 -5
- package/node/cp-node.js +8 -12
- package/node/cp-node.js.map +1 -1
- package/node/curve.d.ts +2 -2
- package/node/curve.js +10 -14
- package/node/curve.js.map +1 -1
- package/node/debug/cp-node-for-debugging.d.ts +2 -2
- package/node/debug/cp-node-for-debugging.js +1 -2
- package/node/debug/debug-elem-types.d.ts +8 -8
- package/node/debug/debug-elem-types.js +1 -2
- package/node/debug/debug.d.ts +5 -7
- package/node/debug/debug.js +67 -10
- package/node/debug/debug.js.map +1 -1
- package/node/debug/functions/draw-elem/bounding-hull.js +3 -6
- package/node/debug/functions/draw-elem/bounding-hull.js.map +1 -1
- package/node/debug/functions/draw-elem/branch.d.ts +1 -1
- package/node/debug/functions/draw-elem/branch.js +5 -8
- package/node/debug/functions/draw-elem/branch.js.map +1 -1
- package/node/debug/functions/draw-elem/culls.d.ts +1 -1
- package/node/debug/functions/draw-elem/culls.js +1 -4
- package/node/debug/functions/draw-elem/culls.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.js +1 -4
- package/node/debug/functions/draw-elem/draw-circle-percent.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-elem.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-elem.js +34 -37
- package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
- package/node/debug/functions/draw-elem/dull-corner.d.ts +1 -1
- package/node/debug/functions/draw-elem/dull-corner.js +5 -7
- package/node/debug/functions/draw-elem/dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/leaves.d.ts +1 -1
- package/node/debug/functions/draw-elem/leaves.js +3 -6
- package/node/debug/functions/draw-elem/leaves.js.map +1 -1
- package/node/debug/functions/draw-elem/loop.d.ts +1 -1
- package/node/debug/functions/draw-elem/loop.js +1 -4
- package/node/debug/functions/draw-elem/loop.js.map +1 -1
- package/node/debug/functions/draw-elem/loops.d.ts +1 -1
- package/node/debug/functions/draw-elem/loops.js +1 -4
- package/node/debug/functions/draw-elem/loops.js.map +1 -1
- package/node/debug/functions/draw-elem/loose-bounding-box.js +3 -6
- package/node/debug/functions/draw-elem/loose-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/mat.d.ts +1 -1
- package/node/debug/functions/draw-elem/mat.js +7 -10
- package/node/debug/functions/draw-elem/mat.js.map +1 -1
- package/node/debug/functions/draw-elem/max-vertex.d.ts +1 -1
- package/node/debug/functions/draw-elem/max-vertex.js +3 -6
- package/node/debug/functions/draw-elem/max-vertex.js.map +1 -1
- package/node/debug/functions/draw-elem/min-y.d.ts +1 -1
- package/node/debug/functions/draw-elem/min-y.js +9 -12
- 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 +1 -1
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js +7 -10
- 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 +1 -1
- package/node/debug/functions/draw-elem/one-prong.js +9 -12
- package/node/debug/functions/draw-elem/one-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/sharp-corner.d.ts +1 -1
- package/node/debug/functions/draw-elem/sharp-corner.js +3 -6
- package/node/debug/functions/draw-elem/sharp-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/three-prong.d.ts +1 -1
- package/node/debug/functions/draw-elem/three-prong.js +9 -12
- package/node/debug/functions/draw-elem/three-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/tight-bounding-box.js +3 -6
- package/node/debug/functions/draw-elem/tight-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/two-prong.d.ts +1 -1
- package/node/debug/functions/draw-elem/two-prong.js +9 -12
- package/node/debug/functions/draw-elem/two-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/vertex.d.ts +1 -1
- package/node/debug/functions/draw-elem/vertex.js +7 -10
- package/node/debug/functions/draw-elem/vertex.js.map +1 -1
- package/node/debug/functions/general.d.ts +1 -1
- package/node/debug/functions/general.js +3 -6
- package/node/debug/functions/general.js.map +1 -1
- package/node/debug/functions/three-prong.js +24 -27
- package/node/debug/functions/three-prong.js.map +1 -1
- package/node/debug/functions/two-prong.d.ts +1 -1
- package/node/debug/functions/two-prong.js +10 -13
- package/node/debug/functions/two-prong.js.map +1 -1
- package/node/debug/three-prong-for-debugging.d.ts +4 -4
- package/node/debug/three-prong-for-debugging.js +4 -7
- package/node/debug/three-prong-for-debugging.js.map +1 -1
- package/node/debug/two-prong-for-debugging.d.ts +5 -5
- package/node/debug/two-prong-for-debugging.js +1 -2
- package/node/find-mats.d.ts +12 -9
- package/node/find-mats.js +47 -53
- package/node/find-mats.js.map +1 -1
- package/node/get-boundary-bezier-parts-to-next.d.ts +3 -3
- package/node/get-boundary-bezier-parts-to-next.js +1 -4
- package/node/get-boundary-bezier-parts-to-next.js.map +1 -1
- package/node/get-boundary-beziers-to-next.d.ts +1 -1
- package/node/get-boundary-beziers-to-next.js +8 -8
- package/node/get-boundary-beziers-to-next.js.map +1 -1
- package/node/get-bounding-box-.d.ts +2 -0
- package/node/get-bounding-box-.js +5 -0
- package/node/get-bounding-box-.js.map +1 -0
- package/node/get-branches.d.ts +1 -1
- package/node/get-branches.js +7 -10
- package/node/get-branches.js.map +1 -1
- package/node/get-curve/get-curve-between.d.ts +1 -1
- package/node/get-curve/get-curve-between.js +21 -24
- package/node/get-curve/get-curve-between.js.map +1 -1
- package/node/get-curve/get-edge-direction.d.ts +1 -1
- package/node/get-curve/get-edge-direction.js +12 -15
- package/node/get-curve/get-edge-direction.js.map +1 -1
- package/node/get-curve-to-next.d.ts +1 -1
- package/node/get-curve-to-next.js +3 -6
- package/node/get-curve-to-next.js.map +1 -1
- package/node/get-interface-ccw.d.ts +24 -0
- package/node/get-interface-ccw.js +98 -0
- package/node/get-interface-ccw.js.map +1 -0
- package/node/index.d.ts +35 -36
- package/node/index.js +32 -56
- package/node/index.js.map +1 -1
- package/node/loop/get-max-coordinate.js +1 -4
- package/node/loop/get-max-coordinate.js.map +1 -1
- package/node/loop.d.ts +1 -1
- package/node/loop.js +1 -4
- package/node/loop.js.map +1 -1
- package/node/mat/add-to-cp-graph.d.ts +5 -5
- package/node/mat/add-to-cp-graph.js +5 -8
- package/node/mat/add-to-cp-graph.js.map +1 -1
- package/node/mat/bezier-piece.d.ts +1 -1
- package/node/mat/bezier-piece.js +1 -2
- package/node/mat/closest-boundary-point/closest-points-on-curve.d.ts +1 -1
- package/node/mat/closest-boundary-point/closest-points-on-curve.js +15 -14
- 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 +1 -1
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js +7 -10
- 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 +1 -1
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js +5 -8
- 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 +1 -1
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js +7 -8
- 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 +1 -1
- package/node/mat/closest-boundary-point/get-best-distance-squared.js +6 -9
- 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 +2 -2
- package/node/mat/closest-boundary-point/get-close-boundary-points.js +9 -12
- 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 +3 -3
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js +10 -13
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js.map +1 -1
- package/node/mat/corner.js +1 -2
- package/node/mat/create-new-cp-tree.d.ts +3 -3
- package/node/mat/create-new-cp-tree.js +5 -7
- package/node/mat/create-new-cp-tree.js.map +1 -1
- package/node/mat/elem-type-two-prong.js +1 -2
- package/node/mat/find-mat/add-1-prong.d.ts +4 -4
- package/node/mat/find-mat/add-1-prong.js +9 -12
- package/node/mat/find-mat/add-1-prong.js.map +1 -1
- package/node/mat/find-mat/add-2-prong.d.ts +5 -5
- package/node/mat/find-mat/add-2-prong.js +19 -22
- package/node/mat/find-mat/add-2-prong.js.map +1 -1
- package/node/mat/find-mat/add-3-prong.d.ts +5 -5
- package/node/mat/find-mat/add-3-prong.js +7 -10
- package/node/mat/find-mat/add-3-prong.js.map +1 -1
- package/node/mat/find-mat/add-debug-info.d.ts +2 -2
- package/node/mat/find-mat/add-debug-info.js +8 -13
- 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 +3 -3
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js +29 -16
- 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 +4 -4
- package/node/mat/find-mat/create-initial-cp-graph.js +7 -9
- 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 +5 -5
- package/node/mat/find-mat/find-2-prong/add-debug-info.js +3 -6
- 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 +1 -1
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js +5 -8
- 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 +5 -5
- package/node/mat/find-mat/find-2-prong/find-2-prong.js +37 -39
- 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.js +1 -4
- 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 +5 -5
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js +7 -10
- 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 +1 -1
- package/node/mat/find-mat/find-2-prong/x-for-debugging.js +1 -2
- package/node/mat/find-mat/find-3-prong/calc-better-x.d.ts +2 -2
- package/node/mat/find-mat/find-3-prong/calc-better-x.js +10 -13
- 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 +2 -2
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js +6 -8
- 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 +3 -3
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js +29 -32
- 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 +3 -3
- package/node/mat/find-mat/find-3-prong/find-3-prong.js +14 -12
- 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 +2 -2
- package/node/mat/find-mat/find-3-prong/get-closest-points.js +3 -6
- 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 +4 -4
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js +3 -6
- 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 +4 -4
- package/node/mat/find-mat/find-and-add-2-prongs.js +9 -12
- 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 +3 -3
- package/node/mat/find-mat/find-and-add-3-prongs.js +8 -11
- 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 +3 -3
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js +11 -14
- 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 +1 -1
- package/node/mat/find-mat/get-potential-2-prongs.js +3 -6
- package/node/mat/find-mat/get-potential-2-prongs.js.map +1 -1
- package/node/mat/find-mat/get-sharp-corners.d.ts +1 -1
- package/node/mat/find-mat/get-sharp-corners.js +3 -6
- package/node/mat/find-mat/get-sharp-corners.js.map +1 -1
- package/node/mat/geometry/get-closest-square-distance-to-rect.js +21 -15
- package/node/mat/geometry/get-closest-square-distance-to-rect.js.map +1 -1
- package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js +5 -8
- package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -1
- package/node/mat/get-boundary-piece-beziers.d.ts +2 -2
- package/node/mat/get-boundary-piece-beziers.js +6 -9
- package/node/mat/get-boundary-piece-beziers.js.map +1 -1
- package/node/mat/get-contact-circles-at-interface.d.ts +2 -2
- package/node/mat/get-contact-circles-at-interface.js +7 -10
- package/node/mat/get-contact-circles-at-interface.js.map +1 -1
- package/node/mat/get-largest-vertex.d.ts +1 -1
- package/node/mat/get-largest-vertex.js +1 -4
- package/node/mat/get-largest-vertex.js.map +1 -1
- package/node/mat/get-leaves.d.ts +1 -1
- package/node/mat/get-leaves.js +1 -4
- package/node/mat/get-leaves.js.map +1 -1
- package/node/mat/get-neighboring-cps.d.ts +3 -3
- package/node/mat/get-neighboring-cps.js +5 -8
- package/node/mat/get-neighboring-cps.js.map +1 -1
- package/node/mat/get-two-prong-type.d.ts +2 -2
- package/node/mat/get-two-prong-type.js +1 -4
- package/node/mat/get-two-prong-type.js.map +1 -1
- package/node/mat/is-another-cp-closeby.d.ts +5 -5
- package/node/mat/is-another-cp-closeby.js +8 -11
- package/node/mat/is-another-cp-closeby.js.map +1 -1
- package/node/mat/simplify-mat-map-only.d.ts +1 -1
- package/node/mat/simplify-mat-map-only.js +10 -14
- package/node/mat/simplify-mat-map-only.js.map +1 -1
- package/node/mat/to-scale-axis/add-debug-info.d.ts +1 -1
- package/node/mat/to-scale-axis/add-debug-info.js +1 -4
- package/node/mat/to-scale-axis/add-debug-info.js.map +1 -1
- package/node/mat/to-scale-axis/cull-non-cycles.d.ts +1 -1
- package/node/mat/to-scale-axis/cull-non-cycles.js +5 -8
- package/node/mat/to-scale-axis/cull-non-cycles.js.map +1 -1
- package/node/mat/to-scale-axis/cull.d.ts +2 -2
- package/node/mat/to-scale-axis/cull.js +75 -8
- package/node/mat/to-scale-axis/cull.js.map +1 -1
- package/node/mat/trim-mat.d.ts +1 -1
- package/node/mat/trim-mat.js +6 -9
- package/node/mat/trim-mat.js.map +1 -1
- package/node/mat.d.ts +3 -3
- package/node/mat.js +1 -2
- package/node/point-on-shape.d.ts +2 -2
- package/node/point-on-shape.js +23 -34
- package/node/point-on-shape.js.map +1 -1
- package/node/simplify-mat.d.ts +4 -3
- package/node/simplify-mat.js +14 -16
- package/node/simplify-mat.js.map +1 -1
- package/node/svg/get-loop-bounds.d.ts +2 -2
- package/node/svg/get-loop-bounds.js +11 -13
- package/node/svg/get-loop-bounds.js.map +1 -1
- package/node/svg/get-min-y-pos.d.ts +3 -2
- package/node/svg/get-min-y-pos.js +3 -6
- package/node/svg/get-min-y-pos.js.map +1 -1
- package/node/svg/get-shape-bounds.d.ts +5 -5
- package/node/svg/get-shape-bounds.js +5 -8
- package/node/svg/get-shape-bounds.js.map +1 -1
- package/node/sweep-line/sweep-line.js +1 -4
- package/node/sweep-line/sweep-line.js.map +1 -1
- package/node/to-scale-axis.d.ts +2 -1
- package/node/to-scale-axis.js +18 -21
- package/node/to-scale-axis.js.map +1 -1
- package/node/traverse-edges.d.ts +1 -1
- package/node/traverse-edges.js +1 -4
- package/node/traverse-edges.js.map +1 -1
- package/node/traverse-vertices.d.ts +1 -1
- package/node/traverse-vertices.js +1 -4
- package/node/traverse-vertices.js.map +1 -1
- package/package.json +34 -31
- package/src/circle.ts +0 -6
- package/src/compare-curvatures-at-interface.ts +197 -0
- package/src/contact-point.ts +2 -3
- package/src/cp-node/clone.ts +1 -2
- package/src/cp-node/remove.ts +2 -3
- package/src/cp-node.ts +6 -8
- package/src/curve.ts +3 -4
- package/src/debug/cp-node-for-debugging.ts +2 -3
- package/src/debug/debug-elem-types.ts +8 -10
- package/src/debug/debug.ts +22 -17
- package/src/debug/functions/draw-elem/bounding-hull.ts +0 -1
- package/src/debug/functions/draw-elem/branch.ts +2 -3
- package/src/debug/functions/draw-elem/culls.ts +1 -2
- package/src/debug/functions/draw-elem/draw-elem.ts +18 -19
- package/src/debug/functions/draw-elem/dull-corner.ts +3 -3
- package/src/debug/functions/draw-elem/leaves.ts +2 -4
- package/src/debug/functions/draw-elem/loop.ts +1 -2
- package/src/debug/functions/draw-elem/loops.ts +1 -2
- package/src/debug/functions/draw-elem/loose-bounding-box.ts +0 -1
- package/src/debug/functions/draw-elem/mat.ts +3 -5
- package/src/debug/functions/draw-elem/max-vertex.ts +1 -2
- package/src/debug/functions/draw-elem/min-y.ts +5 -7
- package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +1 -2
- package/src/debug/functions/draw-elem/one-prong.ts +2 -3
- package/src/debug/functions/draw-elem/sharp-corner.ts +1 -2
- package/src/debug/functions/draw-elem/three-prong.ts +2 -4
- package/src/debug/functions/draw-elem/tight-bounding-box.ts +0 -1
- package/src/debug/functions/draw-elem/two-prong.ts +2 -3
- package/src/debug/functions/draw-elem/vertex.ts +1 -2
- package/src/debug/functions/general.ts +2 -3
- package/src/debug/functions/three-prong.ts +3 -4
- package/src/debug/functions/two-prong.ts +6 -14
- package/src/debug/three-prong-for-debugging.ts +4 -5
- package/src/debug/two-prong-for-debugging.ts +5 -6
- package/src/find-mats.ts +34 -39
- package/src/get-boundary-bezier-parts-to-next.ts +5 -6
- package/src/get-boundary-beziers-to-next.ts +8 -7
- package/src/get-bounding-box-.ts +7 -0
- package/src/get-branches.ts +2 -3
- package/src/get-curve/get-curve-between.ts +2 -3
- package/src/get-curve/get-edge-direction.ts +2 -5
- package/src/get-curve-to-next.ts +2 -3
- package/src/get-interface-ccw.ts +112 -0
- package/src/index.ts +34 -48
- package/src/loop/get-max-coordinate.ts +0 -1
- package/src/loop.ts +1 -2
- package/src/mat/add-to-cp-graph.ts +7 -8
- package/src/mat/bezier-piece.ts +1 -2
- package/src/mat/closest-boundary-point/closest-points-on-curve.ts +19 -17
- package/src/mat/closest-boundary-point/cull-bezier-pieces.ts +4 -5
- package/src/mat/closest-boundary-point/cull-by-loose-bounding-box.ts +4 -5
- package/src/mat/closest-boundary-point/cull-by-tight-boundary-box.ts +7 -5
- package/src/mat/closest-boundary-point/get-best-distance-squared.ts +1 -2
- package/src/mat/closest-boundary-point/get-close-boundary-points.ts +4 -11
- package/src/mat/closest-boundary-point/get-closest-boundary-point.ts +5 -6
- package/src/mat/cmp-cp-on-delta.ts +2 -3
- package/src/mat/create-new-cp-tree.ts +5 -5
- package/src/mat/find-mat/add-1-prong.ts +7 -8
- package/src/mat/find-mat/add-2-prong.ts +11 -12
- package/src/mat/find-mat/add-3-prong.ts +7 -8
- package/src/mat/find-mat/add-debug-info.ts +8 -7
- package/src/mat/find-mat/create-get-interesting-points-on-loop.ts +22 -8
- package/src/mat/find-mat/create-initial-cp-graph.ts +7 -8
- package/src/mat/find-mat/find-2-prong/add-debug-info.ts +9 -10
- package/src/mat/find-mat/find-2-prong/cull-bezier-pieces.ts +4 -7
- package/src/mat/find-mat/find-2-prong/find-2-prong.ts +19 -17
- package/src/mat/find-mat/find-2-prong/get-initial-bezier-pieces.ts +7 -8
- package/src/mat/find-mat/find-2-prong/x-for-debugging.ts +1 -2
- package/src/mat/find-mat/find-3-prong/calc-better-x.ts +3 -6
- package/src/mat/find-mat/find-3-prong/calc-initial-3-prong-center.ts +3 -8
- package/src/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.ts +10 -14
- package/src/mat/find-mat/find-3-prong/find-3-prong.ts +13 -8
- package/src/mat/find-mat/find-3-prong/get-closest-points.ts +2 -5
- package/src/mat/find-mat/find-and-add-2-prongs-on-all-paths.ts +5 -6
- package/src/mat/find-mat/find-and-add-2-prongs.ts +9 -10
- package/src/mat/find-mat/find-and-add-3-prongs.ts +8 -9
- package/src/mat/find-mat/find-and-add-hole-closing-2-prongs.ts +7 -8
- package/src/mat/find-mat/get-potential-2-prongs.ts +1 -2
- package/src/mat/find-mat/get-sharp-corners.ts +1 -2
- package/src/mat/find-mat/get-total-abs-curvature.ts +2 -3
- package/src/mat/find-mat/get-total-by.ts +2 -3
- package/src/mat/geometry/get-closest-square-distance-to-rect.ts +15 -4
- package/src/mat/geometry/get-closest-squared-distance-to-rotated-rect.ts +0 -1
- package/src/mat/get-boundary-piece-beziers.ts +5 -6
- package/src/mat/get-contact-circles-at-interface.ts +3 -4
- package/src/mat/get-edges-as-array.ts +2 -3
- package/src/mat/get-largest-three-prong.ts +1 -2
- package/src/mat/get-largest-vertex.ts +1 -2
- package/src/mat/get-leaves.ts +1 -2
- package/src/mat/get-neighboring-cps.ts +5 -6
- package/src/mat/get-two-prong-type.ts +2 -3
- package/src/mat/is-another-cp-closeby.ts +6 -7
- package/src/mat/simplify-mat-map-only.ts +5 -7
- package/src/mat/to-scale-axis/add-debug-info.ts +2 -3
- package/src/mat/to-scale-axis/add-to-tree.ts +3 -4
- package/src/mat/to-scale-axis/calc-groups.ts +1 -2
- package/src/mat/to-scale-axis/create-spacial-tree.ts +3 -4
- package/src/mat/to-scale-axis/cull-non-cycles.ts +2 -3
- package/src/mat/to-scale-axis/cull.ts +3 -4
- package/src/mat/to-scale-axis/get-engulfed-vertices.ts +3 -4
- package/src/mat/to-scale-axis/t-tree.ts +1 -2
- package/src/mat/to-scale-axis/traverse-spacial-tree.ts +2 -4
- package/src/mat/trim-mat.ts +4 -5
- package/src/mat.ts +3 -5
- package/src/point-on-shape.ts +10 -12
- package/src/simplify-mat.ts +11 -13
- package/src/svg/get-curvature-at-interface.ts +1 -3
- package/src/svg/get-extreme.ts +2 -3
- package/src/svg/get-loop-bounds.ts +4 -4
- package/src/svg/get-min-y-pos.ts +2 -6
- package/src/svg/get-shape-bounds.ts +2 -3
- package/src/sweep-line/are-boxes-intersecting.ts +1 -1
- package/src/to-scale-axis.ts +15 -16
- package/src/traverse-edges.ts +1 -2
- package/src/traverse-vertices.ts +1 -2
- package/test/lib-load.spec.ts +0 -1
- package/tsconfig.json +6 -31
- package/webpack.config.cjs +132 -0
- package/.nycrc +0 -4
- package/node/mat/cmp-cp-on-delta.d.ts +0 -14
- package/node/mat/cmp-cp-on-delta.js +0 -45
- package/node/mat/cmp-cp-on-delta.js.map +0 -1
- package/node/mat/find-mat/get-total-abs-curvature.d.ts +0 -5
- package/node/mat/find-mat/get-total-abs-curvature.js +0 -13
- package/node/mat/find-mat/get-total-abs-curvature.js.map +0 -1
- package/node/mat/find-mat/get-total-by.d.ts +0 -10
- package/node/mat/find-mat/get-total-by.js +0 -22
- package/node/mat/find-mat/get-total-by.js.map +0 -1
- package/node/mat/get-edges-as-array.d.ts +0 -4
- package/node/mat/get-edges-as-array.js +0 -12
- package/node/mat/get-edges-as-array.js.map +0 -1
- package/node/mat/get-largest-three-prong.d.ts +0 -4
- package/node/mat/get-largest-three-prong.js +0 -13
- package/node/mat/get-largest-three-prong.js.map +0 -1
- package/node/mat/to-scale-axis/add-to-tree.d.ts +0 -13
- package/node/mat/to-scale-axis/add-to-tree.js +0 -39
- package/node/mat/to-scale-axis/add-to-tree.js.map +0 -1
- package/node/mat/to-scale-axis/calc-groups.d.ts +0 -28
- package/node/mat/to-scale-axis/calc-groups.js +0 -66
- package/node/mat/to-scale-axis/calc-groups.js.map +0 -1
- package/node/mat/to-scale-axis/create-spacial-tree.d.ts +0 -9
- package/node/mat/to-scale-axis/create-spacial-tree.js +0 -24
- package/node/mat/to-scale-axis/create-spacial-tree.js.map +0 -1
- package/node/mat/to-scale-axis/get-engulfed-vertices.d.ts +0 -12
- package/node/mat/to-scale-axis/get-engulfed-vertices.js +0 -95
- package/node/mat/to-scale-axis/get-engulfed-vertices.js.map +0 -1
- package/node/mat/to-scale-axis/t-tree.d.ts +0 -6
- package/node/mat/to-scale-axis/t-tree.js +0 -3
- package/node/mat/to-scale-axis/t-tree.js.map +0 -1
- package/node/mat/to-scale-axis/traverse-spacial-tree.d.ts +0 -11
- package/node/mat/to-scale-axis/traverse-spacial-tree.js +0 -25
- package/node/mat/to-scale-axis/traverse-spacial-tree.js.map +0 -1
- package/node/svg/get-curvature-at-interface.d.ts +0 -9
- package/node/svg/get-curvature-at-interface.js +0 -49
- package/node/svg/get-curvature-at-interface.js.map +0 -1
- package/node/svg/get-extreme.d.ts +0 -9
- package/node/svg/get-extreme.js +0 -16
- package/node/svg/get-extreme.js.map +0 -1
- package/node/sweep-line/are-boxes-intersecting.d.ts +0 -11
- package/node/sweep-line/are-boxes-intersecting.js +0 -42
- package/node/sweep-line/are-boxes-intersecting.js.map +0 -1
- package/test/mocha.opts +0 -4
- package/webpack.config.js +0 -25
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEngulfedVertices = void 0;
|
|
4
|
-
const circle_1 = require("../../circle");
|
|
5
|
-
const calc_groups_1 = require("./calc-groups");
|
|
6
|
-
/** @hidden */
|
|
7
|
-
const width = 1620; // TODO change to actual shape coordinates
|
|
8
|
-
/** @hidden */
|
|
9
|
-
const height = 1560; // ...
|
|
10
|
-
/**
|
|
11
|
-
* @hidden
|
|
12
|
-
* Returns a map of engulfed MAT nodes determined to be engulfed by the given
|
|
13
|
-
* test node and scale factor and starting from the given spacial tree node.
|
|
14
|
-
* @param s The scale factor
|
|
15
|
-
* @param tree The spacial tree node from where to start
|
|
16
|
-
* @param circle The circle potentially engulfing other nodes
|
|
17
|
-
*/
|
|
18
|
-
function getEngulfedVertices(s, tree, circle) {
|
|
19
|
-
let c1 = circle_1.scaleCircle(circle, s);
|
|
20
|
-
let cullNodes = new Set();
|
|
21
|
-
let limits = [[0, width], [0, height]];
|
|
22
|
-
f(tree, 0, limits, 0);
|
|
23
|
-
return cullNodes;
|
|
24
|
-
function cullBranch5(tree) {
|
|
25
|
-
let t = tree.trees.get(5);
|
|
26
|
-
if (!t) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
let circles = t.circles;
|
|
30
|
-
circles.forEach(function (circle, key) {
|
|
31
|
-
let c2 = circle_1.scaleCircle(circle, s);
|
|
32
|
-
if (circle_1.engulfsCircle(c1, c2)) {
|
|
33
|
-
cullNodes.add(circle);
|
|
34
|
-
circles.delete(key);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function f(tree, coordinate, limits, depth) {
|
|
39
|
-
if (limits === null) {
|
|
40
|
-
// If we already reached a circle which spans multiple groups
|
|
41
|
-
// previously, then check all circles in the tree.
|
|
42
|
-
cullBranch5(tree);
|
|
43
|
-
for (let i = 0; i <= 4; i++) {
|
|
44
|
-
let t = tree.trees.get(i);
|
|
45
|
-
if (t) {
|
|
46
|
-
f(t, 0, null, depth + 1);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
let { groups, newLimits } = calc_groups_1.calcGroups(s, coordinate, limits, circle);
|
|
52
|
-
if (groups.length === 1) {
|
|
53
|
-
cullBranch5(tree);
|
|
54
|
-
let group = groups[0];
|
|
55
|
-
let newCoordinate = coordinate ? 0 : 1;
|
|
56
|
-
if (group === 1 || group === 3) {
|
|
57
|
-
// One of the higher priority left/top or
|
|
58
|
-
// right/bottom half groups.
|
|
59
|
-
let t = tree.trees.get(group);
|
|
60
|
-
if (t) {
|
|
61
|
-
f(t, newCoordinate, newLimits, depth + 1);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
// One of the lower priority even groups (0,2 or 4).
|
|
66
|
-
let branches = [];
|
|
67
|
-
branches.push(tree.trees.get(group));
|
|
68
|
-
if (group > 0) {
|
|
69
|
-
branches.push(tree.trees.get(group - 1));
|
|
70
|
-
}
|
|
71
|
-
if (group < 4) {
|
|
72
|
-
branches.push(tree.trees.get(group + 1));
|
|
73
|
-
}
|
|
74
|
-
for (let branch of branches) {
|
|
75
|
-
if (branch) {
|
|
76
|
-
f(branch, newCoordinate, newLimits, depth + 1);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
cullBranch5(tree);
|
|
83
|
-
// Circle spans multiple groups at this level of the tree. Check all
|
|
84
|
-
// circles in all branches.
|
|
85
|
-
for (let i = 0; i <= 4; i++) {
|
|
86
|
-
let t = tree.trees.get(i);
|
|
87
|
-
if (!t) {
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
f(t, 0, null, depth + 1);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
exports.getEngulfedVertices = getEngulfedVertices;
|
|
95
|
-
//# sourceMappingURL=get-engulfed-vertices.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-engulfed-vertices.js","sourceRoot":"","sources":["../../../src/mat/to-scale-axis/get-engulfed-vertices.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"t-tree.js","sourceRoot":"","sources":["../../../src/mat/to-scale-axis/t-tree.ts"],"names":[],"mappings":""}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Circle } from '../../circle';
|
|
2
|
-
import { TTree } from './t-tree';
|
|
3
|
-
/**
|
|
4
|
-
* @hidden
|
|
5
|
-
* Traverses the spacial tree and calls the given callback function for each
|
|
6
|
-
* MAT circle in the tree and iteravely for each subtree.
|
|
7
|
-
* @param tree The spacial tree to traverse
|
|
8
|
-
* @param f A function to call for each MAT circle in the tree.
|
|
9
|
-
*/
|
|
10
|
-
declare function traverseSpacialTree(tree: TTree, f: (circle: Circle) => void): void;
|
|
11
|
-
export { traverseSpacialTree };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.traverseSpacialTree = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
* Traverses the spacial tree and calls the given callback function for each
|
|
7
|
-
* MAT circle in the tree and iteravely for each subtree.
|
|
8
|
-
* @param tree The spacial tree to traverse
|
|
9
|
-
* @param f A function to call for each MAT circle in the tree.
|
|
10
|
-
*/
|
|
11
|
-
function traverseSpacialTree(tree, f) {
|
|
12
|
-
g(tree);
|
|
13
|
-
function g(tree) {
|
|
14
|
-
if (!tree) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
if (tree.circles.size) {
|
|
18
|
-
tree.circles.forEach(f);
|
|
19
|
-
return; // Leaf reached
|
|
20
|
-
}
|
|
21
|
-
[5, 0, 2, 4, 1, 3].forEach(i => g(tree.trees.get(i)));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.traverseSpacialTree = traverseSpacialTree;
|
|
25
|
-
//# sourceMappingURL=traverse-spacial-tree.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"traverse-spacial-tree.js","sourceRoot":"","sources":["../../../src/mat/to-scale-axis/traverse-spacial-tree.ts"],"names":[],"mappings":";;;AAMA;;;;;;GAMG;AACH,SAAS,mBAAmB,CACpB,IAAW,EACX,CAA2B;IAE/B,CAAC,CAAC,IAAI,CAAC,CAAC;IAER,SAAS,CAAC,CAAC,IAAW;QAClB,IAAI,CAAC,IAAI,EAAE;YAAE,OAAO;SAAE;QAEtB,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YACnB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAExB,OAAO,CAAC,gBAAgB;SAC3B;QAED,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC,OAAO,CACjB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAC5B,CAAC;IACN,CAAC;AACL,CAAC;AAGQ,kDAAmB"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Curve } from '../curve';
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
* Get the angle between the given bezier endpoint and the
|
|
5
|
-
* startpoint of the next bezier.
|
|
6
|
-
* @param curve
|
|
7
|
-
*/
|
|
8
|
-
declare function getCurvatureAtInterface(curve: Curve): number;
|
|
9
|
-
export { getCurvatureAtInterface };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// TODO - move to another library
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getCurvatureAtInterface = void 0;
|
|
5
|
-
const flo_bezier3_1 = require("flo-bezier3");
|
|
6
|
-
const flo_vector2d_1 = require("flo-vector2d");
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
* Get the angle between the given bezier endpoint and the
|
|
10
|
-
* startpoint of the next bezier.
|
|
11
|
-
* @param curve
|
|
12
|
-
*/
|
|
13
|
-
function getCurvatureAtInterface(curve) {
|
|
14
|
-
const ts = [1, 0];
|
|
15
|
-
let pss = [
|
|
16
|
-
curve.ps,
|
|
17
|
-
curve.next.ps
|
|
18
|
-
];
|
|
19
|
-
let tans = [
|
|
20
|
-
flo_vector2d_1.toUnitVector(flo_bezier3_1.tangent(pss[0], 1)),
|
|
21
|
-
flo_vector2d_1.toUnitVector(flo_bezier3_1.tangent(pss[0], 0))
|
|
22
|
-
];
|
|
23
|
-
// The integral of a kind of Dirac Delta function.
|
|
24
|
-
let cosθ = flo_vector2d_1.dot(tans[0], tans[1]);
|
|
25
|
-
let sinθ = flo_vector2d_1.cross(tans[0], tans[1]);
|
|
26
|
-
let θ = acos(cosθ);
|
|
27
|
-
let result = sinθ >= 0 ? θ : -θ;
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
30
|
-
exports.getCurvatureAtInterface = getCurvatureAtInterface;
|
|
31
|
-
/**
|
|
32
|
-
* @hidden
|
|
33
|
-
* Floating-point 'safer' version of acos. If x is larger than 1 (or smaller
|
|
34
|
-
* than -1), still returns 0 (or Math.PI) instead of NAN.
|
|
35
|
-
* @param x
|
|
36
|
-
* @example
|
|
37
|
-
* acos(1); //=> 0
|
|
38
|
-
* acos(2); //=> 0
|
|
39
|
-
*/
|
|
40
|
-
function acos(x) {
|
|
41
|
-
if (x > 1) {
|
|
42
|
-
return 0;
|
|
43
|
-
}
|
|
44
|
-
else if (x < -1) {
|
|
45
|
-
return Math.PI;
|
|
46
|
-
}
|
|
47
|
-
return Math.acos(x);
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=get-curvature-at-interface.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-curvature-at-interface.js","sourceRoot":"","sources":["../../src/svg/get-curvature-at-interface.ts"],"names":[],"mappings":";AACA,iCAAiC;;;AAEjC,6CAAsC;AACtC,+CAAwD;AAIxD;;;;;GAKG;AACH,SAAS,uBAAuB,CAAC,KAAY;IAC5C,MAAM,EAAE,GAAG,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IAEjB,IAAI,GAAG,GAAG;QACT,KAAK,CAAC,EAAE;QACR,KAAK,CAAC,IAAI,CAAC,EAAE;KACb,CAAC;IAEF,IAAI,IAAI,GAAG;QACV,2BAAY,CAAC,qBAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAChC,2BAAY,CAAC,qBAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KAChC,CAAC;IAEF,kDAAkD;IAClD,IAAI,IAAI,GAAG,kBAAG,CAAG,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,IAAI,GAAG,oBAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IAEnB,IAAI,MAAM,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhC,OAAO,MAAM,CAAC;AACf,CAAC;AAuBQ,0DAAuB;AApBhC;;;;;;;;GAQG;AACH,SAAS,IAAI,CAAC,CAAS;IACtB,IAAI,CAAC,GAAG,CAAC,EAAE;QACV,OAAO,CAAC,CAAC;KACT;SAAM,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE;QAClB,OAAO,IAAI,CAAC,EAAE,CAAC;KACf;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Loop } from '../loop';
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
* Returns the max extreme point coordinate value for the given shape. This is
|
|
5
|
-
* used for floating point tolerance calculations.
|
|
6
|
-
* @param loops
|
|
7
|
-
*/
|
|
8
|
-
declare function getExtreme(loops: Loop[]): number;
|
|
9
|
-
export { getExtreme };
|
package/node/svg/get-extreme.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getExtreme = void 0;
|
|
4
|
-
const get_shape_bounds_1 = require("./get-shape-bounds");
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
* Returns the max extreme point coordinate value for the given shape. This is
|
|
8
|
-
* used for floating point tolerance calculations.
|
|
9
|
-
* @param loops
|
|
10
|
-
*/
|
|
11
|
-
function getExtreme(loops) {
|
|
12
|
-
let bounds = get_shape_bounds_1.getShapeBounds(loops);
|
|
13
|
-
return Math.max(Math.abs(bounds.minX.p[0]), Math.abs(bounds.minY.p[1]), Math.abs(bounds.maxX.p[0]), Math.abs(bounds.maxY.p[1]));
|
|
14
|
-
}
|
|
15
|
-
exports.getExtreme = getExtreme;
|
|
16
|
-
//# sourceMappingURL=get-extreme.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-extreme.js","sourceRoot":"","sources":["../../src/svg/get-extreme.ts"],"names":[],"mappings":";;;AAEA,yDAAoD;AAGpD;;;;;GAKG;AACH,SAAS,UAAU,CAAC,KAAa;IAChC,IAAI,MAAM,GAAG,iCAAc,CAAC,KAAK,CAAC,CAAC;IAEnC,OAAO,IAAI,CAAC,GAAG,CACb,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC1B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC1B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAC1B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC3B,CAAC;AACH,CAAC;AAGQ,gCAAU"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @hidden
|
|
3
|
-
* Returns true if the 2 given (closed) boxes intersect. At this stage we already
|
|
4
|
-
* know their x-axis intersect.
|
|
5
|
-
* @param a A rectangular box
|
|
6
|
-
* @param a Another rectangular box
|
|
7
|
-
* @param closed (defaults to true) Interpret boxes as being closed (i.e. they
|
|
8
|
-
* contain their border) or open.
|
|
9
|
-
*/
|
|
10
|
-
declare function areBoxesIntersecting(closed: boolean): (a: number[][], b: number[][]) => boolean;
|
|
11
|
-
export { areBoxesIntersecting };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.areBoxesIntersecting = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
* Returns true if the 2 given (closed) boxes intersect. At this stage we already
|
|
7
|
-
* know their x-axis intersect.
|
|
8
|
-
* @param a A rectangular box
|
|
9
|
-
* @param a Another rectangular box
|
|
10
|
-
* @param closed (defaults to true) Interpret boxes as being closed (i.e. they
|
|
11
|
-
* contain their border) or open.
|
|
12
|
-
*/
|
|
13
|
-
function areBoxesIntersecting(closed) {
|
|
14
|
-
return (a, b) => {
|
|
15
|
-
let [[ax0, ay0], [ax1, ay1]] = a;
|
|
16
|
-
let [[bx0, by0], [bx1, by1]] = b;
|
|
17
|
-
// Swap so smaller coordinate comes first
|
|
18
|
-
if (ay0 > ay1) {
|
|
19
|
-
[ay0, ay1] = [ay1, ay0];
|
|
20
|
-
}
|
|
21
|
-
;
|
|
22
|
-
if (by0 > by1) {
|
|
23
|
-
[by0, by1] = [by1, by0];
|
|
24
|
-
}
|
|
25
|
-
;
|
|
26
|
-
if (ax0 > ax1) {
|
|
27
|
-
[ax0, ax1] = [ax1, ax0];
|
|
28
|
-
}
|
|
29
|
-
;
|
|
30
|
-
if (bx0 > bx1) {
|
|
31
|
-
[bx0, bx1] = [bx1, bx0];
|
|
32
|
-
}
|
|
33
|
-
;
|
|
34
|
-
return closed
|
|
35
|
-
? (ax0 <= bx1 && ax1 >= bx0 &&
|
|
36
|
-
by0 <= ay1 && by1 >= ay0)
|
|
37
|
-
: (ax0 < bx1 && ax1 > bx0 &&
|
|
38
|
-
by0 < ay1 && by1 > ay0);
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
exports.areBoxesIntersecting = areBoxesIntersecting;
|
|
42
|
-
//# sourceMappingURL=are-boxes-intersecting.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"are-boxes-intersecting.js","sourceRoot":"","sources":["../../src/sweep-line/are-boxes-intersecting.ts"],"names":[],"mappings":";;;AACA;;;;;;;;GAQG;AACH,SAAS,oBAAoB,CAAC,MAAe;IACzC,OAAO,CAAC,CAAa,EAAE,CAAa,EAAE,EAAE;QAEpC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAEhC,yCAAyC;QACzC,IAAI,GAAG,GAAG,GAAG,EAAE;YAAE,CAAC,GAAG,EAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAC,GAAG,CAAC,CAAA;SAAE;QAAA,CAAC;QACzC,IAAI,GAAG,GAAG,GAAG,EAAE;YAAE,CAAC,GAAG,EAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAC,GAAG,CAAC,CAAA;SAAE;QAAA,CAAC;QACzC,IAAI,GAAG,GAAG,GAAG,EAAE;YAAE,CAAC,GAAG,EAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAC,GAAG,CAAC,CAAA;SAAE;QAAA,CAAC;QACzC,IAAI,GAAG,GAAG,GAAG,EAAE;YAAE,CAAC,GAAG,EAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAC,GAAG,CAAC,CAAA;SAAE;QAAA,CAAC;QAEzC,OAAO,MAAM;YACT,CAAC,CAAC,CACE,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG;gBACxB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,CAC3B;YACD,CAAC,CAAC,CACE,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG;gBACtB,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,CACzB,CAAA;IACT,CAAC,CAAA;AACL,CAAC;AAGQ,oDAAoB"}
|
package/test/mocha.opts
DELETED
package/webpack.config.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
entry: './src/index.ts',
|
|
6
|
-
mode: 'production',
|
|
7
|
-
module: {
|
|
8
|
-
rules: [
|
|
9
|
-
{
|
|
10
|
-
test: /\.tsx?$/,
|
|
11
|
-
use: 'ts-loader',
|
|
12
|
-
exclude: /node_modules/
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
resolve: {
|
|
17
|
-
extensions: [ '.tsx', '.ts', '.js', '.d.ts' ]
|
|
18
|
-
},
|
|
19
|
-
output: {
|
|
20
|
-
filename: 'index.min.js',
|
|
21
|
-
path: path.resolve(__dirname, 'browser'),
|
|
22
|
-
library: 'FloMat',
|
|
23
|
-
libraryTarget: 'var'
|
|
24
|
-
}
|
|
25
|
-
};
|