flo-mat 1.1.2 → 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 +13 -2
- 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.d.ts +1 -4
- package/node/circle.js +3 -6
- 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 -5
- package/node/contact-point.js.map +1 -1
- package/node/cp-node/clone.d.ts +1 -1
- package/node/cp-node/clone.js +4 -6
- 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 -3
- package/node/cp-node/remove.js.map +1 -1
- package/node/cp-node.d.ts +4 -5
- package/node/cp-node.js +8 -11
- package/node/cp-node.js.map +1 -1
- package/node/curve.d.ts +2 -2
- package/node/curve.js +10 -13
- 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 -9
- package/node/debug/debug.js.map +1 -1
- package/node/debug/functions/draw-elem/bounding-hull.js +3 -5
- 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 -7
- 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 -3
- package/node/debug/functions/draw-elem/culls.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.js +1 -3
- 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 -36
- 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 -6
- 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 -5
- 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 -3
- 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 -3
- package/node/debug/functions/draw-elem/loops.js.map +1 -1
- package/node/debug/functions/draw-elem/loose-bounding-box.js +3 -5
- 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 -9
- 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 -5
- 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 -11
- 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 -9
- 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 -11
- 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 -5
- 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 -11
- package/node/debug/functions/draw-elem/three-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/tight-bounding-box.js +3 -5
- 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 -11
- 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 -9
- 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 -5
- package/node/debug/functions/general.js.map +1 -1
- package/node/debug/functions/three-prong.js +24 -26
- 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 -12
- 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 -6
- 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 -52
- package/node/find-mats.js.map +1 -1
- package/node/get-boundary-bezier-parts-to-next.d.ts +3 -5
- package/node/get-boundary-bezier-parts-to-next.js +1 -3
- 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 -7
- 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 -9
- 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 -23
- 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 -14
- 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 -5
- 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 -55
- package/node/index.js.map +1 -1
- package/node/loop/get-max-coordinate.js +1 -3
- package/node/loop/get-max-coordinate.js.map +1 -1
- package/node/loop.d.ts +1 -1
- package/node/loop.js +1 -3
- 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 -7
- 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 -13
- 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 -9
- 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 -7
- 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 -7
- 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 -8
- 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 -11
- 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 -12
- 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 -6
- 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 -11
- 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 -21
- 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 -9
- 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 -12
- 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 -15
- 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 -8
- 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 -5
- 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 -7
- 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 -38
- 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 -3
- 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 -9
- 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 -12
- 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 -7
- 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 -31
- 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 -11
- 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 -5
- 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 -5
- 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 -11
- 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 -10
- 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 -13
- 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 -5
- 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 -5
- package/node/mat/find-mat/get-sharp-corners.js.map +1 -1
- package/node/mat/geometry/get-closest-square-distance-to-rect.js +21 -14
- 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 -7
- 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 -8
- 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 -9
- 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 -3
- 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 -3
- 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 -7
- 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 -3
- 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 -10
- 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 -13
- 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 -3
- 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 -7
- 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 -7
- 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 -8
- 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 -33
- package/node/point-on-shape.js.map +1 -1
- package/node/simplify-mat.d.ts +4 -3
- package/node/simplify-mat.js +16 -37
- 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 -12
- 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 -5
- 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 -7
- package/node/svg/get-shape-bounds.js.map +1 -1
- package/node/sweep-line/sweep-line.js +1 -3
- 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 -20
- package/node/to-scale-axis.js.map +1 -1
- package/node/traverse-edges.d.ts +1 -1
- package/node/traverse-edges.js +1 -3
- package/node/traverse-edges.js.map +1 -1
- package/node/traverse-vertices.d.ts +1 -1
- package/node/traverse-vertices.js +1 -3
- package/node/traverse-vertices.js.map +1 -1
- package/package.json +34 -30
- package/src/circle.ts +1 -2
- 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 -5
- 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 +15 -41
- 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 -44
- 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 -12
- 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 -21
- 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 -11
- 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 -12
- 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 -38
- 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 -65
- 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 -23
- 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 -94
- 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 -24
- 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 -48
- 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 -15
- 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 -41
- package/node/sweep-line/are-boxes-intersecting.js.map +0 -1
- package/test/mocha.opts +0 -4
- package/webpack.config.js +0 -25
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const find_3_prong_1 = require("./find-3-prong/find-3-prong");
|
|
5
|
-
const add_3_prong_1 = require("../find-mat/add-3-prong");
|
|
1
|
+
import { calcPosOrder, isPosSharpCorner } from '../../point-on-shape.js';
|
|
2
|
+
import { find3Prong } from './find-3-prong/find-3-prong.js';
|
|
3
|
+
import { add3Prong } from '../find-mat/add-3-prong.js';
|
|
6
4
|
/**
|
|
7
5
|
* @hidden
|
|
8
6
|
* Finds and adds all 3-prongs.
|
|
@@ -21,7 +19,7 @@ function findAndAddAll3Prongs(cpGraphs, cpStart, extreme) {
|
|
|
21
19
|
markEdgeAsTaken(visitedEdges, fromCpNode, cpStart);
|
|
22
20
|
for (let cpNode of cpStart.getCpNodesOnCircle()) {
|
|
23
21
|
//if (!PointOnShape.isSharpCorner(cpNode.cp.pointOnShape)) {
|
|
24
|
-
if (!
|
|
22
|
+
if (!isPosSharpCorner(cpNode.cp.pointOnShape)) {
|
|
25
23
|
if (findAndAdd3Prongs(cpGraphs, cpNode, extreme) === undefined) {
|
|
26
24
|
return; // only for debugging purposes
|
|
27
25
|
}
|
|
@@ -34,7 +32,6 @@ function findAndAddAll3Prongs(cpGraphs, cpStart, extreme) {
|
|
|
34
32
|
}
|
|
35
33
|
}
|
|
36
34
|
}
|
|
37
|
-
exports.findAndAddAll3Prongs = findAndAddAll3Prongs;
|
|
38
35
|
/**
|
|
39
36
|
* @hidden
|
|
40
37
|
* Marks the given edge as already taken.
|
|
@@ -127,14 +124,14 @@ function findAndAdd3Prong(cpGraphs, visitedCps, extreme) {
|
|
|
127
124
|
for (let visitedCp of visitedCps) {
|
|
128
125
|
δs.push([visitedCp, visitedCp.next]);
|
|
129
126
|
}
|
|
130
|
-
let threeProng =
|
|
127
|
+
let threeProng = find3Prong(δs, extreme);
|
|
131
128
|
let orders = [];
|
|
132
129
|
for (let i = 0; i < 3; i++) {
|
|
133
130
|
orders.push(
|
|
134
131
|
//PointOnShape.calcOrder(threeProng.circle, threeProng.ps[i])
|
|
135
|
-
|
|
132
|
+
calcPosOrder(threeProng.circle, threeProng.ps[i]));
|
|
136
133
|
}
|
|
137
|
-
let circle =
|
|
134
|
+
let circle = add3Prong(cpGraphs, orders, threeProng);
|
|
138
135
|
if (typeof _debug_ !== 'undefined') {
|
|
139
136
|
add3ProngDebugInfo(circle, visitedCps);
|
|
140
137
|
}
|
|
@@ -147,4 +144,5 @@ function add3ProngDebugInfo(circle, visitedCps) {
|
|
|
147
144
|
data.visitedCps = visitedCps;
|
|
148
145
|
data.circle = circle;
|
|
149
146
|
}
|
|
147
|
+
export { findAndAddAll3Prongs };
|
|
150
148
|
//# sourceMappingURL=find-and-add-3-prongs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-and-add-3-prongs.js","sourceRoot":"","sources":["../../../src/mat/find-mat/find-and-add-3-prongs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"find-and-add-3-prongs.js","sourceRoot":"","sources":["../../../src/mat/find-mat/find-and-add-3-prongs.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAG,MAAM,4BAA4B,CAAC;AAGxD;;;;;;;GAOG;AACH,SAAS,oBAAoB,CAC3B,QAAqC,EACrC,OAAiB,EACjB,OAAiB;IAElB,2EAA2E;IAC3E,oCAAoC;IAEpC,IAAI,Y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;KACvC;AACF,CAAC;AAGD,cAAc;AACd,SAAS,kBAAkB,CACzB,MAAc,EACd,UAAoB;IAErB,IAAI,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC;IACrD,IAAI,GAAG,GAAG,WAAW,CAAC,MAAM,CAAC;IAC7B,IAAI,IAAI,GAAG,WAAW,CAAC,GAAG,GAAC,CAAC,CAAC,CAAC;IAC9B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC7B,IAAI,CAAC,MAAM,GAAO,MAAM,CAAC;AAC1B,CAAC;AAGD,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import LlRbTree from 'flo-ll-rb-tree';
|
|
2
|
-
import { Loop } from
|
|
3
|
-
import { CpNode } from '../../cp-node';
|
|
1
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
+
import { Loop } from '../../loop.js';
|
|
3
|
+
import { CpNode } from '../../cp-node.js';
|
|
4
4
|
/**
|
|
5
5
|
* @hidden
|
|
6
6
|
* Find and add two-prongs that remove any holes in the shape.
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const find_2_prong_1 = require("./find-2-prong/find-2-prong");
|
|
6
|
-
const add_2_prong_1 = require("./add-2-prong");
|
|
1
|
+
import { getShapeBounds } from '../../svg/get-shape-bounds.js';
|
|
2
|
+
import { getMinYPos } from '../../svg/get-min-y-pos.js';
|
|
3
|
+
import { find2Prong } from './find-2-prong/find-2-prong.js';
|
|
4
|
+
import { add2Prong } from './add-2-prong.js';
|
|
7
5
|
/**
|
|
8
6
|
* @hidden
|
|
9
7
|
* Find and add two-prongs that remove any holes in the shape.
|
|
@@ -14,23 +12,23 @@ const add_2_prong_1 = require("./add-2-prong");
|
|
|
14
12
|
* tolerances.
|
|
15
13
|
*/
|
|
16
14
|
function findAndAddHoleClosing2Prongs(loops, cpTrees, extreme) {
|
|
17
|
-
let bounds =
|
|
18
|
-
let squaredDiagonalLength =
|
|
19
|
-
|
|
15
|
+
let bounds = getShapeBounds(loops);
|
|
16
|
+
let squaredDiagonalLength = (bounds.maxX.p[0] - bounds.minX.p[0]) ** 2 +
|
|
17
|
+
(bounds.maxY.p[1] - bounds.minY.p[1]) ** 2;
|
|
20
18
|
// Find the topmost points on each loop.
|
|
21
|
-
let minYs = loops.map(
|
|
19
|
+
let minYs = loops.map(getMinYPos);
|
|
22
20
|
// We start at 1 since 0 is the outer (root) loop
|
|
23
21
|
for (let k = 1; k < minYs.length; k++) {
|
|
24
22
|
let posSource = minYs[k];
|
|
25
|
-
let holeClosingTwoProng =
|
|
23
|
+
let holeClosingTwoProng = find2Prong(loops, extreme, squaredDiagonalLength, cpTrees, posSource, true, k);
|
|
26
24
|
if (!holeClosingTwoProng) {
|
|
27
25
|
throw new Error(`Unable to find hole-closing 2-prong`);
|
|
28
26
|
}
|
|
29
27
|
// TODO important - handle case of n-prong, i.e. more than one antipode
|
|
30
28
|
// - currently we only handle case of single antipode (the general case)
|
|
31
29
|
let { circle, zs: posAntipodes } = holeClosingTwoProng;
|
|
32
|
-
|
|
30
|
+
add2Prong(cpTrees, circle, posSource, [posAntipodes[0]], true, extreme);
|
|
33
31
|
}
|
|
34
32
|
}
|
|
35
|
-
|
|
33
|
+
export { findAndAddHoleClosing2Prongs };
|
|
36
34
|
//# sourceMappingURL=find-and-add-hole-closing-2-prongs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-and-add-hole-closing-2-prongs.js","sourceRoot":"","sources":["../../../src/mat/find-mat/find-and-add-hole-closing-2-prongs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"find-and-add-hole-closing-2-prongs.js","sourceRoot":"","sources":["../../../src/mat/find-mat/find-and-add-hole-closing-2-prongs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B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CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;KAC3E;AACL,CAAC;AAGD,OAAO,EAAE,4BAA4B,EAAE,CAAA"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const point_on_shape_1 = require("../../point-on-shape");
|
|
1
|
+
import { isPosQuiteSharpCorner } from '../../point-on-shape.js';
|
|
4
2
|
/** @hidden */
|
|
5
3
|
function getPotential2Prongs(possPerLoop) {
|
|
6
4
|
let for2ProngsArray = [];
|
|
7
5
|
for (let poss of possPerLoop) {
|
|
8
6
|
let for2Prongs = [];
|
|
9
7
|
for (let pos of poss) {
|
|
10
|
-
if (!
|
|
8
|
+
if (!isPosQuiteSharpCorner(pos)) {
|
|
11
9
|
for2Prongs.push(pos);
|
|
12
10
|
}
|
|
13
11
|
}
|
|
@@ -15,5 +13,5 @@ function getPotential2Prongs(possPerLoop) {
|
|
|
15
13
|
}
|
|
16
14
|
return for2ProngsArray;
|
|
17
15
|
}
|
|
18
|
-
|
|
16
|
+
export { getPotential2Prongs };
|
|
19
17
|
//# sourceMappingURL=get-potential-2-prongs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-potential-2-prongs.js","sourceRoot":"","sources":["../../../src/mat/find-mat/get-potential-2-prongs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-potential-2-prongs.js","sourceRoot":"","sources":["../../../src/mat/find-mat/get-potential-2-prongs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAG/E,cAAc;AACd,SAAS,mBAAmB,CAAC,WAA8B;IACvD,IAAI,eAAe,GAAG,EAAE,CAAC;IAEzB,KAAK,IAAI,IAAI,IAAI,WAAW,EAAE;QAC1B,IAAI,UAAU,GAAG,EAAE,CAAC;QAEpB,KAAK,IAAI,GAAG,IAAI,IAAI,EAAE;YAClB,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,EAAE;gBAC7B,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACxB;SACJ;QAED,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KACpC;IAED,OAAO,eAAe,CAAC;AAC3B,CAAC;AAGD,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const point_on_shape_1 = require("../../point-on-shape");
|
|
1
|
+
import { isPosQuiteSharpCorner } from '../../point-on-shape.js';
|
|
4
2
|
/** @hidden */
|
|
5
3
|
function getSharpCorners(possPerLoop) {
|
|
6
4
|
let sharpCornersPerLoop = [];
|
|
@@ -8,7 +6,7 @@ function getSharpCorners(possPerLoop) {
|
|
|
8
6
|
let sharpCorners = [];
|
|
9
7
|
for (let pos of poss) {
|
|
10
8
|
//if (PointOnShape.isQuiteSharpCorner(pos)) {
|
|
11
|
-
if (
|
|
9
|
+
if (isPosQuiteSharpCorner(pos)) {
|
|
12
10
|
sharpCorners.push(pos);
|
|
13
11
|
}
|
|
14
12
|
}
|
|
@@ -16,5 +14,5 @@ function getSharpCorners(possPerLoop) {
|
|
|
16
14
|
}
|
|
17
15
|
return sharpCornersPerLoop;
|
|
18
16
|
}
|
|
19
|
-
|
|
17
|
+
export { getSharpCorners };
|
|
20
18
|
//# sourceMappingURL=get-sharp-corners.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-sharp-corners.js","sourceRoot":"","sources":["../../../src/mat/find-mat/get-sharp-corners.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-sharp-corners.js","sourceRoot":"","sources":["../../../src/mat/find-mat/get-sharp-corners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAG/E,cAAc;AACd,SAAS,eAAe,CAAC,WAA8B;IACnD,IAAI,mBAAmB,GAAG,EAAE,CAAC;IAE7B,KAAK,IAAI,IAAI,IAAI,WAAW,EAAE;QAC1B,IAAI,YAAY,GAAG,EAAE,CAAC;QAEtB,KAAK,IAAI,GAAG,IAAI,IAAI,EAAE;YAClB,6CAA6C;YAC7C,IAAI,qBAAqB,CAAC,GAAG,CAAC,EAAE;gBAC5B,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aAC1B;SACJ;QAED,mBAAmB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;KAC1C;IAED,OAAO,mBAAmB,CAAC;AAC/B,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -1,43 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const flo_vector2d_1 = require("flo-vector2d");
|
|
1
|
+
import { squaredDistanceBetween as squaredDistanceBetween_ } from 'flo-vector2d';
|
|
2
|
+
const squaredDistanceBetween = squaredDistanceBetween_;
|
|
4
3
|
/**
|
|
5
4
|
* @hidden
|
|
6
5
|
*/
|
|
7
6
|
function getClosestSquareDistanceToRect(box, p) {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const p0 = box[0];
|
|
8
|
+
const p1 = box[1];
|
|
9
|
+
const x0 = p0[0];
|
|
10
|
+
const y0 = p0[1];
|
|
11
|
+
const x1 = p1[0];
|
|
12
|
+
const y1 = p1[1];
|
|
13
|
+
const xp = p[0];
|
|
14
|
+
const yp = p[1];
|
|
15
|
+
//let [[x0,y0],[x1,y1]] = box;
|
|
16
|
+
//let [xp,yp] = p;
|
|
10
17
|
if (xp < x0) {
|
|
11
18
|
if (yp < y0) {
|
|
12
|
-
return
|
|
19
|
+
return squaredDistanceBetween(box[0], p);
|
|
13
20
|
}
|
|
14
21
|
else if (yp > y1) {
|
|
15
|
-
return
|
|
22
|
+
return squaredDistanceBetween([x0, y1], p);
|
|
16
23
|
}
|
|
17
24
|
else {
|
|
18
|
-
return
|
|
25
|
+
return (x0 - xp) ** 2;
|
|
19
26
|
}
|
|
20
27
|
}
|
|
21
28
|
else if (xp > x1) {
|
|
22
29
|
if (yp < y0) {
|
|
23
|
-
return
|
|
30
|
+
return squaredDistanceBetween([x1, y0], p);
|
|
24
31
|
}
|
|
25
32
|
else if (yp > y1) {
|
|
26
|
-
return
|
|
33
|
+
return squaredDistanceBetween(box[1], p);
|
|
27
34
|
}
|
|
28
35
|
else {
|
|
29
|
-
return
|
|
36
|
+
return (xp - x1) ** 2;
|
|
30
37
|
}
|
|
31
38
|
}
|
|
32
39
|
else {
|
|
33
40
|
if (yp < y0) {
|
|
34
|
-
return
|
|
41
|
+
return (y0 - yp) ** 2;
|
|
35
42
|
}
|
|
36
43
|
else if (yp > y1) {
|
|
37
|
-
return
|
|
44
|
+
return (yp - y1) ** 2;
|
|
38
45
|
}
|
|
39
46
|
return 0;
|
|
40
47
|
}
|
|
41
48
|
}
|
|
42
|
-
|
|
49
|
+
export { getClosestSquareDistanceToRect };
|
|
43
50
|
//# sourceMappingURL=get-closest-square-distance-to-rect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-closest-square-distance-to-rect.js","sourceRoot":"","sources":["../../../src/mat/geometry/get-closest-square-distance-to-rect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-closest-square-distance-to-rect.js","sourceRoot":"","sources":["../../../src/mat/geometry/get-closest-square-distance-to-rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,IAAI,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEjF,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAGvD;;GAEG;AACH,SAAS,8BAA8B,CACrC,GAAe,EAAE,CAAW;IAE7B,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAClB,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAClB,MAAM,EAAE,GAAG,EAAE,CA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SACpB;QAED,OAAO,CAAC,CAAC;KACT;AACF,CAAC;AAGD,OAAO,EAAE,8BAA8B,EAAE,CAAA"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const flo_vector2d_1 = require("flo-vector2d");
|
|
1
|
+
import { squaredDistanceBetweenPointAndLineSegment, squaredDistanceBetween } from 'flo-vector2d';
|
|
4
2
|
/**
|
|
5
3
|
* @hidden
|
|
6
4
|
*/
|
|
7
5
|
function getClosestSquaredDistanceToRotatedRect(ps, p) {
|
|
8
|
-
let ds = [0, 1, 2, 3].map(i =>
|
|
9
|
-
let width =
|
|
10
|
-
let height =
|
|
6
|
+
let ds = [0, 1, 2, 3].map(i => squaredDistanceBetweenPointAndLineSegment(p, [ps[i], ps[(i + 1) % 4]]));
|
|
7
|
+
let width = squaredDistanceBetween(ps[0], ps[1]);
|
|
8
|
+
let height = squaredDistanceBetween(ps[0], ps[3]);
|
|
11
9
|
if (ds[0] <= height && ds[2] <= height &&
|
|
12
10
|
ds[1] <= width && ds[3] <= width) {
|
|
13
11
|
return 0; // Inside rotated rect
|
|
14
12
|
}
|
|
15
13
|
return Math.min(...ds);
|
|
16
14
|
}
|
|
17
|
-
|
|
15
|
+
export { getClosestSquaredDistanceToRotatedRect };
|
|
18
16
|
//# sourceMappingURL=get-closest-squared-distance-to-rotated-rect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-closest-squared-distance-to-rotated-rect.js","sourceRoot":"","sources":["../../../src/mat/geometry/get-closest-squared-distance-to-rotated-rect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-closest-squared-distance-to-rotated-rect.js","sourceRoot":"","sources":["../../../src/mat/geometry/get-closest-squared-distance-to-rotated-rect.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,yCAAyC,EAAE,sBAAsB,EACjE,MAAM,cAAc,CAAC;AAGtB;;GAEG;AACH,SAAS,sCAAsC,CAAC,EAAc,EAAE,CAAW;IAC1E,IAAI,EAAE,GAAG,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,yCAAyC,CACnE,CAAC,EACD,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CACtB,CACD,CAAC;IAEF,IAAI,KAAK,GAAI,sBAAsB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,IAAI,MAAM,GAAG,sBAAsB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAElD,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM;QACrC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAK,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE;QAEnC,OAAO,CAAC,CAAC,CAAC,sBAAsB;KAChC;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;AACxB,CAAC;AAGD,OAAO,EAAE,sCAAsC,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CpNode } from '../cp-node';
|
|
2
|
-
import { BezierPiece } from './bezier-piece';
|
|
1
|
+
import { CpNode } from '../cp-node.js';
|
|
2
|
+
import { BezierPiece } from './bezier-piece.js';
|
|
3
3
|
/**
|
|
4
4
|
* @hidden
|
|
5
5
|
* Returns the ordered cubic bezier pieces (i.e a bezier with a t range)
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const point_on_shape_1 = require("../point-on-shape");
|
|
4
|
-
const contact_point_1 = require("../contact-point");
|
|
1
|
+
import { isPosQuiteSharpCorner } from '../point-on-shape.js';
|
|
2
|
+
import { compareCps } from '../contact-point.js';
|
|
5
3
|
/**
|
|
6
4
|
* @hidden
|
|
7
5
|
* Returns the ordered cubic bezier pieces (i.e a bezier with a t range)
|
|
@@ -27,12 +25,12 @@ function getBoundaryPieceBeziers(cpNodes) {
|
|
|
27
25
|
if (posNext.curve === posThis.curve &&
|
|
28
26
|
//PointOnShape.isQuiteSharpCorner(posThis) &&
|
|
29
27
|
//PointOnShape.isQuiteSharpCorner(posNext)) {
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
isPosQuiteSharpCorner(posThis) &&
|
|
29
|
+
isPosQuiteSharpCorner(posNext)) {
|
|
32
30
|
// Do nothing
|
|
33
31
|
}
|
|
34
32
|
else if (posNext.curve === posThis.curve &&
|
|
35
|
-
|
|
33
|
+
compareCps(cpThis.next.cp, cpThis.cp) > 0) {
|
|
36
34
|
bezierPieces.push({ curve: posThis.curve, ts: [posThis.t, posNext.t] });
|
|
37
35
|
}
|
|
38
36
|
else {
|
|
@@ -45,7 +43,6 @@ function getBoundaryPieceBeziers(cpNodes) {
|
|
|
45
43
|
} while (cpThis !== cpEnd);
|
|
46
44
|
return bezierPieces;
|
|
47
45
|
}
|
|
48
|
-
exports.getBoundaryPieceBeziers = getBoundaryPieceBeziers;
|
|
49
46
|
/**
|
|
50
47
|
* @hidden
|
|
51
48
|
* Adds pieces of skipped beziers
|
|
@@ -58,4 +55,5 @@ function addSkippedBeziers(bezierPieces, curveStart, curveEnd, t1) {
|
|
|
58
55
|
bezierPieces.push({ curve: curveThis, ts: [0, tEnd] });
|
|
59
56
|
} while (curveThis !== curveEnd);
|
|
60
57
|
}
|
|
58
|
+
export { getBoundaryPieceBeziers };
|
|
61
59
|
//# sourceMappingURL=get-boundary-piece-beziers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-boundary-piece-beziers.js","sourceRoot":"","sources":["../../src/mat/get-boundary-piece-beziers.ts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AC,CAAC,CAAC,EAAE,CACvD,CAAC;SACL;aAAM;YACH,YAAY,CAAC,IAAI,CACb,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAC/C,CAAC;YAEF,IAAI,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE;gBAC9E,iBAAiB,CACT,YAAY,EACZ,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,CAAC,CAChB,CAAC;aACL;SACJ;QAED,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;KACxB,QAAQ,MAAM,KAAK,KAAK,EAAE;IAG3B,OAAO,YAAY,CAAC;AACxB,CAAC;AAGD;;;GAGG;AACH,SAAS,iBAAiB,CAClB,YAA4B,EAC5B,UAAoB,EACpB,QAAoB,EACpB,EAAqB;IAEzB,IAAI,SAAS,GAAG,UAAU,CAAC;IAC3B,GAAG;QACC,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;QAC3B,IAAI,IAAI,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;KAC1D,QAAQ,SAAS,KAAK,QAAQ,EAAE;AACrC,CAAC;AAGD,OAAO,EAAE,uBAAuB,EAAE,CAAA"}
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const curve_1 = require("../curve");
|
|
4
|
-
const point_on_shape_1 = require("../point-on-shape");
|
|
1
|
+
import { getCornerAtEnd } from '../curve.js';
|
|
2
|
+
import { PointOnShape } from '../point-on-shape.js';
|
|
5
3
|
/**
|
|
6
4
|
* @hidden
|
|
7
5
|
* @param curve
|
|
8
6
|
*/
|
|
9
7
|
function getContactCirclesAtInterface(curve) {
|
|
10
|
-
let { isQuiteSharp, isQuiteDull } =
|
|
8
|
+
let { isQuiteSharp, isQuiteDull } = getCornerAtEnd(curve);
|
|
11
9
|
if (isQuiteSharp) {
|
|
12
|
-
return [new
|
|
10
|
+
return [new PointOnShape(curve, 1)];
|
|
13
11
|
}
|
|
14
12
|
else if (isQuiteDull) {
|
|
15
13
|
return [
|
|
16
|
-
new
|
|
17
|
-
new
|
|
14
|
+
new PointOnShape(curve, 1),
|
|
15
|
+
new PointOnShape(curve.next, 0)
|
|
18
16
|
];
|
|
19
17
|
}
|
|
20
18
|
return [];
|
|
21
19
|
}
|
|
22
|
-
|
|
20
|
+
export { getContactCirclesAtInterface };
|
|
23
21
|
//# sourceMappingURL=get-contact-circles-at-interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-contact-circles-at-interface.js","sourceRoot":"","sources":["../../src/mat/get-contact-circles-at-interface.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-contact-circles-at-interface.js","sourceRoot":"","sources":["../../src/mat/get-contact-circles-at-interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,cAAc,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIpD;;;GAGG;AACH,SAAS,4BAA4B,CAAC,KAAY;IACjD,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IAE1D,IAAI,YAAY,EAAE;QACjB,OAAO,CAAC,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;KACpC;SAAM,IAAI,WAAW,EAAE;QACvB,OAAO;YACN,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC;YAC1B,IAAI,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;SAC/B,CAAC;KACF;IAED,OAAO,EAAE,CAAC;AACX,CAAC;AAGD,OAAO,EAAE,4BAA4B,EAAE,CAAA"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/** @hidden */
|
|
4
2
|
function getLargestVertex(cpNodes) {
|
|
5
3
|
return cpNodes.reduce(function (maxCpNode, cpNode) {
|
|
@@ -8,5 +6,5 @@ function getLargestVertex(cpNodes) {
|
|
|
8
6
|
: cpNode;
|
|
9
7
|
}, cpNodes[0]);
|
|
10
8
|
}
|
|
11
|
-
|
|
9
|
+
export { getLargestVertex };
|
|
12
10
|
//# sourceMappingURL=get-largest-vertex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-largest-vertex.js","sourceRoot":"","sources":["../../src/mat/get-largest-vertex.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-largest-vertex.js","sourceRoot":"","sources":["../../src/mat/get-largest-vertex.ts"],"names":[],"mappings":"AAGA,cAAc;AACd,SAAS,gBAAgB,CAAC,OAAiB;IAC1C,OAAO,OAAO,CAAC,MAAM,CAAC,UAAS,SAAiB,EAAE,MAAc;QAC/D,OAAO,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM;YAC3D,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,MAAM,CAAA;IACV,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAChB,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
package/node/mat/get-leaves.d.ts
CHANGED
package/node/mat/get-leaves.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/** @hidden */
|
|
4
2
|
function getLeaves(cpNode) {
|
|
5
3
|
let leaves = [];
|
|
@@ -11,5 +9,5 @@ function getLeaves(cpNode) {
|
|
|
11
9
|
});
|
|
12
10
|
return leaves;
|
|
13
11
|
}
|
|
14
|
-
|
|
12
|
+
export { getLeaves };
|
|
15
13
|
//# sourceMappingURL=get-leaves.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-leaves.js","sourceRoot":"","sources":["../../src/mat/get-leaves.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-leaves.js","sourceRoot":"","sources":["../../src/mat/get-leaves.ts"],"names":[],"mappings":"AAGA,cAAc;AACd,SAAS,SAAS,CAAC,MAAc;IAC7B,IAAI,MAAM,GAAa,EAAE,CAAC;IAE1B,IAAI,GAAG,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;IAChC,GAAG,CAAC,OAAO,CAAC,UAAS,EAAE;QACnB,IAAI,EAAE,CAAC,aAAa,EAAE,EAAE;YACpB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACnB;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import LlRbTree from 'flo-ll-rb-tree';
|
|
2
|
-
import { IPointOnShape } from '../point-on-shape';
|
|
3
|
-
import { CpNode } from '../cp-node';
|
|
1
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
+
import { IPointOnShape } from '../point-on-shape.js';
|
|
3
|
+
import { CpNode } from '../cp-node.js';
|
|
4
4
|
/**
|
|
5
5
|
* @hidden
|
|
6
6
|
* Returns the boundary piece that starts at the immediate previous point on the
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const cp_node_1 = require("../cp-node");
|
|
1
|
+
import { CpNode } from '../cp-node.js';
|
|
4
2
|
/**
|
|
5
3
|
* @hidden
|
|
6
4
|
* Returns the boundary piece that starts at the immediate previous point on the
|
|
@@ -11,7 +9,7 @@ const cp_node_1 = require("../cp-node");
|
|
|
11
9
|
* @param order2
|
|
12
10
|
*/
|
|
13
11
|
function getNeighbouringPoints(cpTree, pos, order, order2) {
|
|
14
|
-
let cps = cpTree.findBounds(new
|
|
12
|
+
let cps = cpTree.findBounds(new CpNode({ pointOnShape: pos, circle: undefined, order, order2 }, false, false));
|
|
15
13
|
if (!cps[0] && !cps[1]) {
|
|
16
14
|
// The tree is still empty
|
|
17
15
|
return [undefined, undefined];
|
|
@@ -25,9 +23,9 @@ function getNeighbouringPoints(cpTree, pos, order, order2) {
|
|
|
25
23
|
];
|
|
26
24
|
}
|
|
27
25
|
return [
|
|
28
|
-
cps[0].
|
|
29
|
-
cps[1].
|
|
26
|
+
cps[0].datum,
|
|
27
|
+
cps[1].datum
|
|
30
28
|
];
|
|
31
29
|
}
|
|
32
|
-
|
|
30
|
+
export { getNeighbouringPoints };
|
|
33
31
|
//# sourceMappingURL=get-neighboring-cps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-neighboring-cps.js","sourceRoot":"","sources":["../../src/mat/get-neighboring-cps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-neighboring-cps.js","sourceRoot":"","sources":["../../src/mat/get-neighboring-cps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAGvC;;;;;;;;GAQG;AACH,SAAS,qBAAqB,CACtB,MAAwB,EACxB,GAAkB,EAClB,KAAa,EACb,MAAc;IAElB,IAAI,GAAG,GAAG,MAAM,CAAC,UAAU,CACvB,IAAI,MAAM,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CACpF,CAAC;IAEF,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QACpB,0BAA0B;QAC1B,OAAO,CAAC,SAAS,EAAE,SAAS,CAAa,CAAC;KAC7C;IAED,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QACpB,sDAAsD;QACtD,mDAAmD;QACnD,OAAO;YACH,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;SACd,CAAC;KACjB;IAED,OAAO;QACH,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK;QACZ,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK;KACH,CAAC;AAClB,CAAC;AAGD,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TwoProngForDebugging } from
|
|
2
|
-
import { ElemType_TwoProng } from
|
|
1
|
+
import { TwoProngForDebugging } from '../debug/two-prong-for-debugging.js';
|
|
2
|
+
import { ElemType_TwoProng } from './elem-type-two-prong.js';
|
|
3
3
|
/** @hidden */
|
|
4
4
|
declare function getTwoProngType(e: TwoProngForDebugging): ElemType_TwoProng;
|
|
5
5
|
export { getTwoProngType };
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/** @hidden */
|
|
4
2
|
function getTwoProngType(e) {
|
|
5
3
|
if (e.holeClosing) {
|
|
@@ -7,5 +5,5 @@ function getTwoProngType(e) {
|
|
|
7
5
|
}
|
|
8
6
|
return 'twoProng_regular';
|
|
9
7
|
}
|
|
10
|
-
|
|
8
|
+
export { getTwoProngType };
|
|
11
9
|
//# sourceMappingURL=get-two-prong-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-two-prong-type.js","sourceRoot":"","sources":["../../src/mat/get-two-prong-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-two-prong-type.js","sourceRoot":"","sources":["../../src/mat/get-two-prong-type.ts"],"names":[],"mappings":"AAIA,cAAc;AACd,SAAS,eAAe,CAAC,CAAuB;IAC/C,IAAI,CAAC,CAAC,WAAW,EAAE;QAAE,OAAO,sBAAsB,CAAA;KAAE;IAEpD,OAAO,kBAAkB,CAAC;AAC3B,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import LlRbTree from
|
|
2
|
-
import { Loop } from
|
|
3
|
-
import { CpNode } from
|
|
4
|
-
import { IPointOnShape } from
|
|
5
|
-
import { Circle } from
|
|
1
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
+
import { Loop } from '../loop.js';
|
|
3
|
+
import { CpNode } from '../cp-node.js';
|
|
4
|
+
import { IPointOnShape } from '../point-on-shape.js';
|
|
5
|
+
import { Circle } from '../circle.js';
|
|
6
6
|
/**
|
|
7
7
|
* @hidden
|
|
8
8
|
* Returns true if another CpNode is close to the given implied (via pos, order
|