flo-mat 1.2.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.cjs +17 -0
- package/README.md +12 -1
- package/browser/index.js +7128 -0
- package/browser/index.min.js +2 -1
- package/browser/index.min.js.LICENSE.txt +2819 -0
- package/browser/index.module.js +7149 -0
- package/browser/index.module.min.js +2 -0
- package/browser/index.module.min.js.LICENSE.txt +2819 -0
- package/node/circle.js +3 -7
- package/node/circle.js.map +1 -1
- package/node/compare-curvatures-at-interface.d.ts +19 -0
- package/node/compare-curvatures-at-interface.js +125 -0
- package/node/compare-curvatures-at-interface.js.map +1 -0
- package/node/contact-point.d.ts +2 -2
- package/node/contact-point.js +3 -6
- package/node/contact-point.js.map +1 -1
- package/node/cp-node/clone.d.ts +1 -1
- package/node/cp-node/clone.js +4 -7
- package/node/cp-node/clone.js.map +1 -1
- package/node/cp-node/remove.d.ts +2 -2
- package/node/cp-node/remove.js +1 -4
- package/node/cp-node/remove.js.map +1 -1
- package/node/cp-node.d.ts +4 -5
- package/node/cp-node.js +8 -12
- package/node/cp-node.js.map +1 -1
- package/node/curve.d.ts +2 -2
- package/node/curve.js +10 -14
- package/node/curve.js.map +1 -1
- package/node/debug/cp-node-for-debugging.d.ts +2 -2
- package/node/debug/cp-node-for-debugging.js +1 -2
- package/node/debug/debug-elem-types.d.ts +8 -8
- package/node/debug/debug-elem-types.js +1 -2
- package/node/debug/debug.d.ts +5 -7
- package/node/debug/debug.js +67 -10
- package/node/debug/debug.js.map +1 -1
- package/node/debug/functions/draw-elem/bounding-hull.js +3 -6
- package/node/debug/functions/draw-elem/bounding-hull.js.map +1 -1
- package/node/debug/functions/draw-elem/branch.d.ts +1 -1
- package/node/debug/functions/draw-elem/branch.js +5 -8
- package/node/debug/functions/draw-elem/branch.js.map +1 -1
- package/node/debug/functions/draw-elem/culls.d.ts +1 -1
- package/node/debug/functions/draw-elem/culls.js +1 -4
- package/node/debug/functions/draw-elem/culls.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.js +1 -4
- package/node/debug/functions/draw-elem/draw-circle-percent.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-elem.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-elem.js +34 -37
- package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
- package/node/debug/functions/draw-elem/dull-corner.d.ts +1 -1
- package/node/debug/functions/draw-elem/dull-corner.js +5 -7
- package/node/debug/functions/draw-elem/dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/leaves.d.ts +1 -1
- package/node/debug/functions/draw-elem/leaves.js +3 -6
- package/node/debug/functions/draw-elem/leaves.js.map +1 -1
- package/node/debug/functions/draw-elem/loop.d.ts +1 -1
- package/node/debug/functions/draw-elem/loop.js +1 -4
- package/node/debug/functions/draw-elem/loop.js.map +1 -1
- package/node/debug/functions/draw-elem/loops.d.ts +1 -1
- package/node/debug/functions/draw-elem/loops.js +1 -4
- package/node/debug/functions/draw-elem/loops.js.map +1 -1
- package/node/debug/functions/draw-elem/loose-bounding-box.js +3 -6
- package/node/debug/functions/draw-elem/loose-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/mat.d.ts +1 -1
- package/node/debug/functions/draw-elem/mat.js +7 -10
- package/node/debug/functions/draw-elem/mat.js.map +1 -1
- package/node/debug/functions/draw-elem/max-vertex.d.ts +1 -1
- package/node/debug/functions/draw-elem/max-vertex.js +3 -6
- package/node/debug/functions/draw-elem/max-vertex.js.map +1 -1
- package/node/debug/functions/draw-elem/min-y.d.ts +1 -1
- package/node/debug/functions/draw-elem/min-y.js +9 -12
- package/node/debug/functions/draw-elem/min-y.js.map +1 -1
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.d.ts +1 -1
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js +7 -10
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/one-prong.d.ts +1 -1
- package/node/debug/functions/draw-elem/one-prong.js +9 -12
- package/node/debug/functions/draw-elem/one-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/sharp-corner.d.ts +1 -1
- package/node/debug/functions/draw-elem/sharp-corner.js +3 -6
- package/node/debug/functions/draw-elem/sharp-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/three-prong.d.ts +1 -1
- package/node/debug/functions/draw-elem/three-prong.js +9 -12
- package/node/debug/functions/draw-elem/three-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/tight-bounding-box.js +3 -6
- package/node/debug/functions/draw-elem/tight-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/two-prong.d.ts +1 -1
- package/node/debug/functions/draw-elem/two-prong.js +9 -12
- package/node/debug/functions/draw-elem/two-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/vertex.d.ts +1 -1
- package/node/debug/functions/draw-elem/vertex.js +7 -10
- package/node/debug/functions/draw-elem/vertex.js.map +1 -1
- package/node/debug/functions/general.d.ts +1 -1
- package/node/debug/functions/general.js +3 -6
- package/node/debug/functions/general.js.map +1 -1
- package/node/debug/functions/three-prong.js +24 -27
- package/node/debug/functions/three-prong.js.map +1 -1
- package/node/debug/functions/two-prong.d.ts +1 -1
- package/node/debug/functions/two-prong.js +10 -13
- package/node/debug/functions/two-prong.js.map +1 -1
- package/node/debug/three-prong-for-debugging.d.ts +4 -4
- package/node/debug/three-prong-for-debugging.js +4 -7
- package/node/debug/three-prong-for-debugging.js.map +1 -1
- package/node/debug/two-prong-for-debugging.d.ts +5 -5
- package/node/debug/two-prong-for-debugging.js +1 -2
- package/node/find-mats.d.ts +12 -9
- package/node/find-mats.js +47 -53
- package/node/find-mats.js.map +1 -1
- package/node/get-boundary-bezier-parts-to-next.d.ts +3 -3
- package/node/get-boundary-bezier-parts-to-next.js +1 -4
- package/node/get-boundary-bezier-parts-to-next.js.map +1 -1
- package/node/get-boundary-beziers-to-next.d.ts +1 -1
- package/node/get-boundary-beziers-to-next.js +8 -8
- package/node/get-boundary-beziers-to-next.js.map +1 -1
- package/node/get-bounding-box-.d.ts +2 -0
- package/node/get-bounding-box-.js +5 -0
- package/node/get-bounding-box-.js.map +1 -0
- package/node/get-branches.d.ts +1 -1
- package/node/get-branches.js +7 -10
- package/node/get-branches.js.map +1 -1
- package/node/get-curve/get-curve-between.d.ts +1 -1
- package/node/get-curve/get-curve-between.js +21 -24
- package/node/get-curve/get-curve-between.js.map +1 -1
- package/node/get-curve/get-edge-direction.d.ts +1 -1
- package/node/get-curve/get-edge-direction.js +12 -15
- package/node/get-curve/get-edge-direction.js.map +1 -1
- package/node/get-curve-to-next.d.ts +1 -1
- package/node/get-curve-to-next.js +3 -6
- package/node/get-curve-to-next.js.map +1 -1
- package/node/get-interface-ccw.d.ts +24 -0
- package/node/get-interface-ccw.js +98 -0
- package/node/get-interface-ccw.js.map +1 -0
- package/node/index.d.ts +35 -36
- package/node/index.js +32 -56
- package/node/index.js.map +1 -1
- package/node/loop/get-max-coordinate.js +1 -4
- package/node/loop/get-max-coordinate.js.map +1 -1
- package/node/loop.d.ts +1 -1
- package/node/loop.js +1 -4
- package/node/loop.js.map +1 -1
- package/node/mat/add-to-cp-graph.d.ts +5 -5
- package/node/mat/add-to-cp-graph.js +5 -8
- package/node/mat/add-to-cp-graph.js.map +1 -1
- package/node/mat/bezier-piece.d.ts +1 -1
- package/node/mat/bezier-piece.js +1 -2
- package/node/mat/closest-boundary-point/closest-points-on-curve.d.ts +1 -1
- package/node/mat/closest-boundary-point/closest-points-on-curve.js +15 -14
- package/node/mat/closest-boundary-point/closest-points-on-curve.js.map +1 -1
- package/node/mat/closest-boundary-point/cull-bezier-pieces.d.ts +1 -1
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js +7 -10
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js.map +1 -1
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.d.ts +1 -1
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js +5 -8
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -1
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.d.ts +1 -1
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js +7 -8
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -1
- package/node/mat/closest-boundary-point/get-best-distance-squared.d.ts +1 -1
- package/node/mat/closest-boundary-point/get-best-distance-squared.js +6 -9
- package/node/mat/closest-boundary-point/get-best-distance-squared.js.map +1 -1
- package/node/mat/closest-boundary-point/get-close-boundary-points.d.ts +2 -2
- package/node/mat/closest-boundary-point/get-close-boundary-points.js +9 -12
- package/node/mat/closest-boundary-point/get-close-boundary-points.js.map +1 -1
- package/node/mat/closest-boundary-point/get-closest-boundary-point.d.ts +3 -3
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js +10 -13
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js.map +1 -1
- package/node/mat/corner.js +1 -2
- package/node/mat/create-new-cp-tree.d.ts +3 -3
- package/node/mat/create-new-cp-tree.js +5 -7
- package/node/mat/create-new-cp-tree.js.map +1 -1
- package/node/mat/elem-type-two-prong.js +1 -2
- package/node/mat/find-mat/add-1-prong.d.ts +4 -4
- package/node/mat/find-mat/add-1-prong.js +9 -12
- package/node/mat/find-mat/add-1-prong.js.map +1 -1
- package/node/mat/find-mat/add-2-prong.d.ts +5 -5
- package/node/mat/find-mat/add-2-prong.js +19 -22
- package/node/mat/find-mat/add-2-prong.js.map +1 -1
- package/node/mat/find-mat/add-3-prong.d.ts +5 -5
- package/node/mat/find-mat/add-3-prong.js +7 -10
- package/node/mat/find-mat/add-3-prong.js.map +1 -1
- package/node/mat/find-mat/add-debug-info.d.ts +2 -2
- package/node/mat/find-mat/add-debug-info.js +8 -13
- package/node/mat/find-mat/add-debug-info.js.map +1 -1
- package/node/mat/find-mat/create-get-interesting-points-on-loop.d.ts +3 -3
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js +29 -16
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js.map +1 -1
- package/node/mat/find-mat/create-initial-cp-graph.d.ts +4 -4
- package/node/mat/find-mat/create-initial-cp-graph.js +7 -9
- package/node/mat/find-mat/create-initial-cp-graph.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/add-debug-info.d.ts +5 -5
- package/node/mat/find-mat/find-2-prong/add-debug-info.js +3 -6
- package/node/mat/find-mat/find-2-prong/add-debug-info.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.d.ts +1 -1
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js +5 -8
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/find-2-prong.d.ts +5 -5
- package/node/mat/find-mat/find-2-prong/find-2-prong.js +37 -39
- package/node/mat/find-mat/find-2-prong/find-2-prong.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js +1 -4
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.d.ts +5 -5
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js +7 -10
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js.map +1 -1
- package/node/mat/find-mat/find-2-prong/x-for-debugging.d.ts +1 -1
- package/node/mat/find-mat/find-2-prong/x-for-debugging.js +1 -2
- package/node/mat/find-mat/find-3-prong/calc-better-x.d.ts +2 -2
- package/node/mat/find-mat/find-3-prong/calc-better-x.js +10 -13
- package/node/mat/find-mat/find-3-prong/calc-better-x.js.map +1 -1
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.d.ts +2 -2
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js +6 -8
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js.map +1 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.d.ts +3 -3
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js +29 -32
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js.map +1 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong.d.ts +3 -3
- package/node/mat/find-mat/find-3-prong/find-3-prong.js +14 -12
- package/node/mat/find-mat/find-3-prong/find-3-prong.js.map +1 -1
- package/node/mat/find-mat/find-3-prong/get-closest-points.d.ts +2 -2
- package/node/mat/find-mat/find-3-prong/get-closest-points.js +3 -6
- package/node/mat/find-mat/find-3-prong/get-closest-points.js.map +1 -1
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.d.ts +4 -4
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js +3 -6
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js.map +1 -1
- package/node/mat/find-mat/find-and-add-2-prongs.d.ts +4 -4
- package/node/mat/find-mat/find-and-add-2-prongs.js +9 -12
- package/node/mat/find-mat/find-and-add-2-prongs.js.map +1 -1
- package/node/mat/find-mat/find-and-add-3-prongs.d.ts +3 -3
- package/node/mat/find-mat/find-and-add-3-prongs.js +8 -11
- package/node/mat/find-mat/find-and-add-3-prongs.js.map +1 -1
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.d.ts +3 -3
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js +11 -14
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js.map +1 -1
- package/node/mat/find-mat/get-potential-2-prongs.d.ts +1 -1
- package/node/mat/find-mat/get-potential-2-prongs.js +3 -6
- package/node/mat/find-mat/get-potential-2-prongs.js.map +1 -1
- package/node/mat/find-mat/get-sharp-corners.d.ts +1 -1
- package/node/mat/find-mat/get-sharp-corners.js +3 -6
- package/node/mat/find-mat/get-sharp-corners.js.map +1 -1
- package/node/mat/geometry/get-closest-square-distance-to-rect.js +21 -15
- package/node/mat/geometry/get-closest-square-distance-to-rect.js.map +1 -1
- package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js +5 -8
- package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -1
- package/node/mat/get-boundary-piece-beziers.d.ts +2 -2
- package/node/mat/get-boundary-piece-beziers.js +6 -9
- package/node/mat/get-boundary-piece-beziers.js.map +1 -1
- package/node/mat/get-contact-circles-at-interface.d.ts +2 -2
- package/node/mat/get-contact-circles-at-interface.js +7 -10
- package/node/mat/get-contact-circles-at-interface.js.map +1 -1
- package/node/mat/get-largest-vertex.d.ts +1 -1
- package/node/mat/get-largest-vertex.js +1 -4
- package/node/mat/get-largest-vertex.js.map +1 -1
- package/node/mat/get-leaves.d.ts +1 -1
- package/node/mat/get-leaves.js +1 -4
- package/node/mat/get-leaves.js.map +1 -1
- package/node/mat/get-neighboring-cps.d.ts +3 -3
- package/node/mat/get-neighboring-cps.js +5 -8
- package/node/mat/get-neighboring-cps.js.map +1 -1
- package/node/mat/get-two-prong-type.d.ts +2 -2
- package/node/mat/get-two-prong-type.js +1 -4
- package/node/mat/get-two-prong-type.js.map +1 -1
- package/node/mat/is-another-cp-closeby.d.ts +5 -5
- package/node/mat/is-another-cp-closeby.js +8 -11
- package/node/mat/is-another-cp-closeby.js.map +1 -1
- package/node/mat/simplify-mat-map-only.d.ts +1 -1
- package/node/mat/simplify-mat-map-only.js +10 -14
- package/node/mat/simplify-mat-map-only.js.map +1 -1
- package/node/mat/to-scale-axis/add-debug-info.d.ts +1 -1
- package/node/mat/to-scale-axis/add-debug-info.js +1 -4
- package/node/mat/to-scale-axis/add-debug-info.js.map +1 -1
- package/node/mat/to-scale-axis/cull-non-cycles.d.ts +1 -1
- package/node/mat/to-scale-axis/cull-non-cycles.js +5 -8
- package/node/mat/to-scale-axis/cull-non-cycles.js.map +1 -1
- package/node/mat/to-scale-axis/cull.d.ts +2 -2
- package/node/mat/to-scale-axis/cull.js +75 -8
- package/node/mat/to-scale-axis/cull.js.map +1 -1
- package/node/mat/trim-mat.d.ts +1 -1
- package/node/mat/trim-mat.js +6 -9
- package/node/mat/trim-mat.js.map +1 -1
- package/node/mat.d.ts +3 -3
- package/node/mat.js +1 -2
- package/node/point-on-shape.d.ts +2 -2
- package/node/point-on-shape.js +23 -34
- package/node/point-on-shape.js.map +1 -1
- package/node/simplify-mat.d.ts +4 -3
- package/node/simplify-mat.js +14 -16
- package/node/simplify-mat.js.map +1 -1
- package/node/svg/get-loop-bounds.d.ts +2 -2
- package/node/svg/get-loop-bounds.js +11 -13
- package/node/svg/get-loop-bounds.js.map +1 -1
- package/node/svg/get-min-y-pos.d.ts +3 -2
- package/node/svg/get-min-y-pos.js +3 -6
- package/node/svg/get-min-y-pos.js.map +1 -1
- package/node/svg/get-shape-bounds.d.ts +5 -5
- package/node/svg/get-shape-bounds.js +5 -8
- package/node/svg/get-shape-bounds.js.map +1 -1
- package/node/sweep-line/sweep-line.js +1 -4
- package/node/sweep-line/sweep-line.js.map +1 -1
- package/node/to-scale-axis.d.ts +2 -1
- package/node/to-scale-axis.js +18 -21
- package/node/to-scale-axis.js.map +1 -1
- package/node/traverse-edges.d.ts +1 -1
- package/node/traverse-edges.js +1 -4
- package/node/traverse-edges.js.map +1 -1
- package/node/traverse-vertices.d.ts +1 -1
- package/node/traverse-vertices.js +1 -4
- package/node/traverse-vertices.js.map +1 -1
- package/package.json +34 -31
- package/src/circle.ts +0 -6
- package/src/compare-curvatures-at-interface.ts +197 -0
- package/src/contact-point.ts +2 -3
- package/src/cp-node/clone.ts +1 -2
- package/src/cp-node/remove.ts +2 -3
- package/src/cp-node.ts +6 -8
- package/src/curve.ts +3 -4
- package/src/debug/cp-node-for-debugging.ts +2 -3
- package/src/debug/debug-elem-types.ts +8 -10
- package/src/debug/debug.ts +22 -17
- package/src/debug/functions/draw-elem/bounding-hull.ts +0 -1
- package/src/debug/functions/draw-elem/branch.ts +2 -3
- package/src/debug/functions/draw-elem/culls.ts +1 -2
- package/src/debug/functions/draw-elem/draw-elem.ts +18 -19
- package/src/debug/functions/draw-elem/dull-corner.ts +3 -3
- package/src/debug/functions/draw-elem/leaves.ts +2 -4
- package/src/debug/functions/draw-elem/loop.ts +1 -2
- package/src/debug/functions/draw-elem/loops.ts +1 -2
- package/src/debug/functions/draw-elem/loose-bounding-box.ts +0 -1
- package/src/debug/functions/draw-elem/mat.ts +3 -5
- package/src/debug/functions/draw-elem/max-vertex.ts +1 -2
- package/src/debug/functions/draw-elem/min-y.ts +5 -7
- package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +1 -2
- package/src/debug/functions/draw-elem/one-prong.ts +2 -3
- package/src/debug/functions/draw-elem/sharp-corner.ts +1 -2
- package/src/debug/functions/draw-elem/three-prong.ts +2 -4
- package/src/debug/functions/draw-elem/tight-bounding-box.ts +0 -1
- package/src/debug/functions/draw-elem/two-prong.ts +2 -3
- package/src/debug/functions/draw-elem/vertex.ts +1 -2
- package/src/debug/functions/general.ts +2 -3
- package/src/debug/functions/three-prong.ts +3 -4
- package/src/debug/functions/two-prong.ts +6 -14
- package/src/debug/three-prong-for-debugging.ts +4 -5
- package/src/debug/two-prong-for-debugging.ts +5 -6
- package/src/find-mats.ts +34 -39
- package/src/get-boundary-bezier-parts-to-next.ts +5 -6
- package/src/get-boundary-beziers-to-next.ts +8 -7
- package/src/get-bounding-box-.ts +7 -0
- package/src/get-branches.ts +2 -3
- package/src/get-curve/get-curve-between.ts +2 -3
- package/src/get-curve/get-edge-direction.ts +2 -5
- package/src/get-curve-to-next.ts +2 -3
- package/src/get-interface-ccw.ts +112 -0
- package/src/index.ts +34 -48
- package/src/loop/get-max-coordinate.ts +0 -1
- package/src/loop.ts +1 -2
- package/src/mat/add-to-cp-graph.ts +7 -8
- package/src/mat/bezier-piece.ts +1 -2
- package/src/mat/closest-boundary-point/closest-points-on-curve.ts +19 -17
- package/src/mat/closest-boundary-point/cull-bezier-pieces.ts +4 -5
- package/src/mat/closest-boundary-point/cull-by-loose-bounding-box.ts +4 -5
- package/src/mat/closest-boundary-point/cull-by-tight-boundary-box.ts +7 -5
- package/src/mat/closest-boundary-point/get-best-distance-squared.ts +1 -2
- package/src/mat/closest-boundary-point/get-close-boundary-points.ts +4 -11
- package/src/mat/closest-boundary-point/get-closest-boundary-point.ts +5 -6
- package/src/mat/cmp-cp-on-delta.ts +2 -3
- package/src/mat/create-new-cp-tree.ts +5 -5
- package/src/mat/find-mat/add-1-prong.ts +7 -8
- package/src/mat/find-mat/add-2-prong.ts +11 -12
- package/src/mat/find-mat/add-3-prong.ts +7 -8
- package/src/mat/find-mat/add-debug-info.ts +8 -7
- package/src/mat/find-mat/create-get-interesting-points-on-loop.ts +22 -8
- package/src/mat/find-mat/create-initial-cp-graph.ts +7 -8
- package/src/mat/find-mat/find-2-prong/add-debug-info.ts +9 -10
- package/src/mat/find-mat/find-2-prong/cull-bezier-pieces.ts +4 -7
- package/src/mat/find-mat/find-2-prong/find-2-prong.ts +19 -17
- package/src/mat/find-mat/find-2-prong/get-initial-bezier-pieces.ts +7 -8
- package/src/mat/find-mat/find-2-prong/x-for-debugging.ts +1 -2
- package/src/mat/find-mat/find-3-prong/calc-better-x.ts +3 -6
- package/src/mat/find-mat/find-3-prong/calc-initial-3-prong-center.ts +3 -8
- package/src/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.ts +10 -14
- package/src/mat/find-mat/find-3-prong/find-3-prong.ts +13 -8
- package/src/mat/find-mat/find-3-prong/get-closest-points.ts +2 -5
- package/src/mat/find-mat/find-and-add-2-prongs-on-all-paths.ts +5 -6
- package/src/mat/find-mat/find-and-add-2-prongs.ts +9 -10
- package/src/mat/find-mat/find-and-add-3-prongs.ts +8 -9
- package/src/mat/find-mat/find-and-add-hole-closing-2-prongs.ts +7 -8
- package/src/mat/find-mat/get-potential-2-prongs.ts +1 -2
- package/src/mat/find-mat/get-sharp-corners.ts +1 -2
- package/src/mat/find-mat/get-total-abs-curvature.ts +2 -3
- package/src/mat/find-mat/get-total-by.ts +2 -3
- package/src/mat/geometry/get-closest-square-distance-to-rect.ts +15 -4
- package/src/mat/geometry/get-closest-squared-distance-to-rotated-rect.ts +0 -1
- package/src/mat/get-boundary-piece-beziers.ts +5 -6
- package/src/mat/get-contact-circles-at-interface.ts +3 -4
- package/src/mat/get-edges-as-array.ts +2 -3
- package/src/mat/get-largest-three-prong.ts +1 -2
- package/src/mat/get-largest-vertex.ts +1 -2
- package/src/mat/get-leaves.ts +1 -2
- package/src/mat/get-neighboring-cps.ts +5 -6
- package/src/mat/get-two-prong-type.ts +2 -3
- package/src/mat/is-another-cp-closeby.ts +6 -7
- package/src/mat/simplify-mat-map-only.ts +5 -7
- package/src/mat/to-scale-axis/add-debug-info.ts +2 -3
- package/src/mat/to-scale-axis/add-to-tree.ts +3 -4
- package/src/mat/to-scale-axis/calc-groups.ts +1 -2
- package/src/mat/to-scale-axis/create-spacial-tree.ts +3 -4
- package/src/mat/to-scale-axis/cull-non-cycles.ts +2 -3
- package/src/mat/to-scale-axis/cull.ts +3 -4
- package/src/mat/to-scale-axis/get-engulfed-vertices.ts +3 -4
- package/src/mat/to-scale-axis/t-tree.ts +1 -2
- package/src/mat/to-scale-axis/traverse-spacial-tree.ts +2 -4
- package/src/mat/trim-mat.ts +4 -5
- package/src/mat.ts +3 -5
- package/src/point-on-shape.ts +10 -12
- package/src/simplify-mat.ts +11 -13
- package/src/svg/get-curvature-at-interface.ts +1 -3
- package/src/svg/get-extreme.ts +2 -3
- package/src/svg/get-loop-bounds.ts +4 -4
- package/src/svg/get-min-y-pos.ts +2 -6
- package/src/svg/get-shape-bounds.ts +2 -3
- package/src/sweep-line/are-boxes-intersecting.ts +1 -1
- package/src/to-scale-axis.ts +15 -16
- package/src/traverse-edges.ts +1 -2
- package/src/traverse-vertices.ts +1 -2
- package/test/lib-load.spec.ts +0 -1
- package/tsconfig.json +6 -31
- package/webpack.config.cjs +132 -0
- package/.nycrc +0 -4
- package/node/mat/cmp-cp-on-delta.d.ts +0 -14
- package/node/mat/cmp-cp-on-delta.js +0 -45
- package/node/mat/cmp-cp-on-delta.js.map +0 -1
- package/node/mat/find-mat/get-total-abs-curvature.d.ts +0 -5
- package/node/mat/find-mat/get-total-abs-curvature.js +0 -13
- package/node/mat/find-mat/get-total-abs-curvature.js.map +0 -1
- package/node/mat/find-mat/get-total-by.d.ts +0 -10
- package/node/mat/find-mat/get-total-by.js +0 -22
- package/node/mat/find-mat/get-total-by.js.map +0 -1
- package/node/mat/get-edges-as-array.d.ts +0 -4
- package/node/mat/get-edges-as-array.js +0 -12
- package/node/mat/get-edges-as-array.js.map +0 -1
- package/node/mat/get-largest-three-prong.d.ts +0 -4
- package/node/mat/get-largest-three-prong.js +0 -13
- package/node/mat/get-largest-three-prong.js.map +0 -1
- package/node/mat/to-scale-axis/add-to-tree.d.ts +0 -13
- package/node/mat/to-scale-axis/add-to-tree.js +0 -39
- package/node/mat/to-scale-axis/add-to-tree.js.map +0 -1
- package/node/mat/to-scale-axis/calc-groups.d.ts +0 -28
- package/node/mat/to-scale-axis/calc-groups.js +0 -66
- package/node/mat/to-scale-axis/calc-groups.js.map +0 -1
- package/node/mat/to-scale-axis/create-spacial-tree.d.ts +0 -9
- package/node/mat/to-scale-axis/create-spacial-tree.js +0 -24
- package/node/mat/to-scale-axis/create-spacial-tree.js.map +0 -1
- package/node/mat/to-scale-axis/get-engulfed-vertices.d.ts +0 -12
- package/node/mat/to-scale-axis/get-engulfed-vertices.js +0 -95
- package/node/mat/to-scale-axis/get-engulfed-vertices.js.map +0 -1
- package/node/mat/to-scale-axis/t-tree.d.ts +0 -6
- package/node/mat/to-scale-axis/t-tree.js +0 -3
- package/node/mat/to-scale-axis/t-tree.js.map +0 -1
- package/node/mat/to-scale-axis/traverse-spacial-tree.d.ts +0 -11
- package/node/mat/to-scale-axis/traverse-spacial-tree.js +0 -25
- package/node/mat/to-scale-axis/traverse-spacial-tree.js.map +0 -1
- package/node/svg/get-curvature-at-interface.d.ts +0 -9
- package/node/svg/get-curvature-at-interface.js +0 -49
- package/node/svg/get-curvature-at-interface.js.map +0 -1
- package/node/svg/get-extreme.d.ts +0 -9
- package/node/svg/get-extreme.js +0 -16
- package/node/svg/get-extreme.js.map +0 -1
- package/node/sweep-line/are-boxes-intersecting.d.ts +0 -11
- package/node/sweep-line/are-boxes-intersecting.js +0 -42
- package/node/sweep-line/are-boxes-intersecting.js.map +0 -1
- package/test/mocha.opts +0 -4
- package/webpack.config.js +0 -25
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { getClosestSquareDistanceToRect } from '../geometry/get-closest-square-distance-to-rect';
|
|
1
|
+
import { getBoundingBox_ } from '../../get-bounding-box-.js';
|
|
2
|
+
import { BezierPiece } from '../bezier-piece.js';
|
|
3
|
+
import { getClosestSquareDistanceToRect } from '../geometry/get-closest-square-distance-to-rect.js';
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -23,7 +22,7 @@ function cullByLooseBoundingBox(
|
|
|
23
22
|
let bezierPiece = bezierPieces[i];
|
|
24
23
|
let ps = bezierPiece.curve.ps;
|
|
25
24
|
|
|
26
|
-
let boundingBox =
|
|
25
|
+
let boundingBox = getBoundingBox_(ps);
|
|
27
26
|
|
|
28
27
|
let d = getClosestSquareDistanceToRect(
|
|
29
28
|
boundingBox,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { getBoundingBoxTight } from "flo-bezier3";
|
|
2
|
+
import { memoize } from "flo-memoize";
|
|
3
|
+
import { BezierPiece } from "../bezier-piece.js";
|
|
4
|
+
import { getClosestSquaredDistanceToRotatedRect } from '../geometry/get-closest-squared-distance-to-rotated-rect.js';
|
|
1
5
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { getClosestSquaredDistanceToRotatedRect } from
|
|
5
|
-
'../geometry/get-closest-squared-distance-to-rotated-rect';
|
|
6
|
+
|
|
7
|
+
const getBoundingBoxTight_ = memoize(getBoundingBoxTight);
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
/**
|
|
@@ -24,7 +26,7 @@ function cullByTightBoundingBox(
|
|
|
24
26
|
let bezierPiece = bezierPieces[i];
|
|
25
27
|
let ps = bezierPiece.curve.ps;
|
|
26
28
|
|
|
27
|
-
let tightBoundingBox =
|
|
29
|
+
let tightBoundingBox = getBoundingBoxTight_(ps);
|
|
28
30
|
let d = getClosestSquaredDistanceToRotatedRect(
|
|
29
31
|
tightBoundingBox,
|
|
30
32
|
p
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
declare var _debug_: Debug;
|
|
3
|
-
|
|
4
|
-
import { Debug } from '../../debug/debug';
|
|
5
|
-
|
|
6
1
|
import { distanceBetween } from 'flo-vector2d';
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
import { cullBezierPieces } from './cull-bezier-pieces';
|
|
12
|
-
import { closestPointsOnCurve } from './closest-points-on-curve';
|
|
2
|
+
import { IPointOnShape, PointOnShape } from '../../point-on-shape.js';
|
|
3
|
+
import { BezierPiece } from '../bezier-piece.js';
|
|
4
|
+
import { cullBezierPieces } from './cull-bezier-pieces.js';
|
|
5
|
+
import { closestPointsOnCurve } from './closest-points-on-curve.js';
|
|
13
6
|
|
|
14
7
|
|
|
15
8
|
/**
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
1
|
import { distanceBetween, getObjClosestTo } from 'flo-vector2d';
|
|
3
|
-
import { Curve } from '../../curve';
|
|
4
|
-
import { PointOnShape, IPointOnShape } from '../../point-on-shape';
|
|
5
|
-
import { BezierPiece } from '../bezier-piece';
|
|
6
|
-
import { cullBezierPieces } from './cull-bezier-pieces';
|
|
7
|
-
import { closestPointsOnCurve } from './closest-points-on-curve';
|
|
2
|
+
import { Curve } from '../../curve.js';
|
|
3
|
+
import { PointOnShape, IPointOnShape } from '../../point-on-shape.js';
|
|
4
|
+
import { BezierPiece } from '../bezier-piece.js';
|
|
5
|
+
import { cullBezierPieces } from './cull-bezier-pieces.js';
|
|
6
|
+
import { closestPointsOnCurve } from './closest-points-on-curve.js';
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
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';
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -19,7 +18,8 @@ function createNewCpTree(cpNode: CpNode) {
|
|
|
19
18
|
let loop = cpNode.cp.pointOnShape.curve.loop;
|
|
20
19
|
let cpTree = newCpTrees.get(loop);
|
|
21
20
|
if (!cpTree) {
|
|
22
|
-
cpTree = new LlRbTree(CpNode.comparator, [], true);
|
|
21
|
+
// qqq cpTree = new LlRbTree(CpNode.comparator, [], true);
|
|
22
|
+
cpTree = new LlRbTree(CpNode.comparator, false);
|
|
23
23
|
newCpTrees.set(loop, cpTree);
|
|
24
24
|
}
|
|
25
25
|
cpTree.insert(cpNode);
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
|
|
2
1
|
/** @hidden */
|
|
3
2
|
declare var _debug_: Debug;
|
|
4
3
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { Loop } from '../../loop';
|
|
8
|
-
import { getOsculatingCircle, calcPosOrder, isPosDullCorner, IPointOnShape } from '../../point-on-shape';
|
|
9
|
-
import { CpNode } from '../../cp-node';
|
|
10
|
-
import { addToCpGraph } from '../add-to-cp-graph';
|
|
11
|
-
import { isAnotherCpCloseby } from '../is-another-cp-closeby';
|
|
4
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
5
|
+
import { Debug } from '../../debug/debug.js';
|
|
6
|
+
import { Loop } from '../../loop.js';
|
|
7
|
+
import { getOsculatingCircle, calcPosOrder, isPosDullCorner, IPointOnShape } from '../../point-on-shape.js';
|
|
8
|
+
import { CpNode } from '../../cp-node.js';
|
|
9
|
+
import { addToCpGraph } from '../add-to-cp-graph.js';
|
|
10
|
+
import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
|
|
12
11
|
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
|
|
2
1
|
/** @hidden */
|
|
3
2
|
declare var _debug_: Debug;
|
|
4
3
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import { Loop } from '../../loop';
|
|
9
|
-
import { CpNode } from '../../cp-node';
|
|
10
|
-
import { Circle } from '../../circle';
|
|
11
|
-
import { ContactPoint } from '../../contact-point';
|
|
12
|
-
import { PointOnShape, calcPosOrder, IPointOnShape } from '../../point-on-shape';
|
|
13
|
-
import { isAnotherCpCloseby } from '../is-another-cp-closeby';
|
|
14
|
-
import { getNeighbouringPoints } from '../get-neighboring-cps';
|
|
15
|
-
import { TwoProngForDebugging } from '../../debug/two-prong-for-debugging';
|
|
4
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
5
|
+
import { exponent } from 'big-float-ts';
|
|
6
|
+
import { Debug } from '../../debug/debug.js';
|
|
7
|
+
import { Loop } from '../../loop.js';
|
|
8
|
+
import { CpNode } from '../../cp-node.js';
|
|
9
|
+
import { Circle } from '../../circle.js';
|
|
10
|
+
import { ContactPoint } from '../../contact-point.js';
|
|
11
|
+
import { PointOnShape, calcPosOrder, IPointOnShape } from '../../point-on-shape.js';
|
|
12
|
+
import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
|
|
13
|
+
import { getNeighbouringPoints } from '../get-neighboring-cps.js';
|
|
14
|
+
import { TwoProngForDebugging } from '../../debug/two-prong-for-debugging.js';
|
|
16
15
|
|
|
17
16
|
|
|
18
17
|
/**
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { isAnotherCpCloseby } from '../is-another-cp-closeby';
|
|
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
|
+
import { addToCpGraph } from '../add-to-cp-graph.js';
|
|
7
|
+
import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
/**
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { getBoundingHull, getBoundingBoxTight } from 'flo-bezier3';
|
|
2
|
+
import { Debug } from '../../debug/debug.js';
|
|
3
|
+
import { Loop } from '../../loop.js';
|
|
4
|
+
import { Curve, getCornerAtEnd } from '../../curve.js';
|
|
5
|
+
import { Mat } from '../../mat.js';
|
|
6
|
+
import { getBoundingBox_ } from '../../get-bounding-box-.js';
|
|
7
|
+
|
|
1
8
|
|
|
2
9
|
/** @hidden */
|
|
3
10
|
declare var _debug_: Debug;
|
|
4
11
|
|
|
5
|
-
import { Debug } from '../../debug/debug';
|
|
6
|
-
import { getBoundingHull, getBoundingBox, getBoundingBoxTight } from 'flo-bezier3';
|
|
7
|
-
import { Loop } from '../../loop';
|
|
8
|
-
import { Curve, getCornerAtEnd } from '../../curve';
|
|
9
|
-
import { Mat } from '../../mat';
|
|
10
|
-
|
|
11
12
|
|
|
12
13
|
if (typeof _debug_ !== 'undefined') {
|
|
13
14
|
var timingStart: number;
|
|
@@ -37,7 +38,7 @@ function addDebugInfo1(loops: Loop[]) {
|
|
|
37
38
|
|
|
38
39
|
generated.elems.boundingHull.push(hull);
|
|
39
40
|
|
|
40
|
-
let looseBoundingBox =
|
|
41
|
+
let looseBoundingBox = getBoundingBox_(ps);
|
|
41
42
|
generated.elems.looseBoundingBox.push(looseBoundingBox);
|
|
42
43
|
|
|
43
44
|
let tightBoundingBox = getBoundingBoxTight(ps);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { getContactCirclesAtInterface } from '../get-contact-circles-at-interface';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { PointOnShape, comparePoss, IPointOnShape } from '../../point-on-shape';
|
|
1
|
+
import { getCurvatureExtrema, splitByCurvatureAndLength, controlPointLinesLength } from 'flo-bezier3';
|
|
2
|
+
import { getContactCirclesAtInterface } from '../get-contact-circles-at-interface.js';
|
|
3
|
+
import { Loop } from '../../loop.js';
|
|
4
|
+
import { PointOnShape, comparePoss, IPointOnShape } from '../../point-on-shape.js';
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
/**
|
|
@@ -14,7 +13,7 @@ import { PointOnShape, comparePoss, IPointOnShape } from '../../point-on-shape';
|
|
|
14
13
|
*/
|
|
15
14
|
function getInterestingPointsOnLoop(
|
|
16
15
|
minBezLength: number,
|
|
17
|
-
|
|
16
|
+
maxCurviness: number,
|
|
18
17
|
maxLength: number) {
|
|
19
18
|
|
|
20
19
|
return function(loop: Loop) {
|
|
@@ -23,11 +22,13 @@ function getInterestingPointsOnLoop(
|
|
|
23
22
|
for (let i=0; i<loop.curves.length; i++) {
|
|
24
23
|
let curve = loop.curves[i];
|
|
25
24
|
|
|
26
|
-
if (lengthSquaredUpperBound(curve.ps) < minBezLength) {
|
|
25
|
+
// qqq if (lengthSquaredUpperBound(curve.ps) < minBezLength) {
|
|
26
|
+
if (controlPointLinesLength(curve.ps) < minBezLength) {
|
|
27
27
|
continue;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
|
|
31
|
+
/*
|
|
31
32
|
let { maxCurvatureTs, maxNegativeCurvatureTs } =
|
|
32
33
|
getCurvatureExtrema(curve.ps);
|
|
33
34
|
let maxCurvatures = maxCurvatureTs.map(t => new PointOnShape(curve, t));
|
|
@@ -38,8 +39,21 @@ function getInterestingPointsOnLoop(
|
|
|
38
39
|
...maxCurvatures,
|
|
39
40
|
...maxNegativeCurvatures
|
|
40
41
|
);
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
// let { maxima } = getCurvatureExtrema(curve.ps);
|
|
45
|
+
// qqq let { maxCurvatureTs, maxNegativeCurvatureTs } = getCurvatureExtrema(curve.ps);
|
|
46
|
+
let { maxima } = getCurvatureExtrema(curve.ps);
|
|
47
|
+
// let maxAbsCurvatures = maxima.map(t => new PointOnShape(curve, t));
|
|
48
|
+
// qqq let maxAbsCurvatures = [...maxCurvatureTs, ...maxNegativeCurvatureTs].map(t => new PointOnShape(curve, t));
|
|
49
|
+
let maxAbsCurvatures = [...maxima].map(t => new PointOnShape(curve, t));
|
|
50
|
+
|
|
51
|
+
allPoints.push(
|
|
52
|
+
...getContactCirclesAtInterface(curve),
|
|
53
|
+
...maxAbsCurvatures,
|
|
54
|
+
);
|
|
41
55
|
|
|
42
|
-
let ts = splitByCurvatureAndLength(curve.ps,
|
|
56
|
+
let ts = splitByCurvatureAndLength(curve.ps, maxCurviness, maxLength);
|
|
43
57
|
if (ts.length === 2) {
|
|
44
58
|
ts = [0, 0.5, 1];
|
|
45
59
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { IPointOnShape } from '../../point-on-shape';
|
|
7
|
-
import { ContactPoint } from '../../contact-point';
|
|
1
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
+
import { Loop } from '../../loop.js';
|
|
3
|
+
import { CpNode } from '../../cp-node.js';
|
|
4
|
+
import { IPointOnShape } from '../../point-on-shape.js';
|
|
5
|
+
import { ContactPoint } from '../../contact-point.js';
|
|
8
6
|
|
|
9
7
|
|
|
10
8
|
/**
|
|
@@ -24,7 +22,8 @@ function createInitialCpGraph(
|
|
|
24
22
|
for (let k=0; k<sharpCornerss.length; k++) {
|
|
25
23
|
let sharpCorners = sharpCornerss[k];
|
|
26
24
|
|
|
27
|
-
let cpTree = new LlRbTree(CpNode.comparator, [], true);
|
|
25
|
+
// qqq let cpTree = new LlRbTree(CpNode.comparator, [], true);
|
|
26
|
+
let cpTree = new LlRbTree(CpNode.comparator, false);
|
|
28
27
|
|
|
29
28
|
let cpNode1 = undefined;
|
|
30
29
|
let cpNode2 = undefined;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
1
|
/** @hidden */
|
|
3
2
|
declare var _debug_: Debug;
|
|
4
3
|
|
|
5
|
-
import { Debug } from '../../../debug/debug';
|
|
6
|
-
import { IPointOnShape } from
|
|
7
|
-
import { Circle } from
|
|
8
|
-
import { CpNode } from
|
|
9
|
-
import { BezierPiece } from '../../bezier-piece';
|
|
10
|
-
import { TwoProngForDebugging } from
|
|
11
|
-
import { getTwoProngType } from
|
|
12
|
-
import { ElemType_TwoProng } from
|
|
13
|
-
import { TXForDebugging } from './x-for-debugging';
|
|
4
|
+
import { Debug } from '../../../debug/debug.js';
|
|
5
|
+
import { IPointOnShape } from '../../../point-on-shape.js';
|
|
6
|
+
import { Circle } from '../../../circle.js';
|
|
7
|
+
import { CpNode } from '../../../cp-node.js';
|
|
8
|
+
import { BezierPiece } from '../../bezier-piece.js';
|
|
9
|
+
import { TwoProngForDebugging } from '../../../debug/two-prong-for-debugging.js';
|
|
10
|
+
import { getTwoProngType } from '../../get-two-prong-type.js';
|
|
11
|
+
import { ElemType_TwoProng } from '../../elem-type-two-prong.js';
|
|
12
|
+
import { TXForDebugging } from './x-for-debugging.js';
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
/** @hidden */
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { getClosestSquareDistanceToRect } from "../../geometry/get-closest-square-distance-to-rect";
|
|
5
|
-
|
|
6
|
-
import { BezierPiece } from "../../bezier-piece";
|
|
1
|
+
import { getClosestSquareDistanceToRect } from '../../geometry/get-closest-square-distance-to-rect.js';
|
|
2
|
+
import { BezierPiece } from '../../bezier-piece.js';
|
|
3
|
+
import { getBoundingBox_ } from '../../../get-bounding-box-.js';
|
|
7
4
|
|
|
8
5
|
|
|
9
6
|
/**
|
|
@@ -32,7 +29,7 @@ function cullBezierPieces(
|
|
|
32
29
|
for (let bezierPiece of bezierPieces) {
|
|
33
30
|
let ps = bezierPiece.curve.ps;
|
|
34
31
|
|
|
35
|
-
let rect =
|
|
32
|
+
let rect = getBoundingBox_(ps);
|
|
36
33
|
let bd = getClosestSquareDistanceToRect(rect, p);
|
|
37
34
|
if (bd <= rSquared * TOLERANCE) {
|
|
38
35
|
newPieces.push(bezierPiece);
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
|
|
2
1
|
/** @hidden */
|
|
3
2
|
declare var _debug_: Debug;
|
|
4
3
|
|
|
5
|
-
import {
|
|
6
|
-
import LlRbTree from 'flo-ll-rb-tree';
|
|
4
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
7
5
|
import { lineLineIntersection, distanceBetween, squaredDistanceBetween, interpolate, dot } from 'flo-vector2d';
|
|
8
|
-
import { evalDeCasteljau } from 'flo-bezier3';
|
|
6
|
+
import { evalDeCasteljau as evalDeCasteljau_ } from 'flo-bezier3';
|
|
7
|
+
import { Debug } from '../../../debug/debug.js';
|
|
9
8
|
import { getClosestBoundaryPoint } from
|
|
10
|
-
'../../closest-boundary-point/get-closest-boundary-point';
|
|
11
|
-
import { CpNode } from '../../../cp-node';
|
|
12
|
-
import { Loop } from '../../../loop';
|
|
13
|
-
import { Circle } from '../../../circle';
|
|
14
|
-
import { getOsculatingCircle, IPointOnShape } from '../../../point-on-shape';
|
|
15
|
-
import { BezierPiece } from '../../bezier-piece';
|
|
16
|
-
import { add1Prong } from '../add-1-prong';
|
|
17
|
-
import { addDebugInfo } from './add-debug-info';
|
|
18
|
-
import { TXForDebugging } from './x-for-debugging';
|
|
19
|
-
import { cullBezierPieces } from './cull-bezier-pieces';
|
|
20
|
-
import { findEquidistantPointOnLine } from './find-equidistant-point-on-line';
|
|
21
|
-
import { getInitialBezierPieces } from './get-initial-bezier-pieces';
|
|
22
|
-
import { getCloseBoundaryPoints } from '../../closest-boundary-point/get-close-boundary-points';
|
|
9
|
+
'../../closest-boundary-point/get-closest-boundary-point.js';
|
|
10
|
+
import { CpNode } from '../../../cp-node.js';
|
|
11
|
+
import { Loop } from '../../../loop.js';
|
|
12
|
+
import { Circle } from '../../../circle.js';
|
|
13
|
+
import { getOsculatingCircle, IPointOnShape } from '../../../point-on-shape.js';
|
|
14
|
+
import { BezierPiece } from '../../bezier-piece.js';
|
|
15
|
+
import { add1Prong } from '../add-1-prong.js';
|
|
16
|
+
import { addDebugInfo } from './add-debug-info.js';
|
|
17
|
+
import { TXForDebugging } from './x-for-debugging.js';
|
|
18
|
+
import { cullBezierPieces } from './cull-bezier-pieces.js';
|
|
19
|
+
import { findEquidistantPointOnLine } from './find-equidistant-point-on-line.js';
|
|
20
|
+
import { getInitialBezierPieces } from './get-initial-bezier-pieces.js';
|
|
21
|
+
import { getCloseBoundaryPoints } from '../../closest-boundary-point/get-close-boundary-points.js';
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
const evalDeCasteljau = evalDeCasteljau_;
|
|
23
25
|
|
|
24
26
|
|
|
25
27
|
/**
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { isPosDullCorner, IPointOnShape } from '../../../point-on-shape';
|
|
1
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
+
import { getNeighbouringPoints } from '../../get-neighboring-cps.js';
|
|
3
|
+
import { getBoundaryPieceBeziers } from '../../get-boundary-piece-beziers.js';
|
|
4
|
+
import { BezierPiece } from '../../bezier-piece.js';
|
|
5
|
+
import { Loop } from '../../../loop.js';
|
|
6
|
+
import { CpNode } from '../../../cp-node.js';
|
|
7
|
+
import { isPosDullCorner, IPointOnShape } from '../../../point-on-shape.js';
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
/** @hidden */
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
1
|
import { fromTo, circumCenter, len, scale, translate } from 'flo-vector2d';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { getClosestPoints } from './get-closest-points';
|
|
2
|
+
import { IPointOnShape } from '../../../point-on-shape.js';
|
|
3
|
+
import { BezierPiece } from '../../bezier-piece.js';
|
|
4
|
+
import { getClosestPoints } from './get-closest-points.js';
|
|
8
5
|
|
|
9
6
|
|
|
10
7
|
/**
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
2
1
|
/** @hidden */
|
|
3
|
-
declare var _debug_: Debug;
|
|
4
|
-
|
|
5
|
-
import { Debug } from '../../../debug/debug';
|
|
6
2
|
import { circumCenter } from 'flo-vector2d';
|
|
7
|
-
import { CpNode } from '../../../cp-node';
|
|
8
|
-
import { BezierPiece } from '../../bezier-piece';
|
|
9
|
-
import { getClosestBoundaryPoint } from
|
|
10
|
-
'../../closest-boundary-point/get-closest-boundary-point';
|
|
3
|
+
import { CpNode } from '../../../cp-node.js';
|
|
4
|
+
import { BezierPiece } from '../../bezier-piece.js';
|
|
5
|
+
import { getClosestBoundaryPoint } from '../../closest-boundary-point/get-closest-boundary-point.js';
|
|
11
6
|
|
|
12
7
|
|
|
13
8
|
/**
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
|
|
2
1
|
/** @hidden */
|
|
3
2
|
declare var _debug_: Debug;
|
|
4
3
|
|
|
5
|
-
import { Debug } from '../../../debug/debug';
|
|
6
4
|
import {
|
|
7
5
|
fromTo, circumCenter, len, distanceBetween, toUnitVector, rotate90Degrees,
|
|
8
|
-
cross
|
|
6
|
+
cross
|
|
9
7
|
} from 'flo-vector2d';
|
|
10
8
|
import { tangent } from 'flo-bezier3';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
import { calcInitial3ProngCenter } from './calc-initial-3-prong-center';
|
|
17
|
-
import { getClosestPoints } from './get-closest-points';
|
|
18
|
-
import { calcBetterX } from './calc-better-x';
|
|
19
|
-
import { Curve, getCornerAtEnd } from '../../../curve';
|
|
9
|
+
import { Debug } from '../../../debug/debug.js';
|
|
10
|
+
import { CpNode } from '../../../cp-node.js';
|
|
11
|
+
import { BezierPiece } from '../../bezier-piece.js';
|
|
12
|
+
import { isPosDullCorner, IPointOnShape } from '../../../point-on-shape.js';
|
|
13
|
+
import { getClosestBoundaryPoint } from '../../closest-boundary-point/get-closest-boundary-point.js';
|
|
14
|
+
import { calcInitial3ProngCenter } from './calc-initial-3-prong-center.js';
|
|
15
|
+
import { getClosestPoints } from './get-closest-points.js';
|
|
16
|
+
import { calcBetterX } from './calc-better-x.js';
|
|
17
|
+
import { Curve, getCornerAtEnd } from '../../../curve.js';
|
|
20
18
|
|
|
21
19
|
|
|
22
20
|
/** @hidden */
|
|
@@ -133,8 +131,6 @@ function find3ProngForDelta3s(
|
|
|
133
131
|
|
|
134
132
|
let circle = { center: x, radius };
|
|
135
133
|
|
|
136
|
-
|
|
137
|
-
|
|
138
134
|
//-------------------------------------------------------------------------
|
|
139
135
|
// Calculate the unit tangent vector at 3-prong circle points - they should
|
|
140
136
|
// be very close to tangent to the boundary piece tangents at those points
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
2
1
|
/** @hidden */
|
|
3
2
|
declare var _debug_: Debug;
|
|
4
3
|
|
|
5
|
-
import { Debug } from '../../../debug/debug';
|
|
6
4
|
import { fromTo } from 'flo-bezier3';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
5
|
+
import { Debug } from '../../../debug/debug.js';
|
|
6
|
+
import { CpNode } from '../../../cp-node.js';
|
|
7
|
+
import { Circle } from '../../../circle.js';
|
|
8
|
+
import { IPointOnShape } from '../../../point-on-shape.js';
|
|
9
|
+
import { createEmptyThreeProngForDebugging } from '../../../debug/three-prong-for-debugging.js';
|
|
10
|
+
import { find3ProngForDelta3s } from './find-3-prong-for-delta3s.js';
|
|
11
|
+
import { getBoundaryPieceBeziers } from '../../get-boundary-piece-beziers.js';
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
/**
|
|
@@ -32,9 +31,15 @@ function find3Prong(δs: CpNode[][], extreme: number) {
|
|
|
32
31
|
let boundary: number[][][] = [];
|
|
33
32
|
d.boundaries.push(boundary);
|
|
34
33
|
for (let bezierPiece of bezierPieces) {
|
|
34
|
+
/* qqq
|
|
35
35
|
let bezier = fromTo(bezierPiece.curve.ps)(
|
|
36
36
|
bezierPiece.ts[0], bezierPiece.ts[1]
|
|
37
37
|
);
|
|
38
|
+
*/
|
|
39
|
+
const bezier = fromTo(
|
|
40
|
+
bezierPiece.curve.ps,
|
|
41
|
+
bezierPiece.ts[0], bezierPiece.ts[1]
|
|
42
|
+
);
|
|
38
43
|
boundary.push(bezier);
|
|
39
44
|
}
|
|
40
45
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { getClosestBoundaryPoint } from
|
|
5
|
-
'../../closest-boundary-point/get-closest-boundary-point';
|
|
1
|
+
import { BezierPiece } from '../../bezier-piece.js';
|
|
2
|
+
import { getClosestBoundaryPoint } from '../../closest-boundary-point/get-closest-boundary-point.js';
|
|
6
3
|
|
|
7
4
|
|
|
8
5
|
/**
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { findAndAdd2Prongs } from './find-and-add-2-prongs';
|
|
1
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
+
import { Loop } from '../../loop.js';
|
|
3
|
+
import { CpNode } from '../../cp-node.js';
|
|
4
|
+
import { IPointOnShape } from '../../point-on-shape.js';
|
|
5
|
+
import { findAndAdd2Prongs } from './find-and-add-2-prongs.js';
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
1
|
/** @hidden */
|
|
3
2
|
declare var _debug_: Debug;
|
|
4
3
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { Loop } from
|
|
8
|
-
import { CpNode } from '../../cp-node';
|
|
9
|
-
import { IPointOnShape } from '../../point-on-shape';
|
|
10
|
-
import { getShapeBounds } from '../../svg/get-shape-bounds';
|
|
11
|
-
import { Circle } from '../../circle';
|
|
12
|
-
import { find2Prong } from './find-2-prong/find-2-prong';
|
|
13
|
-
import { add2Prong } from './add-2-prong';
|
|
4
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
5
|
+
import { Debug } from '../../debug/debug.js';
|
|
6
|
+
import { Loop } from '../../loop.js';
|
|
7
|
+
import { CpNode } from '../../cp-node.js';
|
|
8
|
+
import { IPointOnShape } from '../../point-on-shape.js';
|
|
9
|
+
import { getShapeBounds } from '../../svg/get-shape-bounds.js';
|
|
10
|
+
import { Circle } from '../../circle.js';
|
|
11
|
+
import { find2Prong } from './find-2-prong/find-2-prong.js';
|
|
12
|
+
import { add2Prong } from './add-2-prong.js';
|
|
14
13
|
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
|
|
2
1
|
/** @hidden */
|
|
3
2
|
declare var _debug_: Debug;
|
|
4
3
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { CpNode } from '../../cp-node';
|
|
8
|
-
import { Loop } from '../../loop';
|
|
9
|
-
import { Circle } from '../../circle';
|
|
10
|
-
import { calcPosOrder, isPosSharpCorner } from '../../point-on-shape';
|
|
11
|
-
import { find3Prong } from './find-3-prong/find-3-prong';
|
|
12
|
-
import { add3Prong } from '../find-mat/add-3-prong';
|
|
4
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
5
|
+
import { Debug } from '../../debug/debug.js';
|
|
6
|
+
import { CpNode } from '../../cp-node.js';
|
|
7
|
+
import { Loop } from '../../loop.js';
|
|
8
|
+
import { Circle } from '../../circle.js';
|
|
9
|
+
import { calcPosOrder, isPosSharpCorner } from '../../point-on-shape.js';
|
|
10
|
+
import { find3Prong } from './find-3-prong/find-3-prong.js';
|
|
11
|
+
import { add3Prong } from '../find-mat/add-3-prong.js';
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
/**
|