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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-3-prong.js","sourceRoot":"","sources":["../../../src/mat/find-mat/add-3-prong.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-3-prong.js","sourceRoot":"","sources":["../../../src/mat/find-mat/add-3-prong.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGjE;;;;;;;GAOG;AACH,SAAS,SAAS,CAChB,OAAmC,EACnC,MAAgB,EAChB,UAIC;IAEF,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC;IAE3C,uCAAuC;IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgCE;IAEF,+CAA+C;IAC/C,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACzE,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACzE,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAEzE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;IAEjD,OAAO,MAAM,CAAC;AACf,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const flo_bezier3_1 = require("flo-bezier3");
|
|
5
|
-
const curve_1 = require("../../curve");
|
|
1
|
+
import { getBoundingHull, getBoundingBoxTight } from 'flo-bezier3';
|
|
2
|
+
import { getCornerAtEnd } from '../../curve.js';
|
|
3
|
+
import { getBoundingBox_ } from '../../get-bounding-box-.js';
|
|
6
4
|
if (typeof _debug_ !== 'undefined') {
|
|
7
5
|
var timingStart;
|
|
8
6
|
}
|
|
@@ -22,13 +20,13 @@ function addDebugInfo1(loops) {
|
|
|
22
20
|
let i = 0;
|
|
23
21
|
loop.curves.forEach(function (curve) {
|
|
24
22
|
let ps = curve.ps;
|
|
25
|
-
let hull =
|
|
23
|
+
let hull = getBoundingHull(ps);
|
|
26
24
|
generated.elems.boundingHull.push(hull);
|
|
27
|
-
let looseBoundingBox =
|
|
25
|
+
let looseBoundingBox = getBoundingBox_(ps);
|
|
28
26
|
generated.elems.looseBoundingBox.push(looseBoundingBox);
|
|
29
|
-
let tightBoundingBox =
|
|
27
|
+
let tightBoundingBox = getBoundingBoxTight(ps);
|
|
30
28
|
generated.elems.tightBoundingBox.push(tightBoundingBox);
|
|
31
|
-
let corner =
|
|
29
|
+
let corner = getCornerAtEnd(curve);
|
|
32
30
|
if (corner.isSharp) {
|
|
33
31
|
generated.elems.sharpCorner.push(curve);
|
|
34
32
|
}
|
|
@@ -39,7 +37,6 @@ function addDebugInfo1(loops) {
|
|
|
39
37
|
});
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
|
-
exports.addDebugInfo1 = addDebugInfo1;
|
|
43
40
|
/** @hidden */
|
|
44
41
|
function addDebugInfo2() {
|
|
45
42
|
if (typeof _debug_ === 'undefined') {
|
|
@@ -50,7 +47,6 @@ function addDebugInfo2() {
|
|
|
50
47
|
timing.holeClosers += now - timingStart;
|
|
51
48
|
timingStart = now;
|
|
52
49
|
}
|
|
53
|
-
exports.addDebugInfo2 = addDebugInfo2;
|
|
54
50
|
function addDebugInfo3() {
|
|
55
51
|
if (typeof _debug_ === 'undefined') {
|
|
56
52
|
return;
|
|
@@ -61,7 +57,6 @@ function addDebugInfo3() {
|
|
|
61
57
|
timing.oneAnd2Prongs += now - timingStart;
|
|
62
58
|
timingStart = now;
|
|
63
59
|
}
|
|
64
|
-
exports.addDebugInfo3 = addDebugInfo3;
|
|
65
60
|
function addDebugInfo4(mat) {
|
|
66
61
|
if (typeof _debug_ === 'undefined') {
|
|
67
62
|
return;
|
|
@@ -71,5 +66,5 @@ function addDebugInfo4(mat) {
|
|
|
71
66
|
generated.elems.mat.push(mat);
|
|
72
67
|
timing.threeProngs += performance.now() - timingStart;
|
|
73
68
|
}
|
|
74
|
-
|
|
69
|
+
export { addDebugInfo1, addDebugInfo2, addDebugInfo3, addDebugInfo4 };
|
|
75
70
|
//# sourceMappingURL=add-debug-info.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-debug-info.js","sourceRoot":"","sources":["../../../src/mat/find-mat/add-debug-info.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-debug-info.js","sourceRoot":"","sources":["../../../src/mat/find-mat/add-debug-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGnE,OAAO,EAAS,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAO7D,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;IAChC,IAAI,WAAmB,CAAC;CAC3B;AAGD,cAAc;AACd,SAAS,aAAa,CAAC,KAAa;IAChC,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;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AI,OAAO,OAAO,KAAK,WAAW,EAAE;QAAE,OAAO;KAAE;IAE/C,IAAI,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;IACtC,IAAI,GAAG,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAC5B,MAAM,CAAC,WAAW,IAAI,GAAG,GAAG,WAAW,CAAC;IACxC,WAAW,GAAG,GAAG,CAAC;AACtB,CAAC;AAGD,SAAS,aAAa;IAClB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QAAE,OAAO;KAAE;IAE/C,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAClC,IAAI,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;IAC9B,IAAI,GAAG,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAE5B,MAAM,CAAC,aAAa,IAAI,GAAG,GAAG,WAAW,CAAC;IAC1C,WAAW,GAAG,GAAG,CAAC;AACtB,CAAC;AAGD,SAAS,aAAa,CAAC,GAAQ;IAC3B,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QAAE,OAAO;KAAE;IAE/C,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IAClC,IAAI,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;IAE9B,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE9B,MAAM,CAAC,WAAW,IAAI,WAAW,CAAC,GAAG,EAAE,GAAG,WAAW,CAAC;AAC1D,CAAC;AAGD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Loop } from '../../loop';
|
|
2
|
-
import { IPointOnShape } from '../../point-on-shape';
|
|
1
|
+
import { Loop } from '../../loop.js';
|
|
2
|
+
import { IPointOnShape } from '../../point-on-shape.js';
|
|
3
3
|
/**
|
|
4
4
|
* @hidden
|
|
5
5
|
* Get useful points on the shape - these incude points of maximum curvature and
|
|
@@ -7,5 +7,5 @@ import { IPointOnShape } from '../../point-on-shape';
|
|
|
7
7
|
* @param loop
|
|
8
8
|
* @param additionalPointCount
|
|
9
9
|
*/
|
|
10
|
-
declare function getInterestingPointsOnLoop(minBezLength: number,
|
|
10
|
+
declare function getInterestingPointsOnLoop(minBezLength: number, maxCurviness: number, maxLength: number): (loop: Loop) => IPointOnShape[];
|
|
11
11
|
export { getInterestingPointsOnLoop };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const get_contact_circles_at_interface_1 = require("../get-contact-circles-at-interface");
|
|
5
|
-
const flo_bezier3_1 = require("flo-bezier3");
|
|
6
|
-
const point_on_shape_1 = require("../../point-on-shape");
|
|
1
|
+
import { getCurvatureExtrema, splitByCurvatureAndLength, controlPointLinesLength } from 'flo-bezier3';
|
|
2
|
+
import { getContactCirclesAtInterface } from '../get-contact-circles-at-interface.js';
|
|
3
|
+
import { PointOnShape, comparePoss } from '../../point-on-shape.js';
|
|
7
4
|
/**
|
|
8
5
|
* @hidden
|
|
9
6
|
* Get useful points on the shape - these incude points of maximum curvature and
|
|
@@ -11,29 +8,45 @@ const point_on_shape_1 = require("../../point-on-shape");
|
|
|
11
8
|
* @param loop
|
|
12
9
|
* @param additionalPointCount
|
|
13
10
|
*/
|
|
14
|
-
function getInterestingPointsOnLoop(minBezLength,
|
|
11
|
+
function getInterestingPointsOnLoop(minBezLength, maxCurviness, maxLength) {
|
|
15
12
|
return function (loop) {
|
|
16
13
|
let allPoints = [];
|
|
17
14
|
for (let i = 0; i < loop.curves.length; i++) {
|
|
18
15
|
let curve = loop.curves[i];
|
|
19
|
-
if (
|
|
16
|
+
// qqq if (lengthSquaredUpperBound(curve.ps) < minBezLength) {
|
|
17
|
+
if (controlPointLinesLength(curve.ps) < minBezLength) {
|
|
20
18
|
continue;
|
|
21
19
|
}
|
|
22
|
-
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
let
|
|
20
|
+
/*
|
|
21
|
+
let { maxCurvatureTs, maxNegativeCurvatureTs } =
|
|
22
|
+
getCurvatureExtrema(curve.ps);
|
|
23
|
+
let maxCurvatures = maxCurvatureTs.map(t => new PointOnShape(curve, t));
|
|
24
|
+
let maxNegativeCurvatures = maxNegativeCurvatureTs.map(t => new PointOnShape(curve, t));
|
|
25
|
+
|
|
26
|
+
allPoints.push(
|
|
27
|
+
...getContactCirclesAtInterface(curve),
|
|
28
|
+
...maxCurvatures,
|
|
29
|
+
...maxNegativeCurvatures
|
|
30
|
+
);
|
|
31
|
+
*/
|
|
32
|
+
// let { maxima } = getCurvatureExtrema(curve.ps);
|
|
33
|
+
// qqq let { maxCurvatureTs, maxNegativeCurvatureTs } = getCurvatureExtrema(curve.ps);
|
|
34
|
+
let { maxima } = getCurvatureExtrema(curve.ps);
|
|
35
|
+
// let maxAbsCurvatures = maxima.map(t => new PointOnShape(curve, t));
|
|
36
|
+
// qqq let maxAbsCurvatures = [...maxCurvatureTs, ...maxNegativeCurvatureTs].map(t => new PointOnShape(curve, t));
|
|
37
|
+
let maxAbsCurvatures = [...maxima].map(t => new PointOnShape(curve, t));
|
|
38
|
+
allPoints.push(...getContactCirclesAtInterface(curve), ...maxAbsCurvatures);
|
|
39
|
+
let ts = splitByCurvatureAndLength(curve.ps, maxCurviness, maxLength);
|
|
27
40
|
if (ts.length === 2) {
|
|
28
41
|
ts = [0, 0.5, 1];
|
|
29
42
|
}
|
|
30
43
|
for (let i = 1; i < ts.length - 1; i++) {
|
|
31
|
-
allPoints.push(new
|
|
44
|
+
allPoints.push(new PointOnShape(curve, ts[i]));
|
|
32
45
|
}
|
|
33
46
|
}
|
|
34
|
-
allPoints.sort(
|
|
47
|
+
allPoints.sort(comparePoss);
|
|
35
48
|
return allPoints;
|
|
36
49
|
};
|
|
37
50
|
}
|
|
38
|
-
|
|
51
|
+
export { getInterestingPointsOnLoop };
|
|
39
52
|
//# sourceMappingURL=create-get-interesting-points-on-loop.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-get-interesting-points-on-loop.js","sourceRoot":"","sources":["../../../src/mat/find-mat/create-get-interesting-points-on-loop.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-get-interesting-points-on-loop.js","sourceRoot":"","sources":["../../../src/mat/find-mat/create-get-interesting-points-on-loop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtG,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAEtF,OAAO,EAAE,YAAY,EAAE,WAAW,EAAiB,MAAM,yBAAyB,CAAC;AAGnF;;;;;;GAMG;AACH,SAAS,0BAA0B,CAC3B,YAAoB,EACpB,YAAoB,EACpB,SAAiB;IAErB,OAAO,UAAS,IAAU;QACtB,IAAI,SAAS,GAAoB,EAAE,CAAC;QAEpC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAE3B,8DAA8D;YAC9D,IAAI,uBAAuB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE;gBAClD,SAAS;aACZ;YAGD;;;;;;;;;;;cAWE;YAEF,kDAAkD;YAClD,sFAAsF;YACtF,IAAI,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC/C,sEAAsE;YACtE,kHAAkH;YAClH,IAAI,gBAAgB,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;YAExE,SAAS,CAAC,IAAI,CACV,GAAG,4BAA4B,CAAC,KAAK,CAAC,EACtC,GAAG,gBAAgB,CACtB,CAAC;YAEF,IAAI,EAAE,GAAG,yBAAyB,CAAC,KAAK,CAAC,EAAE,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;YACtE,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;gBACjB,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;aACpB;YAED,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,EAAE,CAAC,MAAM,GAAC,CAAC,EAAE,CAAC,EAAE,EAAE;gBAC9B,SAAS,CAAC,IAAI,CAAE,IAAI,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC;aACpD;SACJ;QAED,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAE5B,OAAO,SAAS,CAAC;IACrB,CAAC,CAAA;AACL,CAAC;AAGD,OAAO,EAAE,0BAA0B,EAAE,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import LlRbTree from 'flo-ll-rb-tree';
|
|
2
|
-
import { Loop } from '../../loop';
|
|
3
|
-
import { CpNode } from '../../cp-node';
|
|
4
|
-
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 { IPointOnShape } from '../../point-on-shape.js';
|
|
5
5
|
/**
|
|
6
6
|
* @hidden
|
|
7
7
|
* Creates the initial ContactPoint loops from the given sharp corners.
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.createInitialCpGraph = 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
|
* Creates the initial ContactPoint loops from the given sharp corners.
|
|
@@ -14,7 +11,8 @@ xMap: Map<number[][],{ ps: number[][] }>*/) {
|
|
|
14
11
|
let cpNode;
|
|
15
12
|
for (let k = 0; k < sharpCornerss.length; k++) {
|
|
16
13
|
let sharpCorners = sharpCornerss[k];
|
|
17
|
-
let cpTree = new
|
|
14
|
+
// qqq let cpTree = new LlRbTree(CpNode.comparator, [], true);
|
|
15
|
+
let cpTree = new LlRbTree(CpNode.comparator, false);
|
|
18
16
|
let cpNode1 = undefined;
|
|
19
17
|
let cpNode2 = undefined;
|
|
20
18
|
for (let pos of sharpCorners) {
|
|
@@ -24,8 +22,8 @@ xMap: Map<number[][],{ ps: number[][] }>*/) {
|
|
|
24
22
|
let circle = { center: pos.p, radius: 0 };
|
|
25
23
|
let cp1 = { pointOnShape: pos, circle, order: -1, order2: 0 };
|
|
26
24
|
let cp2 = { pointOnShape: pos, circle, order: +1, order2: 0 };
|
|
27
|
-
cpNode1 =
|
|
28
|
-
cpNode2 =
|
|
25
|
+
cpNode1 = CpNode.insert(false, /*isIntersection*/ false, cpTree, cp1, cpNode2);
|
|
26
|
+
cpNode2 = CpNode.insert(false, /*isIntersection*/ false, cpTree, cp2, cpNode1);
|
|
29
27
|
cpNode1.prevOnCircle = cpNode2;
|
|
30
28
|
cpNode2.prevOnCircle = cpNode1;
|
|
31
29
|
cpNode1.nextOnCircle = cpNode2;
|
|
@@ -39,5 +37,5 @@ xMap: Map<number[][],{ ps: number[][] }>*/) {
|
|
|
39
37
|
}
|
|
40
38
|
return cpNode;
|
|
41
39
|
}
|
|
42
|
-
|
|
40
|
+
export { createInitialCpGraph };
|
|
43
41
|
//# sourceMappingURL=create-initial-cp-graph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-initial-cp-graph.js","sourceRoot":"","sources":["../../../src/mat/find-mat/create-initial-cp-graph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-initial-cp-graph.js","sourceRoot":"","sources":["../../../src/mat/find-mat/create-initial-cp-graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAK1C;;;;;GAKG;AACH,SAAS,oBAAoB,CACrB,KAAa,EACb,OAAoC,EACpC,aAAgC,CAAA;0CACU;IAE9C,IAAI,MAAM,CAAC;IAEX,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,IAAI,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;QAEpC,8DAA8D;QAC9D,IAAI,MAAM,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAEpD,IAAI,OAAO,GAAG,SAAS,CAAC;QACxB,IAAI,OAAO,GAAG,SAAS,CAAC;QACxB,KAAK,IAAI,GAAG,IAAI,YAAY,EAAE;YAC1B,IAAI,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,uBAAuB;YACvB,2BAA2B;YAE3B,IAAI,MAAM,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;YAE1C,IAAI,GAAG,GAAiB,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;YAC5E,IAAI,GAAG,GAAiB,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;YAE5E,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;YAC/E,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;YAE/E,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;YAC/B,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;YAE/B,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;YAC/B,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;SAClC;QAED,IAAI,CAAC,MAAM,EAAE;YAAE,MAAM,GAAG,OAAO,CAAC;SAAE;QAElC,IAAI,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAC7B;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAGD,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IPointOnShape } from
|
|
2
|
-
import { Circle } from
|
|
3
|
-
import { CpNode } from
|
|
4
|
-
import { BezierPiece } from '../../bezier-piece';
|
|
5
|
-
import { TXForDebugging } from './x-for-debugging';
|
|
1
|
+
import { IPointOnShape } from '../../../point-on-shape.js';
|
|
2
|
+
import { Circle } from '../../../circle.js';
|
|
3
|
+
import { CpNode } from '../../../cp-node.js';
|
|
4
|
+
import { BezierPiece } from '../../bezier-piece.js';
|
|
5
|
+
import { TXForDebugging } from './x-for-debugging.js';
|
|
6
6
|
/** @hidden */
|
|
7
7
|
declare function addDebugInfo(bezierPieces: BezierPiece[], failed: boolean, pos: IPointOnShape, circle: Circle, z: IPointOnShape, δ: CpNode[], xs: TXForDebugging[], holeClosing: boolean): void;
|
|
8
8
|
export { addDebugInfo };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addDebugInfo = void 0;
|
|
4
|
-
const get_two_prong_type_1 = require("../../get-two-prong-type");
|
|
1
|
+
import { getTwoProngType } from '../../get-two-prong-type.js';
|
|
5
2
|
/** @hidden */
|
|
6
3
|
function addDebugInfo(bezierPieces, failed, pos, circle, z, δ, xs, holeClosing) {
|
|
7
4
|
let twoProng = {
|
|
@@ -18,8 +15,8 @@ function addDebugInfo(bezierPieces, failed, pos, circle, z, δ, xs, holeClosing)
|
|
|
18
15
|
deleted: false,
|
|
19
16
|
cpNode: undefined
|
|
20
17
|
};
|
|
21
|
-
let twoProngType =
|
|
18
|
+
let twoProngType = getTwoProngType(twoProng);
|
|
22
19
|
_debug_.generated.elems[twoProngType].push(twoProng);
|
|
23
20
|
}
|
|
24
|
-
|
|
21
|
+
export { addDebugInfo };
|
|
25
22
|
//# sourceMappingURL=add-debug-info.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-debug-info.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-2-prong/add-debug-info.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-debug-info.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-2-prong/add-debug-info.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAK9D,cAAc;AACd,SAAS,YAAY,CACb,YAA2B,EAC3B,MAAe,EACf,GAAkB,EAClB,MAAc,EACd,CAAgB,EAChB,CAAW,EACX,EAAoB,EACpB,WAAoB;IAExB,IAAI,QAAQ,GAAyB;QAC7B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,YAAY;QACZ,GAAG;QACH,CAAC;QACD,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;QACtB,MAAM;QACN,EAAE;QACF,MAAM;QACN,WAAW;QACX,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,SAAS;KACxB,CAAC;IAEF,IAAI,YAAY,GAAG,eAAe,CAAC,QAAQ,CAAsB,CAAC;IAClE,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzD,CAAC;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.cullBezierPieces = 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 { getClosestSquareDistanceToRect } from '../../geometry/get-closest-square-distance-to-rect.js';
|
|
2
|
+
import { getBoundingBox_ } from '../../../get-bounding-box-.js';
|
|
6
3
|
/**
|
|
7
4
|
* @hidden
|
|
8
5
|
* Cull all bezierPieces not within given radius of a given point.
|
|
@@ -21,13 +18,13 @@ function cullBezierPieces(bezierPieces, p, rSquared) {
|
|
|
21
18
|
let newPieces = [];
|
|
22
19
|
for (let bezierPiece of bezierPieces) {
|
|
23
20
|
let ps = bezierPiece.curve.ps;
|
|
24
|
-
let rect =
|
|
25
|
-
let bd =
|
|
21
|
+
let rect = getBoundingBox_(ps);
|
|
22
|
+
let bd = getClosestSquareDistanceToRect(rect, p);
|
|
26
23
|
if (bd <= rSquared * TOLERANCE) {
|
|
27
24
|
newPieces.push(bezierPiece);
|
|
28
25
|
}
|
|
29
26
|
}
|
|
30
27
|
return newPieces;
|
|
31
28
|
}
|
|
32
|
-
|
|
29
|
+
export { cullBezierPieces };
|
|
33
30
|
//# sourceMappingURL=cull-bezier-pieces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cull-bezier-pieces.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-2-prong/cull-bezier-pieces.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cull-bezier-pieces.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-2-prong/cull-bezier-pieces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,uDAAuD,CAAC;AAEvG,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE;;;;;;;GAOG;AACH,SAAS,gBAAgB,CACjB,YAA2B,EAC3B,CAAW,EACX,QAAgB;IAEpB,MAAM,cAAc,GAAG,CAAC,CAAC;IACzB,8BAA8B;IAC9B,MAAM,SAAS,GAAG,CAAC,GAAC,IAAI,CAAC;IAEzB,IAAI,YAAY,CAAC,MAAM,IAAI,cAAc,EAAE;QACvC,OAAO,YAAY,CAAC;KACvB;IAGD,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,KAAK,IAAI,WAAW,IAAI,YAAY,EAAE;QAClC,IAAI,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAE9B,IAAI,IAAI,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;QAC/B,IAAI,EAAE,GAAG,8BAA8B,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACjD,IAAI,EAAE,IAAI,QAAQ,GAAG,SAAS,EAAE;YAC5B,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC/B;KACJ;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAGD,OAAO,EAAE,gBAAgB,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 2-prong to the MAT. The first point on the shape boundary is given and
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const get_initial_bezier_pieces_1 = require("./get-initial-bezier-pieces");
|
|
13
|
-
const get_close_boundary_points_1 = require("../../closest-boundary-point/get-close-boundary-points");
|
|
1
|
+
import { lineLineIntersection, distanceBetween, squaredDistanceBetween, interpolate, dot } from 'flo-vector2d';
|
|
2
|
+
import { evalDeCasteljau as evalDeCasteljau_ } from 'flo-bezier3';
|
|
3
|
+
import { getClosestBoundaryPoint } from '../../closest-boundary-point/get-closest-boundary-point.js';
|
|
4
|
+
import { getOsculatingCircle } from '../../../point-on-shape.js';
|
|
5
|
+
import { add1Prong } from '../add-1-prong.js';
|
|
6
|
+
import { addDebugInfo } from './add-debug-info.js';
|
|
7
|
+
import { cullBezierPieces } from './cull-bezier-pieces.js';
|
|
8
|
+
import { findEquidistantPointOnLine } from './find-equidistant-point-on-line.js';
|
|
9
|
+
import { getInitialBezierPieces } from './get-initial-bezier-pieces.js';
|
|
10
|
+
import { getCloseBoundaryPoints } from '../../closest-boundary-point/get-close-boundary-points.js';
|
|
11
|
+
const evalDeCasteljau = evalDeCasteljau_;
|
|
14
12
|
/**
|
|
15
13
|
* @hidden
|
|
16
14
|
* Adds a 2-prong to the MAT. The first point on the shape boundary is given and
|
|
@@ -37,14 +35,14 @@ const get_close_boundary_points_1 = require("../../closest-boundary-point/get-cl
|
|
|
37
35
|
*/
|
|
38
36
|
function find2Prong(loops, extreme, squaredDiagonalLength, cpTrees, y, isHoleClosing, k) {
|
|
39
37
|
const MAX_ITERATIONS = 25;
|
|
40
|
-
const squaredSeperationTolerance =
|
|
38
|
+
const squaredSeperationTolerance = (1e-6 * extreme) ** 2;
|
|
41
39
|
// TODO - base deltas on theory or remove
|
|
42
|
-
const oneProngTolerance =
|
|
40
|
+
const oneProngTolerance = (1e-4) ** 2;
|
|
43
41
|
const squaredErrorTolerance = 1e-2 * squaredSeperationTolerance;
|
|
44
42
|
const maxOsculatingCircleRadiusSquared = squaredDiagonalLength;
|
|
45
43
|
// The boundary piece that should contain the other point of
|
|
46
44
|
// the 2-prong circle. (Defined by start and end points).
|
|
47
|
-
let { bezierPieces, δ } =
|
|
45
|
+
let { bezierPieces, δ } = getInitialBezierPieces(isHoleClosing, k, loops, cpTrees, y);
|
|
48
46
|
//console.log(bezierPieces.length)
|
|
49
47
|
/** The center of the two-prong (successively refined) */
|
|
50
48
|
let x;
|
|
@@ -58,13 +56,13 @@ function find2Prong(loops, extreme, squaredDiagonalLength, cpTrees, y, isHoleClo
|
|
|
58
56
|
else {
|
|
59
57
|
p = y.p;
|
|
60
58
|
//x = PointOnShape.getOsculatingCircle(maxOsculatingCircleRadiusSquared, y).center;
|
|
61
|
-
x =
|
|
62
|
-
r =
|
|
59
|
+
x = getOsculatingCircle(maxOsculatingCircleRadiusSquared, y).center;
|
|
60
|
+
r = squaredDistanceBetween(p, x);
|
|
63
61
|
}
|
|
64
62
|
// The lines below is an optimization.
|
|
65
63
|
let r_ = reduceRadius(extreme, bezierPieces, p, x);
|
|
66
64
|
if (r > r_) {
|
|
67
|
-
x =
|
|
65
|
+
x = interpolate(p, x, Math.sqrt(r_ / r));
|
|
68
66
|
}
|
|
69
67
|
/** Trace the convergence (for debugging). */
|
|
70
68
|
let xs = [];
|
|
@@ -78,9 +76,9 @@ function find2Prong(loops, extreme, squaredDiagonalLength, cpTrees, y, isHoleClo
|
|
|
78
76
|
do {
|
|
79
77
|
i++;
|
|
80
78
|
/** squared distance between source boundary point and circle center */
|
|
81
|
-
let r =
|
|
82
|
-
bezierPieces_ =
|
|
83
|
-
z =
|
|
79
|
+
let r = squaredDistanceBetween(x, y.p);
|
|
80
|
+
bezierPieces_ = cullBezierPieces(bezierPieces_, x, r);
|
|
81
|
+
z = getClosestBoundaryPoint(bezierPieces_, x, y.curve, y.t);
|
|
84
82
|
if (z === undefined) {
|
|
85
83
|
if (typeof _debug_ !== 'undefined') {
|
|
86
84
|
let elems = _debug_.generated.elems;
|
|
@@ -99,16 +97,16 @@ function find2Prong(loops, extreme, squaredDiagonalLength, cpTrees, y, isHoleClo
|
|
|
99
97
|
xs.push({ x, y, z: z.pos, t: y.t });
|
|
100
98
|
}
|
|
101
99
|
/** squared distance between anti-pode boundary point and circle center */
|
|
102
|
-
let d =
|
|
100
|
+
let d = squaredDistanceBetween(x, z.pos.p);
|
|
103
101
|
//if (i === 1 && d*oneProngTolerance >= r) {
|
|
104
102
|
if (i === 1 && r < d + oneProngTolerance) {
|
|
105
103
|
// It is a 1-prong.
|
|
106
|
-
|
|
104
|
+
add1Prong(Math.sqrt(maxOsculatingCircleRadiusSquared), cpTrees, y);
|
|
107
105
|
return undefined;
|
|
108
106
|
}
|
|
109
107
|
// TODO - squaredSeperationTolerance should in future be replaced with
|
|
110
108
|
// a relative error, i.e. distance between y (or z) / length(y (or z)).
|
|
111
|
-
if (!isHoleClosing &&
|
|
109
|
+
if (!isHoleClosing && squaredDistanceBetween(y.p, z.pos.p) <= squaredSeperationTolerance) {
|
|
112
110
|
if (typeof _debug_ !== 'undefined') {
|
|
113
111
|
/*
|
|
114
112
|
let elems = _debug_.generated.elems;
|
|
@@ -130,8 +128,8 @@ function find2Prong(loops, extreme, squaredDiagonalLength, cpTrees, y, isHoleClo
|
|
|
130
128
|
// nextX, but rather (distance from x to y) - (distance from x to z)
|
|
131
129
|
// Find the point on the line connecting y with x that is
|
|
132
130
|
// equidistant from y and z. This will be our next x.
|
|
133
|
-
let nextX =
|
|
134
|
-
let squaredError =
|
|
131
|
+
let nextX = findEquidistantPointOnLine(x, y.p, z.pos.p);
|
|
132
|
+
let squaredError = squaredDistanceBetween(x, nextX);
|
|
135
133
|
x = nextX;
|
|
136
134
|
if (squaredError < squaredErrorTolerance) {
|
|
137
135
|
done++; // Do one more iteration
|
|
@@ -146,7 +144,7 @@ function find2Prong(loops, extreme, squaredDiagonalLength, cpTrees, y, isHoleClo
|
|
|
146
144
|
// tolerance which can be checked in getClosestBoundaryPoint algorithm
|
|
147
145
|
let zs = [];
|
|
148
146
|
if (!failed) {
|
|
149
|
-
zs =
|
|
147
|
+
zs = getCloseBoundaryPoints(bezierPieces_, x, y, distanceBetween(x, z.pos.p));
|
|
150
148
|
if (!zs.length) {
|
|
151
149
|
// TODO - Numerical issue - fix
|
|
152
150
|
zs.push(z);
|
|
@@ -154,15 +152,14 @@ function find2Prong(loops, extreme, squaredDiagonalLength, cpTrees, y, isHoleClo
|
|
|
154
152
|
}
|
|
155
153
|
let circle;
|
|
156
154
|
if (z !== undefined) {
|
|
157
|
-
circle = { center: x, radius:
|
|
155
|
+
circle = { center: x, radius: distanceBetween(x, z.pos.p) };
|
|
158
156
|
}
|
|
159
157
|
if (typeof _debug_ !== 'undefined' && !failed) {
|
|
160
158
|
xs.push({ x, y, z: z.pos, t: y.t });
|
|
161
|
-
|
|
159
|
+
addDebugInfo(bezierPieces, failed, y, circle, z.pos, δ, xs, isHoleClosing);
|
|
162
160
|
}
|
|
163
161
|
return failed ? undefined : { circle, zs };
|
|
164
162
|
}
|
|
165
|
-
exports.find2Prong = find2Prong;
|
|
166
163
|
/**
|
|
167
164
|
* @hidden
|
|
168
165
|
* Reduces the circle radius initially as an optimization step.
|
|
@@ -174,20 +171,20 @@ function reduceRadius(extreme, bezierPieces, p, x) {
|
|
|
174
171
|
for (let i = 0; i < bezierPieces.length; i++) {
|
|
175
172
|
let bezierPiece = bezierPieces[i];
|
|
176
173
|
let ps = bezierPiece.curve.ps;
|
|
177
|
-
let p1 =
|
|
174
|
+
let p1 = evalDeCasteljau(ps, bezierPiece.ts[0]);
|
|
178
175
|
let r1 = Number.POSITIVE_INFINITY;
|
|
179
176
|
// Prevent evaluating the same points twice
|
|
180
177
|
if (!prevP || prevP[0] !== p1[0] || prevP[1] !== p1[1]) {
|
|
181
178
|
let cc1 = getCircleCenterFrom2PointsAndNormal(extreme, p, x, p1);
|
|
182
179
|
if (cc1) {
|
|
183
|
-
r1 =
|
|
180
|
+
r1 = squaredDistanceBetween(p, cc1);
|
|
184
181
|
}
|
|
185
182
|
}
|
|
186
183
|
let r2 = Number.POSITIVE_INFINITY;
|
|
187
|
-
let p2 =
|
|
184
|
+
let p2 = evalDeCasteljau(ps, bezierPiece.ts[1]);
|
|
188
185
|
let cc2 = getCircleCenterFrom2PointsAndNormal(extreme, p, x, p2);
|
|
189
186
|
if (cc2) {
|
|
190
|
-
r2 =
|
|
187
|
+
r2 = squaredDistanceBetween(p, cc2);
|
|
191
188
|
}
|
|
192
189
|
prevP = p2;
|
|
193
190
|
let d = Math.min(r1, r2);
|
|
@@ -208,9 +205,9 @@ function reduceRadius(extreme, bezierPieces, p, x) {
|
|
|
208
205
|
*/
|
|
209
206
|
function getCircleCenterFrom2PointsAndNormal(extreme, p, x, p1) {
|
|
210
207
|
// TODO - remove delta
|
|
211
|
-
let TOLERANCE =
|
|
208
|
+
let TOLERANCE = (1e-4 * extreme) ** 2;
|
|
212
209
|
// Ignore if p and p1 are too close together
|
|
213
|
-
if (
|
|
210
|
+
if (squaredDistanceBetween(p, p1) < TOLERANCE) {
|
|
214
211
|
return undefined;
|
|
215
212
|
}
|
|
216
213
|
/** The perpindicular bisector between the two given points on the circle */
|
|
@@ -221,15 +218,16 @@ function getCircleCenterFrom2PointsAndNormal(extreme, p, x, p1) {
|
|
|
221
218
|
let tan = [p1[0] - p[0], p1[1] - p[1]];
|
|
222
219
|
let norm = [-tan[1], tan[0]]; // Rotate by 90 degrees
|
|
223
220
|
let pb2 = [pb[0] + norm[0], pb[1] + norm[1]];
|
|
224
|
-
let res =
|
|
221
|
+
let res = lineLineIntersection([p, x], [pb, pb2]);
|
|
225
222
|
if (!res) {
|
|
226
223
|
return undefined;
|
|
227
224
|
}
|
|
228
225
|
let resO = [res[0] - p[0], res[1] - p[1]];
|
|
229
226
|
let xO = [x[0] - p[0], x[1] - p[1]];
|
|
230
|
-
if (
|
|
227
|
+
if (dot(resO, xO) < 0) {
|
|
231
228
|
return undefined;
|
|
232
229
|
}
|
|
233
230
|
return res;
|
|
234
231
|
}
|
|
232
|
+
export { find2Prong };
|
|
235
233
|
//# sourceMappingURL=find-2-prong.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-2-prong.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-2-prong/find-2-prong.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"find-2-prong.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-2-prong/find-2-prong.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,sBAAsB,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,eAAe,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAC9B,4DAA4D,CAAC;AAIjE,OAAO,EAAE,mBAAmB,EAAiB,MAAM,4BAA4B,CAAC;AAEhF,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2DAA2D,CAAC;AAGnG,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAGzC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AAC,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;IAEjD,IAAI,CAAC,GAAG,EAAE;QAAE,OAAO,SAAS,CAAC;KAAE;IAE/B,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE;QACtB,OAAO,SAAS,CAAC;KACjB;IAED,OAAO,GAAG,CAAC;AACZ,CAAC;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findEquidistantPointOnLine = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* @hidden
|
|
6
3
|
* @param x
|
|
@@ -39,5 +36,5 @@ function findEquidistantPointOnLine(x, y, z) {
|
|
|
39
36
|
let t2 = a * t1 + b;
|
|
40
37
|
return swapAxes ? [t2, t1] : [t1, t2];
|
|
41
38
|
}
|
|
42
|
-
|
|
39
|
+
export { findEquidistantPointOnLine };
|
|
43
40
|
//# sourceMappingURL=find-equidistant-point-on-line.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-equidistant-point-on-line.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-2-prong/find-equidistant-point-on-line.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"find-equidistant-point-on-line.js","sourceRoot":"","sources":["../../../../src/mat/find-mat/find-2-prong/find-equidistant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