flo-mat 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.cjs +17 -0
- package/README.md +12 -1
- package/browser/index.js +7348 -0
- package/browser/index.min.js +2 -1
- package/browser/index.min.js.LICENSE.txt +2907 -0
- package/browser/index.module.js +7369 -0
- package/browser/index.module.min.js +2 -0
- package/browser/index.module.min.js.LICENSE.txt +2907 -0
- package/node/circle.js +3 -7
- package/node/circle.js.map +1 -1
- package/node/compare-curvatures-at-interface.d.ts +19 -0
- package/node/compare-curvatures-at-interface.js +125 -0
- package/node/compare-curvatures-at-interface.js.map +1 -0
- package/node/contact-point.d.ts +2 -2
- package/node/contact-point.js +3 -6
- package/node/contact-point.js.map +1 -1
- package/node/cp-node/clone.d.ts +1 -1
- package/node/cp-node/clone.js +4 -7
- package/node/cp-node/clone.js.map +1 -1
- package/node/cp-node/remove.d.ts +2 -2
- package/node/cp-node/remove.js +1 -4
- package/node/cp-node/remove.js.map +1 -1
- package/node/cp-node.d.ts +4 -5
- package/node/cp-node.js +8 -12
- package/node/cp-node.js.map +1 -1
- package/node/curve.d.ts +2 -2
- package/node/curve.js +10 -14
- package/node/curve.js.map +1 -1
- package/node/debug/cp-node-for-debugging.d.ts +2 -2
- package/node/debug/cp-node-for-debugging.js +1 -2
- package/node/debug/debug-elem-types.d.ts +8 -8
- package/node/debug/debug-elem-types.js +1 -2
- package/node/debug/debug.d.ts +5 -7
- package/node/debug/debug.js +67 -10
- package/node/debug/debug.js.map +1 -1
- package/node/debug/functions/draw-elem/bounding-hull.js +3 -6
- package/node/debug/functions/draw-elem/bounding-hull.js.map +1 -1
- package/node/debug/functions/draw-elem/branch.d.ts +1 -1
- package/node/debug/functions/draw-elem/branch.js +5 -8
- package/node/debug/functions/draw-elem/branch.js.map +1 -1
- package/node/debug/functions/draw-elem/culls.d.ts +1 -1
- package/node/debug/functions/draw-elem/culls.js +1 -4
- package/node/debug/functions/draw-elem/culls.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.js +1 -4
- package/node/debug/functions/draw-elem/draw-circle-percent.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-elem.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-elem.js +34 -37
- package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
- package/node/debug/functions/draw-elem/dull-corner.d.ts +1 -1
- package/node/debug/functions/draw-elem/dull-corner.js +5 -7
- package/node/debug/functions/draw-elem/dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/leaves.d.ts +1 -1
- package/node/debug/functions/draw-elem/leaves.js +3 -6
- package/node/debug/functions/draw-elem/leaves.js.map +1 -1
- package/node/debug/functions/draw-elem/loop.d.ts +1 -1
- package/node/debug/functions/draw-elem/loop.js +1 -4
- package/node/debug/functions/draw-elem/loop.js.map +1 -1
- package/node/debug/functions/draw-elem/loops.d.ts +1 -1
- package/node/debug/functions/draw-elem/loops.js +1 -4
- package/node/debug/functions/draw-elem/loops.js.map +1 -1
- package/node/debug/functions/draw-elem/loose-bounding-box.js +3 -6
- package/node/debug/functions/draw-elem/loose-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/mat.d.ts +1 -1
- package/node/debug/functions/draw-elem/mat.js +7 -10
- package/node/debug/functions/draw-elem/mat.js.map +1 -1
- package/node/debug/functions/draw-elem/max-vertex.d.ts +1 -1
- package/node/debug/functions/draw-elem/max-vertex.js +3 -6
- package/node/debug/functions/draw-elem/max-vertex.js.map +1 -1
- package/node/debug/functions/draw-elem/min-y.d.ts +1 -1
- package/node/debug/functions/draw-elem/min-y.js +9 -12
- package/node/debug/functions/draw-elem/min-y.js.map +1 -1
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.d.ts +1 -1
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js +7 -10
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/one-prong.d.ts +1 -1
- package/node/debug/functions/draw-elem/one-prong.js +9 -12
- package/node/debug/functions/draw-elem/one-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/sharp-corner.d.ts +1 -1
- package/node/debug/functions/draw-elem/sharp-corner.js +3 -6
- package/node/debug/functions/draw-elem/sharp-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/three-prong.d.ts +1 -1
- package/node/debug/functions/draw-elem/three-prong.js +9 -12
- package/node/debug/functions/draw-elem/three-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/tight-bounding-box.js +3 -6
- package/node/debug/functions/draw-elem/tight-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/two-prong.d.ts +1 -1
- package/node/debug/functions/draw-elem/two-prong.js +9 -12
- package/node/debug/functions/draw-elem/two-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/vertex.d.ts +1 -1
- package/node/debug/functions/draw-elem/vertex.js +7 -10
- package/node/debug/functions/draw-elem/vertex.js.map +1 -1
- package/node/debug/functions/general.d.ts +1 -1
- package/node/debug/functions/general.js +3 -6
- package/node/debug/functions/general.js.map +1 -1
- package/node/debug/functions/three-prong.js +24 -27
- package/node/debug/functions/three-prong.js.map +1 -1
- package/node/debug/functions/two-prong.d.ts +1 -1
- package/node/debug/functions/two-prong.js +10 -13
- package/node/debug/functions/two-prong.js.map +1 -1
- package/node/debug/three-prong-for-debugging.d.ts +4 -4
- package/node/debug/three-prong-for-debugging.js +4 -7
- package/node/debug/three-prong-for-debugging.js.map +1 -1
- package/node/debug/two-prong-for-debugging.d.ts +5 -5
- package/node/debug/two-prong-for-debugging.js +1 -2
- package/node/find-mats.d.ts +12 -9
- package/node/find-mats.js +47 -53
- package/node/find-mats.js.map +1 -1
- package/node/get-boundary-bezier-parts-to-next.d.ts +3 -3
- package/node/get-boundary-bezier-parts-to-next.js +1 -4
- package/node/get-boundary-bezier-parts-to-next.js.map +1 -1
- package/node/get-boundary-beziers-to-next.d.ts +1 -1
- package/node/get-boundary-beziers-to-next.js +8 -8
- package/node/get-boundary-beziers-to-next.js.map +1 -1
- package/node/get-bounding-box-.d.ts +2 -0
- package/node/get-bounding-box-.js +5 -0
- package/node/get-bounding-box-.js.map +1 -0
- package/node/get-branches.d.ts +1 -1
- package/node/get-branches.js +7 -10
- package/node/get-branches.js.map +1 -1
- package/node/get-curve/get-curve-between.d.ts +1 -1
- package/node/get-curve/get-curve-between.js +21 -24
- package/node/get-curve/get-curve-between.js.map +1 -1
- package/node/get-curve/get-edge-direction.d.ts +1 -1
- package/node/get-curve/get-edge-direction.js +12 -15
- package/node/get-curve/get-edge-direction.js.map +1 -1
- package/node/get-curve-to-next.d.ts +1 -1
- package/node/get-curve-to-next.js +3 -6
- package/node/get-curve-to-next.js.map +1 -1
- package/node/get-interface-ccw.d.ts +24 -0
- package/node/get-interface-ccw.js +98 -0
- package/node/get-interface-ccw.js.map +1 -0
- package/node/index.d.ts +35 -36
- package/node/index.js +32 -56
- package/node/index.js.map +1 -1
- package/node/loop/get-max-coordinate.js +1 -4
- package/node/loop/get-max-coordinate.js.map +1 -1
- package/node/loop.d.ts +1 -1
- package/node/loop.js +1 -4
- package/node/loop.js.map +1 -1
- package/node/mat/add-to-cp-graph.d.ts +5 -5
- package/node/mat/add-to-cp-graph.js +5 -8
- package/node/mat/add-to-cp-graph.js.map +1 -1
- package/node/mat/bezier-piece.d.ts +1 -1
- package/node/mat/bezier-piece.js +1 -2
- package/node/mat/closest-boundary-point/closest-points-on-curve.d.ts +1 -1
- package/node/mat/closest-boundary-point/closest-points-on-curve.js +15 -14
- package/node/mat/closest-boundary-point/closest-points-on-curve.js.map +1 -1
- package/node/mat/closest-boundary-point/cull-bezier-pieces.d.ts +1 -1
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js +7 -10
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js.map +1 -1
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.d.ts +1 -1
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js +5 -8
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -1
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.d.ts +1 -1
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js +7 -8
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -1
- package/node/mat/closest-boundary-point/get-best-distance-squared.d.ts +1 -1
- package/node/mat/closest-boundary-point/get-best-distance-squared.js +6 -9
- package/node/mat/closest-boundary-point/get-best-distance-squared.js.map +1 -1
- package/node/mat/closest-boundary-point/get-close-boundary-points.d.ts +2 -2
- package/node/mat/closest-boundary-point/get-close-boundary-points.js +9 -12
- package/node/mat/closest-boundary-point/get-close-boundary-points.js.map +1 -1
- package/node/mat/closest-boundary-point/get-closest-boundary-point.d.ts +3 -3
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js +10 -13
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js.map +1 -1
- package/node/mat/corner.js +1 -2
- package/node/mat/create-new-cp-tree.d.ts +3 -3
- package/node/mat/create-new-cp-tree.js +5 -7
- package/node/mat/create-new-cp-tree.js.map +1 -1
- package/node/mat/elem-type-two-prong.js +1 -2
- package/node/mat/find-mat/add-1-prong.d.ts +4 -4
- package/node/mat/find-mat/add-1-prong.js +9 -12
- package/node/mat/find-mat/add-1-prong.js.map +1 -1
- package/node/mat/find-mat/add-2-prong.d.ts +5 -5
- package/node/mat/find-mat/add-2-prong.js +19 -22
- package/node/mat/find-mat/add-2-prong.js.map +1 -1
- package/node/mat/find-mat/add-3-prong.d.ts +5 -5
- package/node/mat/find-mat/add-3-prong.js +7 -10
- package/node/mat/find-mat/add-3-prong.js.map +1 -1
- package/node/mat/find-mat/add-debug-info.d.ts +2 -2
- package/node/mat/find-mat/add-debug-info.js +8 -13
- package/node/mat/find-mat/add-debug-info.js.map +1 -1
- package/node/mat/find-mat/create-get-interesting-points-on-loop.d.ts +3 -3
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js +29 -16
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js.map +1 -1
- package/node/mat/find-mat/create-initial-cp-graph.d.ts +4 -4
- package/node/mat/find-mat/create-initial-cp-graph.js +7 -9
- package/node/mat/find-mat/create-initial-cp-graph.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/add-debug-info.d.ts +5 -5
- package/node/mat/find-mat/find-2-prong/add-debug-info.js +3 -6
- package/node/mat/find-mat/find-2-prong/add-debug-info.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.d.ts +1 -1
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js +5 -8
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/find-2-prong.d.ts +5 -5
- package/node/mat/find-mat/find-2-prong/find-2-prong.js +37 -39
- package/node/mat/find-mat/find-2-prong/find-2-prong.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js +1 -4
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.d.ts +5 -5
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js +7 -10
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/x-for-debugging.d.ts +1 -1
- package/node/mat/find-mat/find-2-prong/x-for-debugging.js +1 -2
- package/node/mat/find-mat/find-3-prong/calc-better-x.d.ts +2 -2
- package/node/mat/find-mat/find-3-prong/calc-better-x.js +10 -13
- package/node/mat/find-mat/find-3-prong/calc-better-x.js.map +1 -1
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.d.ts +2 -2
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js +6 -8
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js.map +1 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.d.ts +3 -3
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js +29 -32
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js.map +1 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong.d.ts +3 -3
- package/node/mat/find-mat/find-3-prong/find-3-prong.js +14 -12
- package/node/mat/find-mat/find-3-prong/find-3-prong.js.map +1 -1
- package/node/mat/find-mat/find-3-prong/get-closest-points.d.ts +2 -2
- package/node/mat/find-mat/find-3-prong/get-closest-points.js +3 -6
- package/node/mat/find-mat/find-3-prong/get-closest-points.js.map +1 -1
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.d.ts +4 -4
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js +3 -6
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js.map +1 -1
- package/node/mat/find-mat/find-and-add-2-prongs.d.ts +4 -4
- package/node/mat/find-mat/find-and-add-2-prongs.js +9 -12
- package/node/mat/find-mat/find-and-add-2-prongs.js.map +1 -1
- package/node/mat/find-mat/find-and-add-3-prongs.d.ts +3 -3
- package/node/mat/find-mat/find-and-add-3-prongs.js +8 -11
- package/node/mat/find-mat/find-and-add-3-prongs.js.map +1 -1
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.d.ts +3 -3
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js +11 -14
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js.map +1 -1
- package/node/mat/find-mat/get-potential-2-prongs.d.ts +1 -1
- package/node/mat/find-mat/get-potential-2-prongs.js +3 -6
- package/node/mat/find-mat/get-potential-2-prongs.js.map +1 -1
- package/node/mat/find-mat/get-sharp-corners.d.ts +1 -1
- package/node/mat/find-mat/get-sharp-corners.js +3 -6
- package/node/mat/find-mat/get-sharp-corners.js.map +1 -1
- package/node/mat/geometry/get-closest-square-distance-to-rect.js +21 -15
- package/node/mat/geometry/get-closest-square-distance-to-rect.js.map +1 -1
- package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js +5 -8
- package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -1
- package/node/mat/get-boundary-piece-beziers.d.ts +2 -2
- package/node/mat/get-boundary-piece-beziers.js +6 -9
- package/node/mat/get-boundary-piece-beziers.js.map +1 -1
- package/node/mat/get-contact-circles-at-interface.d.ts +2 -2
- package/node/mat/get-contact-circles-at-interface.js +7 -10
- package/node/mat/get-contact-circles-at-interface.js.map +1 -1
- package/node/mat/get-largest-vertex.d.ts +1 -1
- package/node/mat/get-largest-vertex.js +1 -4
- package/node/mat/get-largest-vertex.js.map +1 -1
- package/node/mat/get-leaves.d.ts +1 -1
- package/node/mat/get-leaves.js +1 -4
- package/node/mat/get-leaves.js.map +1 -1
- package/node/mat/get-neighboring-cps.d.ts +3 -3
- package/node/mat/get-neighboring-cps.js +5 -8
- package/node/mat/get-neighboring-cps.js.map +1 -1
- package/node/mat/get-two-prong-type.d.ts +2 -2
- package/node/mat/get-two-prong-type.js +1 -4
- package/node/mat/get-two-prong-type.js.map +1 -1
- package/node/mat/is-another-cp-closeby.d.ts +5 -5
- package/node/mat/is-another-cp-closeby.js +8 -11
- package/node/mat/is-another-cp-closeby.js.map +1 -1
- package/node/mat/simplify-mat-map-only.d.ts +1 -1
- package/node/mat/simplify-mat-map-only.js +10 -14
- package/node/mat/simplify-mat-map-only.js.map +1 -1
- package/node/mat/to-scale-axis/add-debug-info.d.ts +1 -1
- package/node/mat/to-scale-axis/add-debug-info.js +1 -4
- package/node/mat/to-scale-axis/add-debug-info.js.map +1 -1
- package/node/mat/to-scale-axis/cull-non-cycles.d.ts +1 -1
- package/node/mat/to-scale-axis/cull-non-cycles.js +5 -8
- package/node/mat/to-scale-axis/cull-non-cycles.js.map +1 -1
- package/node/mat/to-scale-axis/cull.d.ts +2 -2
- package/node/mat/to-scale-axis/cull.js +75 -8
- package/node/mat/to-scale-axis/cull.js.map +1 -1
- package/node/mat/trim-mat.d.ts +1 -1
- package/node/mat/trim-mat.js +6 -9
- package/node/mat/trim-mat.js.map +1 -1
- package/node/mat.d.ts +3 -3
- package/node/mat.js +1 -2
- package/node/point-on-shape.d.ts +2 -2
- package/node/point-on-shape.js +23 -34
- package/node/point-on-shape.js.map +1 -1
- package/node/simplify-mat.d.ts +4 -3
- package/node/simplify-mat.js +14 -16
- package/node/simplify-mat.js.map +1 -1
- package/node/svg/get-loop-bounds.d.ts +2 -2
- package/node/svg/get-loop-bounds.js +11 -13
- package/node/svg/get-loop-bounds.js.map +1 -1
- package/node/svg/get-min-y-pos.d.ts +3 -2
- package/node/svg/get-min-y-pos.js +3 -6
- package/node/svg/get-min-y-pos.js.map +1 -1
- package/node/svg/get-shape-bounds.d.ts +5 -5
- package/node/svg/get-shape-bounds.js +5 -8
- package/node/svg/get-shape-bounds.js.map +1 -1
- package/node/sweep-line/sweep-line.js +1 -4
- package/node/sweep-line/sweep-line.js.map +1 -1
- package/node/to-scale-axis.d.ts +2 -1
- package/node/to-scale-axis.js +18 -21
- package/node/to-scale-axis.js.map +1 -1
- package/node/traverse-edges.d.ts +1 -1
- package/node/traverse-edges.js +1 -4
- package/node/traverse-edges.js.map +1 -1
- package/node/traverse-vertices.d.ts +1 -1
- package/node/traverse-vertices.js +1 -4
- package/node/traverse-vertices.js.map +1 -1
- package/package.json +34 -31
- package/src/circle.ts +0 -6
- package/src/compare-curvatures-at-interface.ts +197 -0
- package/src/contact-point.ts +2 -3
- package/src/cp-node/clone.ts +1 -2
- package/src/cp-node/remove.ts +2 -3
- package/src/cp-node.ts +6 -8
- package/src/curve.ts +3 -4
- package/src/debug/cp-node-for-debugging.ts +2 -3
- package/src/debug/debug-elem-types.ts +8 -10
- package/src/debug/debug.ts +22 -17
- package/src/debug/functions/draw-elem/bounding-hull.ts +0 -1
- package/src/debug/functions/draw-elem/branch.ts +2 -3
- package/src/debug/functions/draw-elem/culls.ts +1 -2
- package/src/debug/functions/draw-elem/draw-elem.ts +18 -19
- package/src/debug/functions/draw-elem/dull-corner.ts +3 -3
- package/src/debug/functions/draw-elem/leaves.ts +2 -4
- package/src/debug/functions/draw-elem/loop.ts +1 -2
- package/src/debug/functions/draw-elem/loops.ts +1 -2
- package/src/debug/functions/draw-elem/loose-bounding-box.ts +0 -1
- package/src/debug/functions/draw-elem/mat.ts +3 -5
- package/src/debug/functions/draw-elem/max-vertex.ts +1 -2
- package/src/debug/functions/draw-elem/min-y.ts +5 -7
- package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +1 -2
- package/src/debug/functions/draw-elem/one-prong.ts +2 -3
- package/src/debug/functions/draw-elem/sharp-corner.ts +1 -2
- package/src/debug/functions/draw-elem/three-prong.ts +2 -4
- package/src/debug/functions/draw-elem/tight-bounding-box.ts +0 -1
- package/src/debug/functions/draw-elem/two-prong.ts +2 -3
- package/src/debug/functions/draw-elem/vertex.ts +1 -2
- package/src/debug/functions/general.ts +2 -3
- package/src/debug/functions/three-prong.ts +3 -4
- package/src/debug/functions/two-prong.ts +6 -14
- package/src/debug/three-prong-for-debugging.ts +4 -5
- package/src/debug/two-prong-for-debugging.ts +5 -6
- package/src/find-mats.ts +34 -39
- package/src/get-boundary-bezier-parts-to-next.ts +5 -6
- package/src/get-boundary-beziers-to-next.ts +8 -7
- package/src/get-bounding-box-.ts +7 -0
- package/src/get-branches.ts +2 -3
- package/src/get-curve/get-curve-between.ts +2 -3
- package/src/get-curve/get-edge-direction.ts +2 -5
- package/src/get-curve-to-next.ts +2 -3
- package/src/get-interface-ccw.ts +112 -0
- package/src/index.ts +34 -48
- package/src/loop/get-max-coordinate.ts +0 -1
- package/src/loop.ts +1 -2
- package/src/mat/add-to-cp-graph.ts +7 -8
- package/src/mat/bezier-piece.ts +1 -2
- package/src/mat/closest-boundary-point/closest-points-on-curve.ts +19 -17
- package/src/mat/closest-boundary-point/cull-bezier-pieces.ts +4 -5
- package/src/mat/closest-boundary-point/cull-by-loose-bounding-box.ts +4 -5
- package/src/mat/closest-boundary-point/cull-by-tight-boundary-box.ts +7 -5
- package/src/mat/closest-boundary-point/get-best-distance-squared.ts +1 -2
- package/src/mat/closest-boundary-point/get-close-boundary-points.ts +4 -11
- package/src/mat/closest-boundary-point/get-closest-boundary-point.ts +5 -6
- package/src/mat/cmp-cp-on-delta.ts +2 -3
- package/src/mat/create-new-cp-tree.ts +5 -5
- package/src/mat/find-mat/add-1-prong.ts +7 -8
- package/src/mat/find-mat/add-2-prong.ts +11 -12
- package/src/mat/find-mat/add-3-prong.ts +7 -8
- package/src/mat/find-mat/add-debug-info.ts +8 -7
- package/src/mat/find-mat/create-get-interesting-points-on-loop.ts +22 -8
- package/src/mat/find-mat/create-initial-cp-graph.ts +7 -8
- package/src/mat/find-mat/find-2-prong/add-debug-info.ts +9 -10
- package/src/mat/find-mat/find-2-prong/cull-bezier-pieces.ts +4 -7
- package/src/mat/find-mat/find-2-prong/find-2-prong.ts +19 -17
- package/src/mat/find-mat/find-2-prong/get-initial-bezier-pieces.ts +7 -8
- package/src/mat/find-mat/find-2-prong/x-for-debugging.ts +1 -2
- package/src/mat/find-mat/find-3-prong/calc-better-x.ts +3 -6
- package/src/mat/find-mat/find-3-prong/calc-initial-3-prong-center.ts +3 -8
- package/src/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.ts +10 -14
- package/src/mat/find-mat/find-3-prong/find-3-prong.ts +13 -8
- package/src/mat/find-mat/find-3-prong/get-closest-points.ts +2 -5
- package/src/mat/find-mat/find-and-add-2-prongs-on-all-paths.ts +5 -6
- package/src/mat/find-mat/find-and-add-2-prongs.ts +9 -10
- package/src/mat/find-mat/find-and-add-3-prongs.ts +8 -9
- package/src/mat/find-mat/find-and-add-hole-closing-2-prongs.ts +7 -8
- package/src/mat/find-mat/get-potential-2-prongs.ts +1 -2
- package/src/mat/find-mat/get-sharp-corners.ts +1 -2
- package/src/mat/find-mat/get-total-abs-curvature.ts +2 -3
- package/src/mat/find-mat/get-total-by.ts +2 -3
- package/src/mat/geometry/get-closest-square-distance-to-rect.ts +15 -4
- package/src/mat/geometry/get-closest-squared-distance-to-rotated-rect.ts +0 -1
- package/src/mat/get-boundary-piece-beziers.ts +5 -6
- package/src/mat/get-contact-circles-at-interface.ts +3 -4
- package/src/mat/get-edges-as-array.ts +2 -3
- package/src/mat/get-largest-three-prong.ts +1 -2
- package/src/mat/get-largest-vertex.ts +1 -2
- package/src/mat/get-leaves.ts +1 -2
- package/src/mat/get-neighboring-cps.ts +5 -6
- package/src/mat/get-two-prong-type.ts +2 -3
- package/src/mat/is-another-cp-closeby.ts +6 -7
- package/src/mat/simplify-mat-map-only.ts +5 -7
- package/src/mat/to-scale-axis/add-debug-info.ts +2 -3
- package/src/mat/to-scale-axis/add-to-tree.ts +3 -4
- package/src/mat/to-scale-axis/calc-groups.ts +1 -2
- package/src/mat/to-scale-axis/create-spacial-tree.ts +3 -4
- package/src/mat/to-scale-axis/cull-non-cycles.ts +2 -3
- package/src/mat/to-scale-axis/cull.ts +3 -4
- package/src/mat/to-scale-axis/get-engulfed-vertices.ts +3 -4
- package/src/mat/to-scale-axis/t-tree.ts +1 -2
- package/src/mat/to-scale-axis/traverse-spacial-tree.ts +2 -4
- package/src/mat/trim-mat.ts +4 -5
- package/src/mat.ts +3 -5
- package/src/point-on-shape.ts +10 -12
- package/src/simplify-mat.ts +11 -13
- package/src/svg/get-curvature-at-interface.ts +1 -3
- package/src/svg/get-extreme.ts +2 -3
- package/src/svg/get-loop-bounds.ts +4 -4
- package/src/svg/get-min-y-pos.ts +2 -6
- package/src/svg/get-shape-bounds.ts +2 -3
- package/src/sweep-line/are-boxes-intersecting.ts +1 -1
- package/src/to-scale-axis.ts +15 -16
- package/src/traverse-edges.ts +1 -2
- package/src/traverse-vertices.ts +1 -2
- package/test/lib-load.spec.ts +0 -1
- package/tsconfig.json +6 -31
- package/webpack.config.cjs +132 -0
- package/.nycrc +0 -4
- package/node/mat/cmp-cp-on-delta.d.ts +0 -14
- package/node/mat/cmp-cp-on-delta.js +0 -45
- package/node/mat/cmp-cp-on-delta.js.map +0 -1
- package/node/mat/find-mat/get-total-abs-curvature.d.ts +0 -5
- package/node/mat/find-mat/get-total-abs-curvature.js +0 -13
- package/node/mat/find-mat/get-total-abs-curvature.js.map +0 -1
- package/node/mat/find-mat/get-total-by.d.ts +0 -10
- package/node/mat/find-mat/get-total-by.js +0 -22
- package/node/mat/find-mat/get-total-by.js.map +0 -1
- package/node/mat/get-edges-as-array.d.ts +0 -4
- package/node/mat/get-edges-as-array.js +0 -12
- package/node/mat/get-edges-as-array.js.map +0 -1
- package/node/mat/get-largest-three-prong.d.ts +0 -4
- package/node/mat/get-largest-three-prong.js +0 -13
- package/node/mat/get-largest-three-prong.js.map +0 -1
- package/node/mat/to-scale-axis/add-to-tree.d.ts +0 -13
- package/node/mat/to-scale-axis/add-to-tree.js +0 -39
- package/node/mat/to-scale-axis/add-to-tree.js.map +0 -1
- package/node/mat/to-scale-axis/calc-groups.d.ts +0 -28
- package/node/mat/to-scale-axis/calc-groups.js +0 -66
- package/node/mat/to-scale-axis/calc-groups.js.map +0 -1
- package/node/mat/to-scale-axis/create-spacial-tree.d.ts +0 -9
- package/node/mat/to-scale-axis/create-spacial-tree.js +0 -24
- package/node/mat/to-scale-axis/create-spacial-tree.js.map +0 -1
- package/node/mat/to-scale-axis/get-engulfed-vertices.d.ts +0 -12
- package/node/mat/to-scale-axis/get-engulfed-vertices.js +0 -95
- package/node/mat/to-scale-axis/get-engulfed-vertices.js.map +0 -1
- package/node/mat/to-scale-axis/t-tree.d.ts +0 -6
- package/node/mat/to-scale-axis/t-tree.js +0 -3
- package/node/mat/to-scale-axis/t-tree.js.map +0 -1
- package/node/mat/to-scale-axis/traverse-spacial-tree.d.ts +0 -11
- package/node/mat/to-scale-axis/traverse-spacial-tree.js +0 -25
- package/node/mat/to-scale-axis/traverse-spacial-tree.js.map +0 -1
- package/node/svg/get-curvature-at-interface.d.ts +0 -9
- package/node/svg/get-curvature-at-interface.js +0 -49
- package/node/svg/get-curvature-at-interface.js.map +0 -1
- package/node/svg/get-extreme.d.ts +0 -9
- package/node/svg/get-extreme.js +0 -16
- package/node/svg/get-extreme.js.map +0 -1
- package/node/sweep-line/are-boxes-intersecting.d.ts +0 -11
- package/node/sweep-line/are-boxes-intersecting.js +0 -42
- package/node/sweep-line/are-boxes-intersecting.js.map +0 -1
- package/test/mocha.opts +0 -4
- package/webpack.config.js +0 -25
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.cullByLooseBoundingBox = void 0;
|
|
4
|
-
const flo_bezier3_1 = require("flo-bezier3");
|
|
5
|
-
const get_closest_square_distance_to_rect_1 = require("../geometry/get-closest-square-distance-to-rect");
|
|
1
|
+
import { getBoundingBox_ } from '../../get-bounding-box-.js';
|
|
2
|
+
import { getClosestSquareDistanceToRect } from '../geometry/get-closest-square-distance-to-rect.js';
|
|
6
3
|
/**
|
|
7
4
|
* @hidden
|
|
8
5
|
* When checking distances, ignore all those with closest possible distance
|
|
@@ -16,13 +13,13 @@ function cullByLooseBoundingBox(bezierPieces, p, dSquared) {
|
|
|
16
13
|
for (let i = 0; i < bezierPieces.length; i++) {
|
|
17
14
|
let bezierPiece = bezierPieces[i];
|
|
18
15
|
let ps = bezierPiece.curve.ps;
|
|
19
|
-
let boundingBox =
|
|
20
|
-
let d =
|
|
16
|
+
let boundingBox = getBoundingBox_(ps);
|
|
17
|
+
let d = getClosestSquareDistanceToRect(boundingBox, p);
|
|
21
18
|
if (d <= dSquared) {
|
|
22
19
|
candidateBezierPieces.push(bezierPiece);
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
22
|
return candidateBezierPieces;
|
|
26
23
|
}
|
|
27
|
-
|
|
24
|
+
export { cullByLooseBoundingBox };
|
|
28
25
|
//# sourceMappingURL=cull-by-loose-bounding-box.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cull-by-loose-bounding-box.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/cull-by-loose-bounding-box.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cull-by-loose-bounding-box.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/cull-by-loose-bounding-box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AAGpG;;;;;;;GAOG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW,EACX,QAAgB;IAEpB,IAAI,qBAAqB,GAAG,EAAE,CAAC;IAE/B,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAE9B,IAAI,WAAW,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;QAEtC,IAAI,CAAC,GAAG,8BAA8B,CAClC,WAAW,EACX,CAAC,CACJ,CAAC;QACF,IAAI,CAAC,IAAI,QAAQ,EAAE;YACf,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC3C;KACJ;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const get_closest_squared_distance_to_rotated_rect_1 = require("../geometry/get-closest-squared-distance-to-rotated-rect");
|
|
1
|
+
import { getBoundingBoxTight } from "flo-bezier3";
|
|
2
|
+
import { memoize } from "flo-memoize";
|
|
3
|
+
import { getClosestSquaredDistanceToRotatedRect } from '../geometry/get-closest-squared-distance-to-rotated-rect.js';
|
|
4
|
+
const getBoundingBoxTight_ = memoize(getBoundingBoxTight);
|
|
6
5
|
/**
|
|
7
6
|
* @hidden
|
|
8
7
|
* When checking distances, ignore all those with closest possible distance
|
|
@@ -16,13 +15,13 @@ function cullByTightBoundingBox(bezierPieces, p, bestSquaredDistance) {
|
|
|
16
15
|
for (let i = 0; i < bezierPieces.length; i++) {
|
|
17
16
|
let bezierPiece = bezierPieces[i];
|
|
18
17
|
let ps = bezierPiece.curve.ps;
|
|
19
|
-
let tightBoundingBox =
|
|
20
|
-
let d =
|
|
18
|
+
let tightBoundingBox = getBoundingBoxTight_(ps);
|
|
19
|
+
let d = getClosestSquaredDistanceToRotatedRect(tightBoundingBox, p);
|
|
21
20
|
if (d <= bestSquaredDistance) {
|
|
22
21
|
candidateBezierPieces.push(bezierPiece);
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
return candidateBezierPieces;
|
|
26
25
|
}
|
|
27
|
-
|
|
26
|
+
export { cullByTightBoundingBox };
|
|
28
27
|
//# sourceMappingURL=cull-by-tight-boundary-box.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cull-by-tight-boundary-box.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/cull-by-tight-boundary-box.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cull-by-tight-boundary-box.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/cull-by-tight-boundary-box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,sCAAsC,EAAE,MAAM,6DAA6D,CAAC;AAGrH,MAAM,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAG1D;;;;;;;GAOG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW,EACX,mBAA2B;IAE/B,IAAI,qBAAqB,GAAG,EAAE,CAAC;IAE/B,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAClC,IAAI,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAE9B,IAAI,gBAAgB,GAAG,oBAAoB,CAAC,EAAE,CAAC,CAAC;QAChD,IAAI,CAAC,GAAG,sCAAsC,CACtC,gBAAgB,EAChB,CAAC,CACR,CAAC;QACF,IAAI,CAAC,IAAI,mBAAmB,EAAE;YAC1B,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC3C;KACJ;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getBestDistanceSquared = void 0;
|
|
4
|
-
const flo_bezier3_1 = require("flo-bezier3");
|
|
5
|
-
const flo_vector2d_1 = require("flo-vector2d");
|
|
1
|
+
import { evalDeCasteljau } from 'flo-bezier3';
|
|
2
|
+
import { squaredDistanceBetween } from 'flo-vector2d';
|
|
6
3
|
/**
|
|
7
4
|
* @hidden
|
|
8
5
|
* Finds an initial distance such that the closest point can not be further than
|
|
@@ -13,9 +10,9 @@ function getBestDistanceSquared(bezierPieces, p) {
|
|
|
13
10
|
for (let i = 0; i < bezierPieces.length; i++) {
|
|
14
11
|
let bezierPiece = bezierPieces[i];
|
|
15
12
|
let ps = bezierPiece.curve.ps;
|
|
16
|
-
let p1 =
|
|
17
|
-
let p2 =
|
|
18
|
-
let d = Math.min(
|
|
13
|
+
let p1 = evalDeCasteljau(ps, bezierPiece.ts[0]);
|
|
14
|
+
let p2 = evalDeCasteljau(ps, bezierPiece.ts[1]);
|
|
15
|
+
let d = Math.min(squaredDistanceBetween(p, p1), squaredDistanceBetween(p, p2));
|
|
19
16
|
if (d < bestSquaredDistance) {
|
|
20
17
|
bestSquaredDistance = d;
|
|
21
18
|
}
|
|
@@ -24,5 +21,5 @@ function getBestDistanceSquared(bezierPieces, p) {
|
|
|
24
21
|
// TODO - remove delta (or base it on theory)
|
|
25
22
|
return bestSquaredDistance * 1.01;
|
|
26
23
|
}
|
|
27
|
-
|
|
24
|
+
export { getBestDistanceSquared };
|
|
28
25
|
//# sourceMappingURL=get-best-distance-squared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-best-distance-squared.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-best-distance-squared.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-best-distance-squared.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-best-distance-squared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAItD;;;;GAIG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW;IAEf,IAAI,mBAAmB,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACnD,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAE9B,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAChD,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAEhD,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CACZ,sBAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,EAC7B,sBAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,CAChC,CAAC;QAEF,IAAI,CAAC,GAAG,mBAAmB,EAAE;YACzB,mBAAmB,GAAG,CAAC,CAAC;SAC3B;KACJ;IAED,mEAAmE;IACnE,6CAA6C;IAC7C,OAAO,mBAAmB,GAAG,IAAI,CAAC;AACtC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IPointOnShape } from '../../point-on-shape';
|
|
2
|
-
import { BezierPiece } from '../bezier-piece';
|
|
1
|
+
import { IPointOnShape } from '../../point-on-shape.js';
|
|
2
|
+
import { BezierPiece } from '../bezier-piece.js';
|
|
3
3
|
/**
|
|
4
4
|
* @hidden
|
|
5
5
|
* Returns the closest boundary point to the given point, limited to the given
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const point_on_shape_1 = require("../../point-on-shape");
|
|
6
|
-
const cull_bezier_pieces_1 = require("./cull-bezier-pieces");
|
|
7
|
-
const closest_points_on_curve_1 = require("./closest-points-on-curve");
|
|
1
|
+
import { distanceBetween } from 'flo-vector2d';
|
|
2
|
+
import { PointOnShape } from '../../point-on-shape.js';
|
|
3
|
+
import { cullBezierPieces } from './cull-bezier-pieces.js';
|
|
4
|
+
import { closestPointsOnCurve } from './closest-points-on-curve.js';
|
|
8
5
|
/**
|
|
9
6
|
* @hidden
|
|
10
7
|
* Returns the closest boundary point to the given point, limited to the given
|
|
@@ -19,18 +16,18 @@ function getCloseBoundaryPoints(bezierPieces, point, y, distance) {
|
|
|
19
16
|
let touchedCurve = y.curve;
|
|
20
17
|
let t = y.t;
|
|
21
18
|
let p_ = y.p;
|
|
22
|
-
bezierPieces =
|
|
19
|
+
bezierPieces = cullBezierPieces(bezierPieces, point);
|
|
23
20
|
// TODO - integrate with is-another-cp-closeby - we MUST check angle too!
|
|
24
21
|
let DISTANCE_TOLERANCE = 1e-9;
|
|
25
22
|
let posInfos = [];
|
|
26
23
|
for (let i = 0; i < bezierPieces.length; i++) {
|
|
27
24
|
let bezierPiece = bezierPieces[i];
|
|
28
25
|
// TOOD - important - should be able to return multiple points
|
|
29
|
-
let ps =
|
|
26
|
+
let ps = closestPointsOnCurve(bezierPiece.curve, point, bezierPiece.ts, touchedCurve, t);
|
|
30
27
|
//if (ps === undefined) { continue; }
|
|
31
28
|
for (let j = 0; j < ps.length; j++) {
|
|
32
29
|
let p = ps[j];
|
|
33
|
-
let d =
|
|
30
|
+
let d = distanceBetween(p.p, point);
|
|
34
31
|
let curve = bezierPiece.curve;
|
|
35
32
|
let t_ = p.t;
|
|
36
33
|
if (Math.abs(d - distance) < DISTANCE_TOLERANCE) {
|
|
@@ -38,7 +35,7 @@ function getCloseBoundaryPoints(bezierPieces, point, y, distance) {
|
|
|
38
35
|
t_ = 1;
|
|
39
36
|
curve = bezierPiece.curve.prev;
|
|
40
37
|
}
|
|
41
|
-
posInfos.push({ pos: new
|
|
38
|
+
posInfos.push({ pos: new PointOnShape(curve, t_), d });
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
41
|
}
|
|
@@ -80,5 +77,5 @@ function getCloseBoundaryPoints(bezierPieces, point, y, distance) {
|
|
|
80
77
|
}
|
|
81
78
|
return posInfos;
|
|
82
79
|
}
|
|
83
|
-
|
|
80
|
+
export { getCloseBoundaryPoints };
|
|
84
81
|
//# sourceMappingURL=get-close-boundary-points.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-close-boundary-points.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-close-boundary-points.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-close-boundary-points.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-close-boundary-points.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAiB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;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AAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;oBACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;oBAE/B,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;wBAC9B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAC/B;oBAEF,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;iBACxC;aACD;SACD;QACD,KAAK,IAAI,CAAC,GAAC,eAAe,CAAC,MAAM,GAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YAChD,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACzC;KACD;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Curve } from '../../curve';
|
|
2
|
-
import { IPointOnShape } from '../../point-on-shape';
|
|
3
|
-
import { BezierPiece } from '../bezier-piece';
|
|
1
|
+
import { Curve } from '../../curve.js';
|
|
2
|
+
import { IPointOnShape } from '../../point-on-shape.js';
|
|
3
|
+
import { BezierPiece } from '../bezier-piece.js';
|
|
4
4
|
/**
|
|
5
5
|
* @hidden
|
|
6
6
|
* Returns the closest boundary point to the given point, limited to the given
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const point_on_shape_1 = require("../../point-on-shape");
|
|
6
|
-
const cull_bezier_pieces_1 = require("./cull-bezier-pieces");
|
|
7
|
-
const closest_points_on_curve_1 = require("./closest-points-on-curve");
|
|
1
|
+
import { distanceBetween, getObjClosestTo } from 'flo-vector2d';
|
|
2
|
+
import { PointOnShape } from '../../point-on-shape.js';
|
|
3
|
+
import { cullBezierPieces } from './cull-bezier-pieces.js';
|
|
4
|
+
import { closestPointsOnCurve } from './closest-points-on-curve.js';
|
|
8
5
|
/**
|
|
9
6
|
* @hidden
|
|
10
7
|
* Returns the closest boundary point to the given point, limited to the given
|
|
@@ -16,17 +13,17 @@ const closest_points_on_curve_1 = require("./closest-points-on-curve");
|
|
|
16
13
|
* @param extreme
|
|
17
14
|
*/
|
|
18
15
|
function getClosestBoundaryPoint(bezierPieces, point, touchedCurve, t) {
|
|
19
|
-
bezierPieces =
|
|
16
|
+
bezierPieces = cullBezierPieces(bezierPieces, point);
|
|
20
17
|
let bestDistance = Number.POSITIVE_INFINITY;
|
|
21
18
|
let posInfo;
|
|
22
19
|
for (let i = 0; i < bezierPieces.length; i++) {
|
|
23
20
|
let bezierPiece = bezierPieces[i];
|
|
24
|
-
let ps =
|
|
25
|
-
let p =
|
|
21
|
+
let ps = closestPointsOnCurve(bezierPiece.curve, point, bezierPiece.ts, touchedCurve, t);
|
|
22
|
+
let p = getObjClosestTo(point, ps, p => p.p);
|
|
26
23
|
if (p === undefined) {
|
|
27
24
|
continue;
|
|
28
25
|
}
|
|
29
|
-
let d =
|
|
26
|
+
let d = distanceBetween(p.p, point);
|
|
30
27
|
let curve = bezierPiece.curve;
|
|
31
28
|
let t_ = p.t;
|
|
32
29
|
if (d < bestDistance) {
|
|
@@ -34,11 +31,11 @@ function getClosestBoundaryPoint(bezierPieces, point, touchedCurve, t) {
|
|
|
34
31
|
t_ = 1;
|
|
35
32
|
curve = bezierPiece.curve.prev;
|
|
36
33
|
}
|
|
37
|
-
posInfo = { pos: new
|
|
34
|
+
posInfo = { pos: new PointOnShape(curve, t_), d };
|
|
38
35
|
bestDistance = d;
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
38
|
return posInfo;
|
|
42
39
|
}
|
|
43
|
-
|
|
40
|
+
export { getClosestBoundaryPoint };
|
|
44
41
|
//# sourceMappingURL=get-closest-boundary-point.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-closest-boundary-point.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-closest-boundary-point.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-closest-boundary-point.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-closest-boundary-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAiB,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGpE;;;;;;;;;GASG;AACH,SAAS,uBAAuB,CACxB,YAA2B,EAC3B,KAAe,EACrB,YAAmB,EACnB,CAAS;IAEV,YAAY,GAAG,gBAAgB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAErD,IAAI,YAAY,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAC5C,IAAI,OAA0C,CAAC;IAC/C,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACzC,IAAI,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,EAAE,GAAG,oBAAoB,CAC3B,WAAW,CAAC,KAAK,EACjB,KAAK,EACL,WAAW,CAAC,EAAE,EACd,YAAY,EACZ,CAAC,CACF,CAAC;QAEF,IAAI,CAAC,GAAG,eAAe,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAE5C,IAAI,CAAC,KAAK,SAAS,EAAE;YAAE,SAAS;SAAE;QAElC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAEpC,IAAI,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;QAC9B,IAAI,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC;QAEZ,IAAI,CAAC,GAAG,YAAY,EAAE;YACrB,IAAI,EAAE,KAAK,CAAC,EAAE;gBACb,EAAE,GAAG,CAAC,CAAC;gBACP,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC;aAC/B;YAED,OAAO,GAAG,EAAE,GAAG,EAAE,IAAI,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;YAClD,YAAY,GAAG,CAAC,CAAC;SACjB;KACD;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAGD,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
package/node/mat/corner.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import LlRbTree from 'flo-ll-rb-tree';
|
|
2
|
-
import { CpNode } from '../cp-node';
|
|
3
|
-
import { Loop } from '../loop';
|
|
1
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
+
import { CpNode } from '../cp-node.js';
|
|
3
|
+
import { Loop } from '../loop.js';
|
|
4
4
|
/**
|
|
5
5
|
* @hidden
|
|
6
6
|
* @param cpNode
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.createNewCpTree = void 0;
|
|
4
|
-
const flo_ll_rb_tree_1 = require("flo-ll-rb-tree");
|
|
5
|
-
const cp_node_1 = require("../cp-node");
|
|
1
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
+
import { CpNode } from '../cp-node.js';
|
|
6
3
|
/**
|
|
7
4
|
* @hidden
|
|
8
5
|
* @param cpNode
|
|
@@ -15,12 +12,13 @@ function createNewCpTree(cpNode) {
|
|
|
15
12
|
let loop = cpNode.cp.pointOnShape.curve.loop;
|
|
16
13
|
let cpTree = newCpTrees.get(loop);
|
|
17
14
|
if (!cpTree) {
|
|
18
|
-
cpTree = new
|
|
15
|
+
// qqq cpTree = new LlRbTree(CpNode.comparator, [], true);
|
|
16
|
+
cpTree = new LlRbTree(CpNode.comparator, false);
|
|
19
17
|
newCpTrees.set(loop, cpTree);
|
|
20
18
|
}
|
|
21
19
|
cpTree.insert(cpNode);
|
|
22
20
|
}
|
|
23
21
|
return newCpTrees;
|
|
24
22
|
}
|
|
25
|
-
|
|
23
|
+
export { createNewCpTree };
|
|
26
24
|
//# sourceMappingURL=create-new-cp-tree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-new-cp-tree.js","sourceRoot":"","sources":["../../src/mat/create-new-cp-tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-new-cp-tree.js","sourceRoot":"","sources":["../../src/mat/create-new-cp-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAIvC;;;GAGG;AACH,SAAS,eAAe,CAAC,MAAc;IACtC,IAAI,UAAU,GAA+B,IAAI,GAAG,EAAE,CAAC;IAEvD,IAAI,GAAG,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;IAEhC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAEf,SAAS,CAAC,CAAC,MAAc;QACxB,IAAI,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC;QAC7C,IAAI,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,MAAM,EAAE;YACZ,2DAA2D;YAC3D,MAAM,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YAChD,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SAC7B;QACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import LlRbTree from 'flo-ll-rb-tree';
|
|
2
|
-
import { Loop } from '../../loop';
|
|
3
|
-
import { IPointOnShape } from '../../point-on-shape';
|
|
4
|
-
import { CpNode } from '../../cp-node';
|
|
1
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
+
import { Loop } from '../../loop.js';
|
|
3
|
+
import { IPointOnShape } from '../../point-on-shape.js';
|
|
4
|
+
import { CpNode } from '../../cp-node.js';
|
|
5
5
|
/**
|
|
6
6
|
* @hidden
|
|
7
7
|
* Add a 1-prong to the MAT.
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const point_on_shape_1 = require("../../point-on-shape");
|
|
5
|
-
const add_to_cp_graph_1 = require("../add-to-cp-graph");
|
|
6
|
-
const is_another_cp_closeby_1 = require("../is-another-cp-closeby");
|
|
1
|
+
import { getOsculatingCircle, calcPosOrder, isPosDullCorner } from '../../point-on-shape.js';
|
|
2
|
+
import { addToCpGraph } from '../add-to-cp-graph.js';
|
|
3
|
+
import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
|
|
7
4
|
/**
|
|
8
5
|
* @hidden
|
|
9
6
|
* Add a 1-prong to the MAT.
|
|
@@ -12,7 +9,7 @@ const is_another_cp_closeby_1 = require("../is-another-cp-closeby");
|
|
|
12
9
|
*/
|
|
13
10
|
function add1Prong(maxOsculatingCircleRadius, cpGraphs, pos) {
|
|
14
11
|
//if (PointOnShape.isDullCorner(pos)) {
|
|
15
|
-
if (
|
|
12
|
+
if (isPosDullCorner(pos)) {
|
|
16
13
|
// This is a 1-prong at a dull corner.
|
|
17
14
|
// TODO IMPORTANT
|
|
18
15
|
// Remove this line, uncomment piece below it and implement the
|
|
@@ -29,18 +26,18 @@ function add1Prong(maxOsculatingCircleRadius, cpGraphs, pos) {
|
|
|
29
26
|
return;
|
|
30
27
|
}
|
|
31
28
|
//let circle = PointOnShape.getOsculatingCircle(maxOsculatingCircleRadius, pos);
|
|
32
|
-
let circle =
|
|
29
|
+
let circle = getOsculatingCircle(maxOsculatingCircleRadius, pos);
|
|
33
30
|
//let order = PointOnShape.calcOrder(circle, pos);
|
|
34
|
-
let order =
|
|
31
|
+
let order = calcPosOrder(circle, pos);
|
|
35
32
|
// Make sure there isn't already a ContactPoint close by - it can cause
|
|
36
33
|
// floating point stability issues.
|
|
37
|
-
if (
|
|
34
|
+
if (isAnotherCpCloseby(cpGraphs, pos, circle, order, 0, 1000, 'magenta')) {
|
|
38
35
|
return;
|
|
39
36
|
}
|
|
40
|
-
|
|
37
|
+
addToCpGraph(circle, [-0.5, +0.5], cpGraphs, [pos, pos]);
|
|
41
38
|
if (typeof _debug_ !== 'undefined') {
|
|
42
39
|
_debug_.generated.elems.oneProng.push(pos);
|
|
43
40
|
}
|
|
44
41
|
}
|
|
45
|
-
|
|
42
|
+
export { add1Prong };
|
|
46
43
|
//# sourceMappingURL=add-1-prong.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-1-prong.js","sourceRoot":"","sources":["../../../src/mat/find-mat/add-1-prong.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-1-prong.js","sourceRoot":"","sources":["../../../src/mat/find-mat/add-1-prong.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,eAAe,EAAiB,MAAM,yBAAyB,CAAC;AAE5G,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGjE;;;;;GAKG;AACH,SAAS,SAAS,CAChB,yBAAiC,EAC3B,QAAoC,EACpC,GAAkB;IAEzB,uCAAuC;IACpC,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE;QAC5B,sCAAsC;QAEtC,kBAAkB;QAClB,gEAAgE;QAChE,wEAAwE;QACxE,mEAAmE;QACnE,mEAAmE;QACnE,qEAAqE;QAC/D,kEAAkE;QAClE,oEAAoE;QAE1E,kCAAkC;QAElC,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;YAC1B,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAC1D;QAEP,OAAO;KACP;IAED,gFAAgF;IAChF,IAAI,MAAM,GAAG,mBAAmB,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;IAEjE,kDAAkD;IAClD,IAAI,KAAK,GAAG,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACtC,uEAAuE;IACvE,mCAAmC;IACnC,IAAI,kBAAkB,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE;QACzE,OAAO;KACP;IAEE,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAE5D,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QAC7B,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC9C;AACL,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import LlRbTree from 'flo-ll-rb-tree';
|
|
2
|
-
import { Loop } from '../../loop';
|
|
3
|
-
import { CpNode } from '../../cp-node';
|
|
4
|
-
import { Circle } from '../../circle';
|
|
5
|
-
import { IPointOnShape } from '../../point-on-shape';
|
|
1
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
+
import { Loop } from '../../loop.js';
|
|
3
|
+
import { CpNode } from '../../cp-node.js';
|
|
4
|
+
import { Circle } from '../../circle.js';
|
|
5
|
+
import { IPointOnShape } from '../../point-on-shape.js';
|
|
6
6
|
/**
|
|
7
7
|
* @hidden
|
|
8
8
|
* Adds a 2-prong contact circle to the shape.
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const point_on_shape_1 = require("../../point-on-shape");
|
|
7
|
-
const is_another_cp_closeby_1 = require("../is-another-cp-closeby");
|
|
8
|
-
const get_neighboring_cps_1 = require("../get-neighboring-cps");
|
|
1
|
+
import { exponent } from 'big-float-ts';
|
|
2
|
+
import { CpNode } from '../../cp-node.js';
|
|
3
|
+
import { PointOnShape, calcPosOrder } from '../../point-on-shape.js';
|
|
4
|
+
import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
|
|
5
|
+
import { getNeighbouringPoints } from '../get-neighboring-cps.js';
|
|
9
6
|
/**
|
|
10
7
|
* @hidden
|
|
11
8
|
* Adds a 2-prong contact circle to the shape.
|
|
@@ -19,18 +16,18 @@ const get_neighboring_cps_1 = require("../get-neighboring-cps");
|
|
|
19
16
|
*/
|
|
20
17
|
function add2Prong(cpGraphs, circle, posSource, posAntipodes, holeClosing, extreme) {
|
|
21
18
|
//let orderSource = PointOnShape.calcOrder(circle, posSource);
|
|
22
|
-
let orderSource =
|
|
19
|
+
let orderSource = calcPosOrder(circle, posSource);
|
|
23
20
|
let orderAntipodes = posAntipodes.map(posAntipode => {
|
|
24
21
|
//console.log(circle.center)
|
|
25
22
|
//return PointOnShape.calcOrder(circle, posAntipode.pos);
|
|
26
|
-
return
|
|
23
|
+
return calcPosOrder(circle, posAntipode.pos);
|
|
27
24
|
});
|
|
28
25
|
let t_s = posSource.t;
|
|
29
26
|
let curve;
|
|
30
27
|
if (t_s === 0) {
|
|
31
28
|
t_s = 1;
|
|
32
29
|
curve = posSource.curve.prev;
|
|
33
|
-
posSource = new
|
|
30
|
+
posSource = new PointOnShape(curve, t_s);
|
|
34
31
|
}
|
|
35
32
|
// Make sure there isn't already a ContactPoint close by - it can cause
|
|
36
33
|
// floating point stability issues.
|
|
@@ -39,12 +36,12 @@ function add2Prong(cpGraphs, circle, posSource, posAntipodes, holeClosing, extre
|
|
|
39
36
|
for (let i = 0; i < posAntipodes.length; i++) {
|
|
40
37
|
let posAntipode = posAntipodes[i];
|
|
41
38
|
let orderAntipode = orderAntipodes[i];
|
|
42
|
-
if (
|
|
39
|
+
if (isAnotherCpCloseby(cpGraphs, posAntipode.pos, circle, orderAntipode, 0, extreme, 'red')) {
|
|
43
40
|
isCloseByAntipodes = true;
|
|
44
41
|
break;
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
|
-
if (
|
|
44
|
+
if (isAnotherCpCloseby(cpGraphs, posSource, circle, orderSource, 0, extreme, 'red') ||
|
|
48
45
|
isCloseByAntipodes) {
|
|
49
46
|
if (typeof _debug_ !== 'undefined') {
|
|
50
47
|
if (holeClosing) {
|
|
@@ -71,16 +68,16 @@ function add2Prong(cpGraphs, circle, posSource, posAntipodes, holeClosing, extre
|
|
|
71
68
|
loopAntipodes.push(loopAntipode);
|
|
72
69
|
let cpTreeAntipode = cpGraphs.get(loopAntipode);
|
|
73
70
|
cpTreeAntipodes.push(cpTreeAntipode);
|
|
74
|
-
let deltaAntipode =
|
|
71
|
+
let deltaAntipode = getNeighbouringPoints(cpTreeAntipode, posAntipode.pos, orderAntipode, 0);
|
|
75
72
|
deltaAntipodes.push(deltaAntipode);
|
|
76
|
-
newCpAntipodes.push(
|
|
73
|
+
newCpAntipodes.push(CpNode.insert(holeClosing, false, cpTreeAntipode, cpAntipode, deltaAntipode[0]));
|
|
77
74
|
}
|
|
78
75
|
// Source
|
|
79
76
|
let cpSource = { pointOnShape: posSource, circle, order: orderSource, order2: 0 };
|
|
80
77
|
let loopSource = posSource.curve.loop;
|
|
81
78
|
let cpTreeSource = cpGraphs.get(loopSource);
|
|
82
|
-
let deltaSource =
|
|
83
|
-
let newCpSource =
|
|
79
|
+
let deltaSource = getNeighbouringPoints(cpTreeSource, posSource, orderSource, 0);
|
|
80
|
+
let newCpSource = CpNode.insert(holeClosing, false, cpTreeSource, cpSource, deltaSource[0]);
|
|
84
81
|
// Connect graph
|
|
85
82
|
if (newCpAntipodes.length === 1) {
|
|
86
83
|
newCpSource.prevOnCircle = newCpAntipodes[0];
|
|
@@ -107,9 +104,9 @@ function add2Prong(cpGraphs, circle, posSource, posAntipodes, holeClosing, extre
|
|
|
107
104
|
// TODO - important - take care of case where there are more than 1 antipode
|
|
108
105
|
// Duplicate ContactPoints
|
|
109
106
|
let cpB2 = { pointOnShape: posAntipodes[0].pos, circle, order: cpAntipodes[0].order, order2: +1 };
|
|
110
|
-
let newCpB2Node =
|
|
107
|
+
let newCpB2Node = CpNode.insert(true, false, cpTreeAntipodes[0], cpB2, newCpAntipodes[0]);
|
|
111
108
|
let cpB1 = { pointOnShape: posSource, circle, order: cpSource.order, order2: -1 };
|
|
112
|
-
let newCpB1Node =
|
|
109
|
+
let newCpB1Node = CpNode.insert(true, false, cpTreeSource, cpB1, newCpSource.prev);
|
|
113
110
|
// Connect graph
|
|
114
111
|
newCpB1Node.prevOnCircle = newCpB2Node;
|
|
115
112
|
newCpB1Node.nextOnCircle = newCpB2Node;
|
|
@@ -136,10 +133,9 @@ function add2Prong(cpGraphs, circle, posSource, posAntipodes, holeClosing, extre
|
|
|
136
133
|
}
|
|
137
134
|
return newCpSource;
|
|
138
135
|
}
|
|
139
|
-
exports.add2Prong = add2Prong;
|
|
140
136
|
/** @hidden */
|
|
141
137
|
function scale(n, exp) {
|
|
142
|
-
return n * (
|
|
138
|
+
return n * (2 ** -(exp + 1));
|
|
143
139
|
}
|
|
144
140
|
/** @hidden */
|
|
145
141
|
function getSize(x, y) {
|
|
@@ -175,7 +171,7 @@ function getSize(x, y) {
|
|
|
175
171
|
function byAngle(circle) {
|
|
176
172
|
let c = circle.center;
|
|
177
173
|
let r = circle.radius;
|
|
178
|
-
let exp =
|
|
174
|
+
let exp = exponent(r);
|
|
179
175
|
return function (_a, _b) {
|
|
180
176
|
let a = _a.cp.pointOnShape.p;
|
|
181
177
|
let b = _b.cp.pointOnShape.p;
|
|
@@ -193,4 +189,5 @@ function byAngle(circle) {
|
|
|
193
189
|
return sb - sa;
|
|
194
190
|
};
|
|
195
191
|
}
|
|
192
|
+
export { add2Prong };
|
|
196
193
|
//# sourceMappingURL=add-2-prong.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-2-prong.js","sourceRoot":"","sources":["../../../src/mat/find-mat/add-2-prong.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-2-prong.js","sourceRoot":"","sources":["../../../src/mat/find-mat/add-2-prong.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,EAAE,MAAM,EAAQ,MAAM,kBAAkB,CAAC;AAGhD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAiB,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAIlE;;;;;;;;;;GAUG;AACH,SAAS,SAAS,CAChB,QAA0C,EACpC,MAAsB,EACtB,SAA6B,EACnC,YAAmD,EACnD,WAAuB,EACvB,OAAsB;IAEvB,gEAAgE;IAChE,IAAI,WAAW,GAAK,YAAY,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACpD,IAAI,cAAc,GAAG,YAAY,CAAC,GAAG,CACpC,WAAW,CAAC,EAAE;QACb,4BAA4B;QAC5B,yDAAyD;QACzD,OAAO,YAAY,CAAC,MAAM,E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,IAAI,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACzB,IAAI,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAEzB,OAAO,EAAE,GAAG,EAAE,CAAC;IAChB,CAAC,CAAA;AACF,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import LlRbTree from 'flo-ll-rb-tree';
|
|
2
|
-
import { CpNode } from '../../cp-node';
|
|
3
|
-
import { Loop } from '../../loop';
|
|
4
|
-
import { Circle } from '../../circle';
|
|
5
|
-
import { IPointOnShape } from '../../point-on-shape';
|
|
1
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
+
import { CpNode } from '../../cp-node.js';
|
|
3
|
+
import { Loop } from '../../loop.js';
|
|
4
|
+
import { Circle } from '../../circle.js';
|
|
5
|
+
import { IPointOnShape } from '../../point-on-shape.js';
|
|
6
6
|
/**
|
|
7
7
|
* @hidden
|
|
8
8
|
* Adds a 3-prong MAT circle according to the 3 given (previously calculated)
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.add3Prong = void 0;
|
|
4
|
-
const add_to_cp_graph_1 = require("../add-to-cp-graph");
|
|
5
|
-
const is_another_cp_closeby_1 = require("../is-another-cp-closeby");
|
|
1
|
+
import { addToCpGraph } from '../add-to-cp-graph.js';
|
|
2
|
+
import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
|
|
6
3
|
/**
|
|
7
4
|
* @hidden
|
|
8
5
|
* Adds a 3-prong MAT circle according to the 3 given (previously calculated)
|
|
@@ -48,11 +45,11 @@ function add3Prong(cpTrees, orders, threeProng) {
|
|
|
48
45
|
}
|
|
49
46
|
*/
|
|
50
47
|
// TODO - replace 1000 below with correct value
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
isAnotherCpCloseby(cpTrees, poss[0], circle, orders[0], 0, 1000, 'blue');
|
|
49
|
+
isAnotherCpCloseby(cpTrees, poss[1], circle, orders[1], 0, 1000, 'blue');
|
|
50
|
+
isAnotherCpCloseby(cpTrees, poss[2], circle, orders[2], 0, 1000, 'blue');
|
|
51
|
+
addToCpGraph(circle, orders, cpTrees, poss, δ3s);
|
|
55
52
|
return circle;
|
|
56
53
|
}
|
|
57
|
-
|
|
54
|
+
export { add3Prong };
|
|
58
55
|
//# sourceMappingURL=add-3-prong.js.map
|