flo-mat 1.2.0 → 2.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/.mocharc.cjs +17 -0
- package/README.md +12 -1
- package/browser/index.js +7128 -0
- package/browser/index.min.js +2 -1
- package/browser/index.min.js.LICENSE.txt +2819 -0
- package/browser/index.module.js +7149 -0
- package/browser/index.module.min.js +2 -0
- package/browser/index.module.min.js.LICENSE.txt +2819 -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
package/tsconfig.json
CHANGED
|
@@ -5,44 +5,19 @@
|
|
|
5
5
|
"noImplicitThis": true,
|
|
6
6
|
"alwaysStrict": true,
|
|
7
7
|
"strictBindCallApply": true,
|
|
8
|
-
//"strictNullChecks": true,
|
|
9
8
|
"strictFunctionTypes": true,
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"target": "es2015",
|
|
9
|
+
"module": "es2020",
|
|
10
|
+
"target": "es2020",
|
|
13
11
|
"declaration": true,
|
|
14
12
|
"noEmitOnError": true,
|
|
15
13
|
"sourceMap": true,
|
|
16
|
-
"outDir": "node"
|
|
14
|
+
"outDir": "node",
|
|
15
|
+
"moduleResolution": "node"
|
|
17
16
|
},
|
|
18
17
|
"include": [
|
|
19
|
-
"src
|
|
18
|
+
"src/index.ts"
|
|
20
19
|
],
|
|
21
20
|
"exclude": [
|
|
22
21
|
"node_modules"
|
|
23
|
-
]
|
|
24
|
-
"typedocOptions": {
|
|
25
|
-
"mode": "modules",
|
|
26
|
-
"includeDeclarations": false,
|
|
27
|
-
"excludeExternals": true,
|
|
28
|
-
"exclude": [
|
|
29
|
-
"**/src/index.ts",
|
|
30
|
-
"**/src/cp-node/**/*",
|
|
31
|
-
"**/node_modules/**/*",
|
|
32
|
-
"**/src/debug/**/*",
|
|
33
|
-
"**/src/get-curve/**/*",
|
|
34
|
-
"**/src/loop/**/*",
|
|
35
|
-
"**/src/mat/**/*",
|
|
36
|
-
"**/src/svg/**/*",
|
|
37
|
-
"**/src/sweep-line/**/*",
|
|
38
|
-
"**/src/x/**/*",
|
|
39
|
-
"**/src/bounding-box/**/*",
|
|
40
|
-
],
|
|
41
|
-
"module" : "commonjs",
|
|
42
|
-
"target" : "es2015",
|
|
43
|
-
"name" : "FloMat",
|
|
44
|
-
"out" : "docs/html",
|
|
45
|
-
"includes" : "./src/docs",
|
|
46
|
-
"theme" : "./docs/theme",
|
|
47
|
-
}
|
|
22
|
+
]
|
|
48
23
|
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const CircularDependencyPlugin = require('circular-dependency-plugin');
|
|
3
|
+
const ResolveTypeScriptPlugin = require("resolve-typescript-plugin");
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
////////////////////////////////
|
|
7
|
+
const library = 'FloMat';
|
|
8
|
+
////////////////////////////////
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const extensions = [
|
|
12
|
+
'.js', '.mjs', '.cjs',
|
|
13
|
+
'.jsx', '.cjsx', '.mjsx'
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
const config_Basic = {
|
|
18
|
+
// mode: 'production',
|
|
19
|
+
mode: 'development',
|
|
20
|
+
entry: './src/index.ts',
|
|
21
|
+
resolve: {
|
|
22
|
+
extensions,
|
|
23
|
+
plugins: [
|
|
24
|
+
new ResolveTypeScriptPlugin({includeNodeModules: false})
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
module: {
|
|
28
|
+
rules: [
|
|
29
|
+
{
|
|
30
|
+
test: /\.tsx?$/,
|
|
31
|
+
use: 'ts-loader',
|
|
32
|
+
exclude: /node_modules/
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
stats: {
|
|
37
|
+
// Don't display most things
|
|
38
|
+
all: false,
|
|
39
|
+
colors: true,
|
|
40
|
+
errors: true,
|
|
41
|
+
builtAt: true
|
|
42
|
+
},
|
|
43
|
+
plugins: [
|
|
44
|
+
new CircularDependencyPlugin({
|
|
45
|
+
// exclude detection of files based on a RegExp
|
|
46
|
+
exclude: /node_modules/,
|
|
47
|
+
// add errors to webpack instead of warnings
|
|
48
|
+
failOnError: true,
|
|
49
|
+
// set the current working directory for displaying module paths
|
|
50
|
+
cwd: process.cwd(),
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
const lib = {
|
|
57
|
+
path: path.resolve(__dirname, 'browser'),
|
|
58
|
+
library,
|
|
59
|
+
libraryTarget: 'var'
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/** Global var library, minified */
|
|
64
|
+
const config_VarMinify = {
|
|
65
|
+
...config_Basic,
|
|
66
|
+
output: {
|
|
67
|
+
filename: 'index.min.js',
|
|
68
|
+
...lib
|
|
69
|
+
},
|
|
70
|
+
optimization: {
|
|
71
|
+
minimize: true
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
/** Global var library, not minified */
|
|
77
|
+
const config_VarNoMinify = {
|
|
78
|
+
...config_Basic,
|
|
79
|
+
output: {
|
|
80
|
+
filename: 'index.js',
|
|
81
|
+
...lib
|
|
82
|
+
},
|
|
83
|
+
optimization: {
|
|
84
|
+
minimize: false
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/** ESM, minified */
|
|
90
|
+
const config_EsmMinify = {
|
|
91
|
+
...config_Basic,
|
|
92
|
+
output: {
|
|
93
|
+
filename: 'index.module.min.js',
|
|
94
|
+
path: path.resolve(__dirname, 'browser'),
|
|
95
|
+
library: {
|
|
96
|
+
type: 'module'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
optimization: {
|
|
100
|
+
minimize: true
|
|
101
|
+
},
|
|
102
|
+
experiments: {
|
|
103
|
+
outputModule: true
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
/** ESM, not minified */
|
|
109
|
+
const config_EsmNoMinify = {
|
|
110
|
+
...config_Basic,
|
|
111
|
+
output: {
|
|
112
|
+
filename: 'index.module.js',
|
|
113
|
+
path: path.resolve(__dirname, 'browser'),
|
|
114
|
+
library: {
|
|
115
|
+
type: 'module'
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
optimization: {
|
|
119
|
+
minimize: false
|
|
120
|
+
},
|
|
121
|
+
experiments: {
|
|
122
|
+
outputModule: true
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
module.exports = [
|
|
128
|
+
config_VarMinify,
|
|
129
|
+
config_VarNoMinify,
|
|
130
|
+
config_EsmMinify,
|
|
131
|
+
config_EsmNoMinify
|
|
132
|
+
];
|
package/.nycrc
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CpNode } from '../cp-node';
|
|
2
|
-
import { ContactPoint } from '../contact-point';
|
|
3
|
-
/**
|
|
4
|
-
* @hidden
|
|
5
|
-
* Note: For debugging only
|
|
6
|
-
* Checks the position of the ContactPoint (cp) on the boundary piece.
|
|
7
|
-
* Returns < 0 if the cp is not on δ, > 0 if it is on the boundary piece
|
|
8
|
-
* excluding the endpoints and 0 if it is on the endpoints. Also returns > 0 if
|
|
9
|
-
* δ === undefined.
|
|
10
|
-
* @param δ The boundary piece
|
|
11
|
-
* @param cp The contact point
|
|
12
|
-
*/
|
|
13
|
-
declare function cmpCpOnδ(δ: CpNode[], cp: ContactPoint): 1 | 0 | -1;
|
|
14
|
-
export { cmpCpOnδ };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cmpCpOnδ = void 0;
|
|
4
|
-
const contact_point_1 = require("../contact-point");
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
* Note: For debugging only
|
|
8
|
-
* Checks the position of the ContactPoint (cp) on the boundary piece.
|
|
9
|
-
* Returns < 0 if the cp is not on δ, > 0 if it is on the boundary piece
|
|
10
|
-
* excluding the endpoints and 0 if it is on the endpoints. Also returns > 0 if
|
|
11
|
-
* δ === undefined.
|
|
12
|
-
* @param δ The boundary piece
|
|
13
|
-
* @param cp The contact point
|
|
14
|
-
*/
|
|
15
|
-
function cmpCpOnδ(δ, cp) {
|
|
16
|
-
if (δ[0] === undefined) {
|
|
17
|
-
return 1;
|
|
18
|
-
}
|
|
19
|
-
let cpBef = δ[0].cp;
|
|
20
|
-
let cpAft = δ[1].cp;
|
|
21
|
-
let cmp = contact_point_1.compareCps(cpBef, cpAft);
|
|
22
|
-
let cmpPrev = contact_point_1.compareCps(cpBef, cp);
|
|
23
|
-
let cmpNext = contact_point_1.compareCps(cp, cpAft);
|
|
24
|
-
if (cmp < 0) {
|
|
25
|
-
if (cmpPrev > 0 || cmpNext > 0) {
|
|
26
|
-
console.log(`2-PRONG (antipode) Order is wrong - cmpPrev and cmpNext should be > 0; cmp: ${cmp}, cmpPrev: ${cmpPrev}, cmpNext ${cmpNext}`);
|
|
27
|
-
//_debug_.fs.draw.dot(cp.pointOnShape.p, 1, "blue");
|
|
28
|
-
return -1;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
else if (cmp > 0) {
|
|
32
|
-
if (cmpPrev > 0 && cmpNext > 0) {
|
|
33
|
-
console.log(`2-PRONG (antipode) Order is wrong: ${cmpPrev}, ${cmpNext}`);
|
|
34
|
-
//_debug_.fs.draw.dot(cp.pointOnShape.p, 1, "blue");
|
|
35
|
-
return -1;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (cmpPrev === 0 || cmpNext === 0) {
|
|
39
|
-
console.log('2-PRONG orders are equal.');
|
|
40
|
-
return 0;
|
|
41
|
-
}
|
|
42
|
-
return 1;
|
|
43
|
-
}
|
|
44
|
-
exports.cmpCpOnδ = cmpCpOnδ;
|
|
45
|
-
//# sourceMappingURL=cmp-cp-on-delta.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cmp-cp-on-delta.js","sourceRoot":"","sources":["../../src/mat/cmp-cp-on-delta.ts"],"names":[],"mappings":";;;AAEA,oDAA4D;AAG5D;;;;;;;;;GASG;AACH,SAAS,QAAQ,CACT,CAAW,EACX,EAAgB;IAEpB,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE;QACpB,OAAO,CAAC,CAAC;KACZ;IAED,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACpB,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEpB,IAAI,GAAG,GAAO,0BAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACvC,IAAI,OAAO,GAAG,0BAAU,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACpC,IAAI,OAAO,GAAG,0BAAU,CAAC,EAAE,EAAK,KAAK,CAAC,CAAC;IAEvC,IAAI,GAAG,GAAG,CAAC,EAAE;QACT,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE;YAC5B,OAAO,CAAC,GAAG,CAAC,+EAA+E,GAAG,cAAc,OAAO,aAAa,OAAO,EAAE,CAAC,CAAC;YAC3I,oDAAoD;YACpD,OAAO,CAAC,CAAC,CAAC;SACb;KACJ;SAAM,IAAI,GAAG,GAAG,CAAC,EAAE;QAChB,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE;YAC5B,OAAO,CAAC,GAAG,CAAC,sCAAsC,OAAO,KAAK,OAAO,EAAE,CAAC,CAAC;YACzE,oDAAoD;YACpD,OAAO,CAAC,CAAC,CAAC;SACb;KACJ;IAED,IAAI,OAAO,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,EAAE;QAChC,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;QACzC,OAAO,CAAC,CAAC;KACZ;IAED,OAAO,CAAC,CAAC;AACb,CAAC;AAGQ,4BAAQ"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTotalAbsoluteCurvature = void 0;
|
|
4
|
-
const flo_bezier3_1 = require("flo-bezier3");
|
|
5
|
-
const get_curvature_at_interface_1 = require("../../svg/get-curvature-at-interface");
|
|
6
|
-
const get_total_by_1 = require("./get-total-by");
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
*/
|
|
10
|
-
let getTotalAbsoluteCurvature = get_total_by_1.getTotalBy(curve => (flo_bezier3_1.totalAbsoluteCurvature(curve.ps, [0, 1]) +
|
|
11
|
-
Math.abs(get_curvature_at_interface_1.getCurvatureAtInterface(curve))));
|
|
12
|
-
exports.getTotalAbsoluteCurvature = getTotalAbsoluteCurvature;
|
|
13
|
-
//# sourceMappingURL=get-total-abs-curvature.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-total-abs-curvature.js","sourceRoot":"","sources":["../../../src/mat/find-mat/get-total-abs-curvature.ts"],"names":[],"mappings":";;;AACA,6CAAqD;AACrD,qFAA+E;AAC/E,iDAA4C;AAG5C;;GAEG;AACH,IAAI,yBAAyB,GAAG,yBAAU,CACtC,KAAK,CAAC,EAAE,CAAC,CACL,oCAAsB,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IACvC,IAAI,CAAC,GAAG,CAAC,oDAAuB,CAAC,KAAK,CAAC,CAAC,CAC3C,CACJ,CAAC;AAGO,8DAAyB"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTotalBy = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
* Helper function.
|
|
7
|
-
* @hidden
|
|
8
|
-
* @param f
|
|
9
|
-
*/
|
|
10
|
-
function getTotalBy(f) {
|
|
11
|
-
return function (loop) {
|
|
12
|
-
let node = loop.curves[0];
|
|
13
|
-
let total = 0;
|
|
14
|
-
do {
|
|
15
|
-
total += f(node);
|
|
16
|
-
node = node.next;
|
|
17
|
-
} while (node !== loop.curves[0]);
|
|
18
|
-
return total;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
exports.getTotalBy = getTotalBy;
|
|
22
|
-
//# sourceMappingURL=get-total-by.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-total-by.js","sourceRoot":"","sources":["../../../src/mat/find-mat/get-total-by.ts"],"names":[],"mappings":";;;AAKA;;;;;GAKG;AACH,SAAS,UAAU,CAAC,CAA2B;IAE9C,OAAO,UAAS,IAAU;QACzB,IAAI,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,GAAG;YACF,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;YAEjB,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACjB,QAAQ,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;QAElC,OAAO,KAAK,CAAC;IACd,CAAC,CAAA;AACF,CAAC;AAGQ,gCAAU"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEdgesAsArray = void 0;
|
|
4
|
-
const traverse_edges_1 = require("../traverse-edges");
|
|
5
|
-
/** @hidden */
|
|
6
|
-
function getEdgesAsArray(cpNode) {
|
|
7
|
-
let cpNodes = [];
|
|
8
|
-
traverse_edges_1.traverseEdges(cpNode, function (cpNode) { cpNodes.push(cpNode); });
|
|
9
|
-
return cpNodes;
|
|
10
|
-
}
|
|
11
|
-
exports.getEdgesAsArray = getEdgesAsArray;
|
|
12
|
-
//# sourceMappingURL=get-edges-as-array.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-edges-as-array.js","sourceRoot":"","sources":["../../src/mat/get-edges-as-array.ts"],"names":[],"mappings":";;;AAEA,sDAAkD;AAGlD,cAAc;AACd,SAAS,eAAe,CAAC,MAAc;IACtC,IAAI,OAAO,GAAa,EAAE,CAAC;IAE3B,8BAAa,CACZ,MAAM,EACN,UAAS,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA,CAAC,CAAC,CACzC,CAAC;IAEF,OAAO,OAAO,CAAC;AAChB,CAAC;AAGQ,0CAAe"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLargestThreeProng = void 0;
|
|
4
|
-
/** @hidden */
|
|
5
|
-
function getLargestThreeProng(cpNodes) {
|
|
6
|
-
return cpNodes.reduce(function (maxCpNode, cpNode) {
|
|
7
|
-
return cpNode === undefined || maxCpNode.cp.circle.radius >= cpNode.cp.circle.radius
|
|
8
|
-
? maxCpNode
|
|
9
|
-
: cpNode;
|
|
10
|
-
}, undefined);
|
|
11
|
-
}
|
|
12
|
-
exports.getLargestThreeProng = getLargestThreeProng;
|
|
13
|
-
//# sourceMappingURL=get-largest-three-prong.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-largest-three-prong.js","sourceRoot":"","sources":["../../src/mat/get-largest-three-prong.ts"],"names":[],"mappings":";;;AAIA,cAAc;AACd,SAAS,oBAAoB,CAAC,OAAiB;IAC9C,OAAO,OAAO,CAAC,MAAM,CAAC,UAAS,SAAiB,EAAE,MAAc;QAC/D,OAAO,MAAM,KAAK,SAAS,IAAI,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM;YACnF,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,MAAM,CAAC;IACX,CAAC,EAAE,SAAS,CAAC,CAAC;AACf,CAAC;AAGQ,oDAAoB"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Circle } from '../../circle';
|
|
2
|
-
import { TTree } from './t-tree';
|
|
3
|
-
/**
|
|
4
|
-
* @hidden
|
|
5
|
-
* @param s
|
|
6
|
-
* @param tree
|
|
7
|
-
* @param coordinate
|
|
8
|
-
* @param limits
|
|
9
|
-
* @param circle
|
|
10
|
-
* @param depth
|
|
11
|
-
*/
|
|
12
|
-
declare function addToTree(s: number, tree: TTree, coordinate: number, limits: number[][], circle: Circle, depth: number): void;
|
|
13
|
-
export { addToTree };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addToTree = void 0;
|
|
4
|
-
const calc_groups_1 = require("./calc-groups");
|
|
5
|
-
// DEPTH_LIMIT can be anything from 1 to 16, but from 2 to 6 seem to be the
|
|
6
|
-
// fastest.
|
|
7
|
-
/** @hidden */
|
|
8
|
-
const DEPTH_LIMIT = 6;
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
* @param s
|
|
12
|
-
* @param tree
|
|
13
|
-
* @param coordinate
|
|
14
|
-
* @param limits
|
|
15
|
-
* @param circle
|
|
16
|
-
* @param depth
|
|
17
|
-
*/
|
|
18
|
-
function addToTree(s, tree, coordinate, limits, circle, depth) {
|
|
19
|
-
let { groups, newLimits } = calc_groups_1.calcGroups(s, coordinate, limits, circle);
|
|
20
|
-
// Create new edge if it does not exist yet.
|
|
21
|
-
if (groups.length === 1 && depth !== DEPTH_LIMIT) {
|
|
22
|
-
let group = groups[0];
|
|
23
|
-
if (!tree.trees.get(group)) {
|
|
24
|
-
tree.trees.set(group, { trees: new Map(), circles: new Set() });
|
|
25
|
-
}
|
|
26
|
-
let t = tree.trees.get(group);
|
|
27
|
-
// Flip coordinates
|
|
28
|
-
let newCoordinate = coordinate ? 0 : 1;
|
|
29
|
-
addToTree(s, t, newCoordinate, newLimits, circle, depth + 1);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (!tree.trees.get(5)) {
|
|
33
|
-
tree.trees.set(5, { trees: new Map(), circles: new Set() });
|
|
34
|
-
}
|
|
35
|
-
let vertices = tree.trees.get(5).circles;
|
|
36
|
-
vertices.add(circle);
|
|
37
|
-
}
|
|
38
|
-
exports.addToTree = addToTree;
|
|
39
|
-
//# sourceMappingURL=add-to-tree.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-to-tree.js","sourceRoot":"","sources":["../../../src/mat/to-scale-axis/add-to-tree.ts"],"names":[],"mappings":";;;AAEA,+CAA2C;AAI3C,4EAA4E;AAC5E,WAAW;AACX,cAAc;AACd,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB;;;;;;;;GAQG;AACH,SAAS,SAAS,CACd,CAAS,EACT,IAAW,EACX,UAAkB,EAClB,MAAkB,EAClB,MAAc,EACd,KAAa;IAEb,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,wBAAU,CAClC,CAAC,EACD,UAAU,EACV,MAAM,EACN,MAAM,CACT,CAAC;IAEF,4CAA4C;IAC5C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,KAAK,WAAW,EAAE;QAC9C,IAAI,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAEtB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YACxB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,CAAE,CAAC;SACpE;QACD,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAE9B,mBAAmB;QACnB,IAAI,aAAa,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,SAAS,CACL,CAAC,EACD,CAAC,EACD,aAAa,EACb,SAAS,EACT,MAAM,EACN,KAAK,GAAC,CAAC,CACV,CAAC;QAEF,OAAO;KACV;IAED,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QACpB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,CAAE,CAAC;KAChE;IACD,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IACzC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACzB,CAAC;AAGQ,8BAAS"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Circle } from '../../circle';
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
* Spacially divide into 5 special groups as follows:
|
|
5
|
-
*
|
|
6
|
-
* *******||*******|*******|*******|*******||*******
|
|
7
|
-
* 0 <--------------->
|
|
8
|
-
* 1 <--------------->
|
|
9
|
-
* 2 <--------------->
|
|
10
|
-
* 3 <--------------->
|
|
11
|
-
* 4 <--------------->
|
|
12
|
-
* 5 - If the circle does not fall in any of above 5 groups.
|
|
13
|
-
*
|
|
14
|
-
* Note: In the above, the double pipes denote the limits for
|
|
15
|
-
* a coordinate, so as can be seen groups 0 and 4 go outside
|
|
16
|
-
* the limits. Also, groups 1 and 3 are preferred and checked
|
|
17
|
-
* first.
|
|
18
|
-
*
|
|
19
|
-
* @param s Scale parameter, e.g. 1.1
|
|
20
|
-
* @param coordinate - 0 -> horizontal or 1 -> vertical.
|
|
21
|
-
* @param limits - The limits within which the circle bounds can fall.
|
|
22
|
-
* @param circle - The circle to categorize into a group.
|
|
23
|
-
*/
|
|
24
|
-
declare function calcGroups(s: number, coordinate: number, limits: number[][], circle: Circle): {
|
|
25
|
-
groups: number[];
|
|
26
|
-
newLimits: number[][];
|
|
27
|
-
};
|
|
28
|
-
export { calcGroups };
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calcGroups = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
* Spacially divide into 5 special groups as follows:
|
|
7
|
-
*
|
|
8
|
-
* *******||*******|*******|*******|*******||*******
|
|
9
|
-
* 0 <--------------->
|
|
10
|
-
* 1 <--------------->
|
|
11
|
-
* 2 <--------------->
|
|
12
|
-
* 3 <--------------->
|
|
13
|
-
* 4 <--------------->
|
|
14
|
-
* 5 - If the circle does not fall in any of above 5 groups.
|
|
15
|
-
*
|
|
16
|
-
* Note: In the above, the double pipes denote the limits for
|
|
17
|
-
* a coordinate, so as can be seen groups 0 and 4 go outside
|
|
18
|
-
* the limits. Also, groups 1 and 3 are preferred and checked
|
|
19
|
-
* first.
|
|
20
|
-
*
|
|
21
|
-
* @param s Scale parameter, e.g. 1.1
|
|
22
|
-
* @param coordinate - 0 -> horizontal or 1 -> vertical.
|
|
23
|
-
* @param limits - The limits within which the circle bounds can fall.
|
|
24
|
-
* @param circle - The circle to categorize into a group.
|
|
25
|
-
*/
|
|
26
|
-
function calcGroups(s, coordinate, limits, circle) {
|
|
27
|
-
let limit = limits[coordinate];
|
|
28
|
-
let l1 = limit[0];
|
|
29
|
-
let l2 = limit[1];
|
|
30
|
-
// Relevant cut-off lines.
|
|
31
|
-
let q = (l2 - l1) / 4;
|
|
32
|
-
let w = q + q;
|
|
33
|
-
// Shift origin
|
|
34
|
-
let r = circle.radius;
|
|
35
|
-
let x = circle.center[coordinate] - l1;
|
|
36
|
-
let x0 = x - (r * s);
|
|
37
|
-
let x1 = x + (r * s);
|
|
38
|
-
let newLimit = [,];
|
|
39
|
-
let groups = []; // Group to which circle belongs;
|
|
40
|
-
let qStart = Math.floor(x0 / q);
|
|
41
|
-
let qEnd = Math.floor(x1 / q) + 1;
|
|
42
|
-
let qDiff = qEnd - qStart;
|
|
43
|
-
let group;
|
|
44
|
-
if (qDiff === 1) {
|
|
45
|
-
// If contained in sliver.
|
|
46
|
-
group = (2 * Math.floor(qStart / 2)) + 1;
|
|
47
|
-
groups.push(group);
|
|
48
|
-
let lowerLimit = l1 + q * (group - 1);
|
|
49
|
-
newLimit = [lowerLimit, lowerLimit + w];
|
|
50
|
-
}
|
|
51
|
-
else if (qDiff === 2) {
|
|
52
|
-
group = qStart + 1;
|
|
53
|
-
groups.push(group);
|
|
54
|
-
let lowerLimit = l1 + q * (group - 1);
|
|
55
|
-
newLimit = [lowerLimit, lowerLimit + w];
|
|
56
|
-
}
|
|
57
|
-
let newLimits = [,];
|
|
58
|
-
if (groups.length === 1) {
|
|
59
|
-
let otherCoordinate = coordinate ? 0 : 1;
|
|
60
|
-
newLimits[otherCoordinate] = limits[otherCoordinate];
|
|
61
|
-
newLimits[coordinate] = newLimit;
|
|
62
|
-
}
|
|
63
|
-
return { groups, newLimits };
|
|
64
|
-
}
|
|
65
|
-
exports.calcGroups = calcGroups;
|
|
66
|
-
//# sourceMappingURL=calc-groups.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"calc-groups.js","sourceRoot":"","sources":["../../../src/mat/to-scale-axis/calc-groups.ts"],"names":[],"mappings":";;;AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAS,UAAU,CACX,CAAS,EACT,UAAkB,EAClB,MAAkB,EAClB,MAAc;IAElB,IAAI,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IAC/B,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAClB,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAElB,0BAA0B;IAC1B,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACtB,IAAI,CAAC,GAAG,CAAC,GAAC,CAAC,CAAC;IAEZ,eAAe;IACf,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;IACtB,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;IACvC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAErB,IAAI,QAAQ,GAAa,CAAC,EAAE,CAAC;IAC7B,IAAI,MAAM,GAAG,EAAE,CAAC,CAAC,iCAAiC;IAElD,IAAI,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAC,CAAC,CAAC,CAAC;IAC9B,IAAI,IAAI,GAAK,IAAI,CAAC,KAAK,CAAC,EAAE,GAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,KAAK,GAAI,IAAI,GAAG,MAAM,CAAC;IAE3B,IAAI,KAAK,CAAC;IACV,IAAI,KAAK,KAAK,CAAC,EAAE;QACb,0BAA0B;QAC1B,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACvC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEnB,IAAI,UAAU,GAAG,EAAE,GAAG,CAAC,GAAC,CAAC,KAAK,GAAC,CAAC,CAAC,CAAC;QAClC,QAAQ,GAAG,CAAC,UAAU,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;KAE3C;SAAM,IAAI,KAAK,KAAK,CAAC,EAAE;QACpB,KAAK,GAAG,MAAM,GAAG,CAAC,CAAC;QACnB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAEnB,IAAI,UAAU,GAAG,EAAE,GAAG,CAAC,GAAC,CAAC,KAAK,GAAC,CAAC,CAAC,CAAC;QAClC,QAAQ,GAAG,CAAC,UAAU,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;KAC3C;IAED,IAAI,SAAS,GAAe,CAAC,EAAE,CAAC;IAChC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,IAAI,eAAe,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEzC,SAAS,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;QACrD,SAAS,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC;KACpC;IAED,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AACjC,CAAC;AAGQ,gCAAU"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createSpacialTree = void 0;
|
|
4
|
-
const add_to_tree_1 = require("./add-to-tree");
|
|
5
|
-
/** @hidden */
|
|
6
|
-
const width = 1620; // TODO change to actual shape coordinates
|
|
7
|
-
/** @hidden */
|
|
8
|
-
const height = 1560; // ...
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
* @param s
|
|
12
|
-
* @param circles
|
|
13
|
-
*/
|
|
14
|
-
function createSpacialTree(s, circles) {
|
|
15
|
-
let coordinate = 0;
|
|
16
|
-
let limits = [[0, width], [0, height]];
|
|
17
|
-
let tree = { trees: new Map(), circles: new Set() };
|
|
18
|
-
for (let circle of circles) {
|
|
19
|
-
add_to_tree_1.addToTree(s, tree, coordinate, limits, circle, 0);
|
|
20
|
-
}
|
|
21
|
-
return tree;
|
|
22
|
-
}
|
|
23
|
-
exports.createSpacialTree = createSpacialTree;
|
|
24
|
-
//# sourceMappingURL=create-spacial-tree.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-spacial-tree.js","sourceRoot":"","sources":["../../../src/mat/to-scale-axis/create-spacial-tree.ts"],"names":[],"mappings":";;;AAGA,+CAA0C;AAG1C,cAAc;AACd,MAAM,KAAK,GAAI,IAAI,CAAC,CAAC,0CAA0C;AAC/D,cAAc;AACd,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,MAAM;AAG3B;;;;GAIG;AACH,SAAS,iBAAiB,CAClB,CAAS,EACT,OAAiB;IAErB,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IAEvC,IAAI,IAAI,GAAU,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;IAE3D,KAAK,IAAI,MAAM,IAAI,OAAO,EAAE;QACxB,uBAAS,CACD,CAAC,EACD,IAAI,EACJ,UAAU,EACV,MAAM,EACN,MAAM,EACN,CAAC,CACR,CAAC;KACL;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAGQ,8CAAiB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Circle } from '../../circle';
|
|
2
|
-
import { TTree } from './t-tree';
|
|
3
|
-
/**
|
|
4
|
-
* @hidden
|
|
5
|
-
* Returns a map of engulfed MAT nodes determined to be engulfed by the given
|
|
6
|
-
* test node and scale factor and starting from the given spacial tree node.
|
|
7
|
-
* @param s The scale factor
|
|
8
|
-
* @param tree The spacial tree node from where to start
|
|
9
|
-
* @param circle The circle potentially engulfing other nodes
|
|
10
|
-
*/
|
|
11
|
-
declare function getEngulfedVertices(s: number, tree: TTree, circle: Circle): Set<Circle>;
|
|
12
|
-
export { getEngulfedVertices };
|