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
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { eSign, twoProduct, eDiff, expansionProduct, fastExpansionSum, scaleExpansion } from "big-float-ts";
|
|
2
|
+
import { tangentAt0, evaluate2ndDerivativeAt0, toPowerBasis_3rdDerivative } from "flo-bezier3";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Compare the curvature, κ, between two curves at t === 0.
|
|
7
|
+
*
|
|
8
|
+
* Returns a positive number if κ for psI > κ for psO, negative if κ for psI < κ
|
|
9
|
+
* for psO or zero if the curve extensions are identical (i.e. in same K-family).
|
|
10
|
+
*
|
|
11
|
+
* Precondition: The point psI evaluated at zero must === the point psO
|
|
12
|
+
* evaluated at zero.
|
|
13
|
+
*
|
|
14
|
+
* // TODO - is this correct?
|
|
15
|
+
* Exact: Returns the exact result if the bithlength of all
|
|
16
|
+
* coordinates <= 53 - 5 === 48 and are bit-aligned.
|
|
17
|
+
*
|
|
18
|
+
* @param psI An order 1, 2 or 3 bezier, e.g. [[0,0],[1,1],[2,1],[2,0]]
|
|
19
|
+
* representing the incoming curve
|
|
20
|
+
* @param psO Another bezier representing the outgoing curve
|
|
21
|
+
*/
|
|
22
|
+
function compareCurvaturesAtInterface(
|
|
23
|
+
psI: number[][],
|
|
24
|
+
psO: number[][]) {
|
|
25
|
+
|
|
26
|
+
// Get x' and y' for incoming curve evaluated at 0
|
|
27
|
+
let [dxI, dyI] = tangentAt0(psI); // max bitlength increase / max shift === 3
|
|
28
|
+
// Get x'' and y'' for incoming curve evaluated at 0
|
|
29
|
+
let [ddxI, ddyI] = evaluate2ndDerivativeAt0(psI); // max bitlength increase / max shift === 5
|
|
30
|
+
|
|
31
|
+
// Get x' and y' for outgoing curve evaluated at 0
|
|
32
|
+
let [dxO, dyO] = tangentAt0(psO); // max bitlength increase / max shift === 3
|
|
33
|
+
// Get x'' and y'' for outgoing curve evaluated at 0
|
|
34
|
+
let [ddxO, ddyO] = evaluate2ndDerivativeAt0(psO); // max bitlength increase / max shift === 5
|
|
35
|
+
|
|
36
|
+
//console.log('κI: ', κ(psI, 0));
|
|
37
|
+
//console.log('κO: ', κ(psO, 0));
|
|
38
|
+
|
|
39
|
+
// Remember the formula for the signed curvature of a parametric curve:
|
|
40
|
+
// κ = x′y′′ - y′x′′ / sqrt(x′² + y′²)³
|
|
41
|
+
// κ² = (x′y′′ - y′x′′)² / (x′² + y′²)³
|
|
42
|
+
|
|
43
|
+
// This allows us to do an exact comparison of curvatures
|
|
44
|
+
// Simplifying the above gives (denoting the incoming curve with a subscript
|
|
45
|
+
// of 1 and the outgoing with a 2):
|
|
46
|
+
// κIncoming > κOutgoing
|
|
47
|
+
// <=> (x₁′y₁′′ - y₁′x₁′′)²(x₂′² + y₂′²)³ > (x₂′y₂′′ - y₂′x₂′′)²(x₁′² + y₁′²)³
|
|
48
|
+
// <=> a²b³ > c²d³
|
|
49
|
+
// Note b³ > 0 and d³ > 0
|
|
50
|
+
|
|
51
|
+
// max aggregate bitlength increase (let original bitlength === p):
|
|
52
|
+
// a -> 2 x ((p+3)+(p+5) + 1) === 4p + 18 -> max p in double precision === 8 -> too low
|
|
53
|
+
//let a = (dxI*ddyI - dyI*ddxI)**2;
|
|
54
|
+
// b -> 3 x ((p+3) + 1) === 3p + 12
|
|
55
|
+
//let b = (dxO*dxO + dyO*dyO )**3;
|
|
56
|
+
// c -> 2 x ((p+3)+(p+5) + 1) === 4p + 18
|
|
57
|
+
//let c = (dxO*ddyO - dyO*ddxO)**2;
|
|
58
|
+
// d -> 3 x ((p+3) + 1) === 3p + 12
|
|
59
|
+
//let d = (dxI*dxI + dyI*dyI )**3;
|
|
60
|
+
|
|
61
|
+
// We need to resort to exact floating point arithmetic at this point
|
|
62
|
+
let a = eDiff(
|
|
63
|
+
twoProduct(dxI, ddyI),
|
|
64
|
+
twoProduct(dyI, ddxI)
|
|
65
|
+
);
|
|
66
|
+
let c = eDiff(
|
|
67
|
+
twoProduct(dxO, ddyO),
|
|
68
|
+
twoProduct(dyO, ddxO)
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
let signA = eSign(a);
|
|
72
|
+
let signC = eSign(c);
|
|
73
|
+
if (signA !== signC) {
|
|
74
|
+
//console.log('branch 3');
|
|
75
|
+
return signA - signC;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
let b = fastExpansionSum(
|
|
79
|
+
twoProduct(dxO, dxO),
|
|
80
|
+
twoProduct(dyO, dyO)
|
|
81
|
+
);
|
|
82
|
+
let d = fastExpansionSum(
|
|
83
|
+
twoProduct(dxI, dxI),
|
|
84
|
+
twoProduct(dyI, dyI)
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
let b2 = expansionProduct(b, b);
|
|
88
|
+
let b3 = expansionProduct(b2, b);
|
|
89
|
+
let d2 = expansionProduct(d, d);
|
|
90
|
+
let d3 = expansionProduct(d2, d);
|
|
91
|
+
|
|
92
|
+
if (signA !== 0 || signC !== 0) {
|
|
93
|
+
//console.log('branch 4');
|
|
94
|
+
let a2 = expansionProduct(a, a);
|
|
95
|
+
let c2 = expansionProduct(c, c);
|
|
96
|
+
|
|
97
|
+
// max aggregate bitlength increase (let original bitlength === p):
|
|
98
|
+
// κ -> (2 x ((p+3)+(p+5) + 1)) + (3 x ((p+3) + 1)) === 7p + 30
|
|
99
|
+
// e.g. for bit-aligned input bitlength p of 10 we get output bitlength
|
|
100
|
+
// of 100, or for p === 3 (the max exact bitlength allowed to have exact
|
|
101
|
+
// results without resorting to infinite precision) we get 51 bits.
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
let κI = expansionProduct(a2,b3);
|
|
105
|
+
let κO = expansionProduct(c2,d3);
|
|
106
|
+
let δκ = eSign(eDiff(κI, κO));
|
|
107
|
+
|
|
108
|
+
if (δκ !== 0) {
|
|
109
|
+
//console.log('branch 5');
|
|
110
|
+
// At this point signA === signC, both +tive or -tive
|
|
111
|
+
return signA > 0 ? δκ : -δκ;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// At this point signA === signC, both +tive or -tive or 0
|
|
116
|
+
|
|
117
|
+
// Now we have to look at the change of curvature w.r.t. the parameter t,
|
|
118
|
+
// i.e.
|
|
119
|
+
// κ′ = [(x′²+y′²)(x′y′′′-y′x′′′) - 3(x′y′′-y′x′′)(x′x′′+y′y′′)] / (x′²+y′²)^(5/2)
|
|
120
|
+
// Therefore: (denoting the incoming curve with a subscript of 1 and the outgoing with a 2)
|
|
121
|
+
// κ′Incoming > κ′Outgoing
|
|
122
|
+
// <=> [(x₁′²+y₁′²)(x₁′y₁′′′-y₁′x₁′′′) - 3(x₁′y₁′′-y₁′x₁′′)(x₁′x₁′′+y₁′y₁′′)]²(x₂′²+y₂′²)⁵ >
|
|
123
|
+
// [(x₂′²+y₂′²)(x₂′y₂′′′-y₂′x₂′′′) - 3(x₂′y₂′′-y₂′x₂′′)(x₂′x₂′′+y₂′y₂′′)]²(x₁′²+y₁′²)⁵
|
|
124
|
+
// <=> (de - 3af)²b⁵ > (bg - 3ch)²d⁵
|
|
125
|
+
// <=> i²b⁵ > j²d⁵
|
|
126
|
+
|
|
127
|
+
// Get x′′′ and y′′′ for incoming curve evaluated at 1
|
|
128
|
+
let [dddxI, dddyI] = toPowerBasis_3rdDerivative(psI); // max bitlength increase === max shift === 6
|
|
129
|
+
let [dddxO, dddyO] = toPowerBasis_3rdDerivative(psO); // max bitlength increase === max shift === 6
|
|
130
|
+
|
|
131
|
+
let e = eDiff(
|
|
132
|
+
twoProduct(dxI, dddyI),
|
|
133
|
+
twoProduct(dyI, dddxI)
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
let f = fastExpansionSum(
|
|
137
|
+
twoProduct(dxI, ddxI),
|
|
138
|
+
twoProduct(dyI, ddyI)
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
let g = eDiff(
|
|
142
|
+
twoProduct(dxO, dddyO),
|
|
143
|
+
twoProduct(dyO, dddxO)
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
let h = fastExpansionSum(
|
|
147
|
+
twoProduct(dxO, ddxO),
|
|
148
|
+
twoProduct(dyO, ddyO)
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
// (de - 3af)²b⁵ > (bg - 3ch)²d⁵
|
|
152
|
+
// i²b⁵ > j²d⁵
|
|
153
|
+
let i = eDiff(
|
|
154
|
+
expansionProduct(d, e),
|
|
155
|
+
scaleExpansion(
|
|
156
|
+
expansionProduct(a, f),
|
|
157
|
+
3
|
|
158
|
+
)
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
let j = eDiff(
|
|
162
|
+
expansionProduct(b, g),
|
|
163
|
+
scaleExpansion(
|
|
164
|
+
expansionProduct(c, h),
|
|
165
|
+
3
|
|
166
|
+
)
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
let signI = eSign(i);
|
|
170
|
+
let signJ = eSign(j);
|
|
171
|
+
if (signA !== signC) {
|
|
172
|
+
return signI - signJ;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (signI === 0 && signJ === 0) {
|
|
176
|
+
// Both curve extensions are identical, i.e. in the same K-family
|
|
177
|
+
return 0;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
let i2 = expansionProduct(i,i);
|
|
181
|
+
let b5 = expansionProduct(b2,b3);
|
|
182
|
+
let j2 = expansionProduct(j,j);
|
|
183
|
+
let d5 = expansionProduct(d2,d3);
|
|
184
|
+
|
|
185
|
+
let dκI = expansionProduct(i2,b5);
|
|
186
|
+
let dκO = expansionProduct(j2,d5);
|
|
187
|
+
|
|
188
|
+
let sgn = eSign(eDiff(dκI, dκO));
|
|
189
|
+
|
|
190
|
+
return signI > 0 ? sgn : -sgn;
|
|
191
|
+
|
|
192
|
+
// If the above returned value is still zero then the two curve extensions
|
|
193
|
+
// are identical, i.e. in the same K-family
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
export { compareCurvaturesAtInterface }
|
package/src/contact-point.ts
CHANGED
package/src/cp-node/clone.ts
CHANGED
package/src/cp-node/remove.ts
CHANGED
package/src/cp-node.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
1
|
/** @hidden */
|
|
3
2
|
declare var _debug_: Debug;
|
|
4
3
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { ContactPoint, compareCps } from './contact-point';
|
|
8
|
-
import { removeCpNode } from './cp-node/remove';
|
|
9
|
-
import { getCurveToNext } from './get-curve-to-next';
|
|
4
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
5
|
+
import { Debug } from './debug/debug.js';
|
|
6
|
+
import { ContactPoint, compareCps } from './contact-point.js';
|
|
7
|
+
import { removeCpNode } from './cp-node/remove.js';
|
|
8
|
+
import { getCurveToNext } from './get-curve-to-next.js';
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
/**
|
|
@@ -268,8 +267,7 @@ class CpNode {
|
|
|
268
267
|
*
|
|
269
268
|
* This is always the case for sharp corners and maximal disks with
|
|
270
269
|
* a single contact point. Note, however, that even in these cases there are
|
|
271
|
-
* two contact points stored (
|
|
272
|
-
* itting 'on top' of each other) for the
|
|
270
|
+
* two contact points stored (sitting 'on top' of each other) for the
|
|
273
271
|
* maximal disk. It can be seen as a limiting case of a two-prong where the
|
|
274
272
|
* distance between two of the contact points tend to zero. One point
|
|
275
273
|
* (represented by a [[CpNode]] of course) will be terminating with the
|
package/src/curve.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
1
|
import { memoize } from 'flo-memoize';
|
|
3
2
|
import { cross, dot, toUnitVector } from 'flo-vector2d';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { getInterfaceCcw } from './get-interface-ccw.js';
|
|
4
|
+
import { Loop } from './loop.js';
|
|
5
|
+
import { Corner } from './mat/corner.js';
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Circle } from "../circle";
|
|
10
|
-
import { ICpNodeForDebugging } from "./cp-node-for-debugging";
|
|
1
|
+
import { IPointOnShape } from '../point-on-shape.js';
|
|
2
|
+
import { TwoProngForDebugging } from './two-prong-for-debugging.js';
|
|
3
|
+
import { ThreeProngForDebugging } from './three-prong-for-debugging.js';
|
|
4
|
+
import { Curve } from '../curve.js';
|
|
5
|
+
import { Mat } from '../mat.js';
|
|
6
|
+
import { CpNode } from '../cp-node.js';
|
|
7
|
+
import { Circle } from '../circle.js';
|
|
8
|
+
import { ICpNodeForDebugging } from './cp-node-for-debugging.js';
|
|
11
9
|
|
|
12
10
|
|
|
13
11
|
/** @hidden */
|
package/src/debug/debug.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { IDebugElems } from './debug-elem-types';
|
|
1
|
+
import { generalDebugFunctions } from './functions/general.js';
|
|
2
|
+
import { IGeneralDebugFunctions } from './functions/general.js';
|
|
3
|
+
import { twoProngDebugFunctions } from './functions/two-prong.js';
|
|
4
|
+
import { ITwoProngDebugFunctions } from './functions/two-prong.js';
|
|
5
|
+
import { threeProngDebugFunctions } from './functions/three-prong.js';
|
|
6
|
+
import { IThreeProngDebugFunctions } from './functions/three-prong.js';
|
|
7
|
+
import { drawElemFunctions, TDrawElemFunctions } from './functions/draw-elem/draw-elem.js';
|
|
8
|
+
import { IDebugElems } from './debug-elem-types.js';
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
/** @hidden */
|
|
@@ -28,8 +27,8 @@ type GeneratedElems = { [T in keyof IDebugElems]: IDebugElems[T][] };
|
|
|
28
27
|
|
|
29
28
|
/** @hidden */
|
|
30
29
|
interface ITiming {
|
|
31
|
-
normalize : number;
|
|
32
|
-
simplifyPaths : number;
|
|
30
|
+
//normalize : number;
|
|
31
|
+
//simplifyPaths : number;
|
|
33
32
|
holeClosers : number;
|
|
34
33
|
oneAnd2Prongs : number;
|
|
35
34
|
threeProngs : number;
|
|
@@ -76,9 +75,11 @@ function enableDebugForMat(debugOn: boolean) {
|
|
|
76
75
|
debug = {
|
|
77
76
|
...debug,
|
|
78
77
|
generated: {
|
|
79
|
-
|
|
78
|
+
//...debug?.generated,
|
|
79
|
+
...(!debug ? {} : !debug.generated ? {} : debug.generated),
|
|
80
80
|
elems: {
|
|
81
|
-
|
|
81
|
+
//...debug?.generated?.elems,
|
|
82
|
+
...(!debug ? {} : !debug.generated ? {} : !debug.generated.elems ? {} : debug.generated.elems),
|
|
82
83
|
twoProng_regular : [],
|
|
83
84
|
twoProng_failed : [],
|
|
84
85
|
twoProng_notAdded : [],
|
|
@@ -101,7 +102,8 @@ function enableDebugForMat(debugOn: boolean) {
|
|
|
101
102
|
culls : [],
|
|
102
103
|
},
|
|
103
104
|
timing: {
|
|
104
|
-
|
|
105
|
+
//...debug?.generated?.timing,
|
|
106
|
+
...(!debug ? {} : !debug.generated ? {} : !debug.generated.timing ? {} : debug.generated.timing),
|
|
105
107
|
holeClosers : 0,
|
|
106
108
|
oneAnd2Prongs : 0,
|
|
107
109
|
threeProngs : 0,
|
|
@@ -110,9 +112,11 @@ function enableDebugForMat(debugOn: boolean) {
|
|
|
110
112
|
}
|
|
111
113
|
},
|
|
112
114
|
fs: {
|
|
113
|
-
|
|
115
|
+
//...debug?.fs,
|
|
116
|
+
...(!debug ? {} : !debug.fs ? {} : debug.fs),
|
|
114
117
|
drawElem: {
|
|
115
|
-
|
|
118
|
+
//...debug?.fs?.drawElem,
|
|
119
|
+
...(!debug ? {} : !debug.fs ? {} : !debug.fs.drawElem ? {} : debug.fs.drawElem),
|
|
116
120
|
...drawElemFunctions
|
|
117
121
|
},
|
|
118
122
|
...generalDebugFunctions,
|
|
@@ -120,7 +124,8 @@ function enableDebugForMat(debugOn: boolean) {
|
|
|
120
124
|
threeProng: threeProngDebugFunctions,
|
|
121
125
|
},
|
|
122
126
|
directives: {
|
|
123
|
-
|
|
127
|
+
//...debug?.directives,
|
|
128
|
+
...(!debug ? {} : !debug.directives ? {} : debug.directives),
|
|
124
129
|
stopAfterHoleClosers: false,
|
|
125
130
|
stopAfterHoleClosersNum: undefined,
|
|
126
131
|
stopAfterTwoProngs: false,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
1
|
import { drawFs } from 'flo-draw';
|
|
3
|
-
import { CpNode } from '../../../cp-node';
|
|
4
|
-
import { getCurveToNext } from '../../../get-curve-to-next';
|
|
2
|
+
import { CpNode } from '../../../cp-node.js';
|
|
3
|
+
import { getCurveToNext } from '../../../get-curve-to-next.js';
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
/** @hidden */
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { oneProngAtDullCorner } from './one-prong-at-dull-corner';
|
|
1
|
+
import { IDebugElems } from '../../debug-elem-types.js';
|
|
2
|
+
import { drawOneProng } from './one-prong.js';
|
|
3
|
+
import { twoProng } from './two-prong.js';
|
|
4
|
+
import { threeProng } from './three-prong.js';
|
|
5
|
+
import { vertex } from './vertex.js';
|
|
6
|
+
import { minY } from './min-y.js';
|
|
7
|
+
import { boundingHull } from './bounding-hull.js';
|
|
8
|
+
import { looseBoundingBox } from './loose-bounding-box.js';
|
|
9
|
+
import { tightBoundingBox } from './tight-bounding-box.js';
|
|
10
|
+
import { sharpCorner } from './sharp-corner.js';
|
|
11
|
+
import { dullCorner } from './dull-corner.js';
|
|
12
|
+
import { drawMat } from './mat.js';
|
|
13
|
+
import { loop } from './loop.js';
|
|
14
|
+
import { loops } from './loops.js';
|
|
15
|
+
import { maxVertex } from './max-vertex.js';
|
|
16
|
+
import { leaves } from './leaves.js';
|
|
17
|
+
import { culls } from './culls.js';
|
|
18
|
+
import { oneProngAtDullCorner } from './one-prong-at-dull-corner.js';
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
/** @hidden */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import { Curve } from '../../../curve';
|
|
3
1
|
import { drawFs } from 'flo-draw';
|
|
2
|
+
import { Curve } from '../../../curve.js';
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
/** @hidden */
|
|
7
6
|
function dullCorner(g: SVGGElement, curve: Curve) {
|
|
8
7
|
const scaleFactor = 1;
|
|
9
8
|
|
|
10
|
-
let
|
|
9
|
+
let ps = curve.ps;
|
|
10
|
+
let p = curve.ps[ps.length-1];
|
|
11
11
|
let $pos = drawFs.dot(g, p, 0.5*scaleFactor, 'orange');
|
|
12
12
|
|
|
13
13
|
return $pos;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { Mat } from '../../../mat';
|
|
3
|
-
import { traverseEdges } from "../../../traverse-edges";
|
|
4
1
|
import { drawFs } from 'flo-draw';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { Mat } from '../../../mat.js';
|
|
3
|
+
import { traverseEdges } from '../../../traverse-edges.js';
|
|
4
|
+
import { getCurveToNext } from '../../../get-curve-to-next.js';
|
|
7
5
|
|
|
8
6
|
|
|
9
7
|
/** @hidden */
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { getX, getY, toCubic, evalDeCasteljau } from 'flo-bezier3';
|
|
3
|
-
|
|
4
|
-
import { IPointOnShape } from '../../../point-on-shape';
|
|
1
|
+
import { toCubic, evalDeCasteljau } from 'flo-bezier3';
|
|
5
2
|
import { drawFs } from 'flo-draw';
|
|
3
|
+
import { IPointOnShape } from '../../../point-on-shape.js';
|
|
6
4
|
|
|
7
5
|
|
|
8
6
|
/** @hidden */
|
|
@@ -10,9 +8,9 @@ function minY(g: SVGGElement, pos: IPointOnShape) {
|
|
|
10
8
|
let p = evalDeCasteljau(pos.curve.ps, pos.t) ;
|
|
11
9
|
|
|
12
10
|
let ps = toCubic(pos.curve.ps);
|
|
13
|
-
console.log('x: ', getX(ps));
|
|
14
|
-
console.log('y: ', getY(ps));
|
|
15
|
-
console.log('t: ', pos.t);
|
|
11
|
+
//console.log('x: ', getX(ps));
|
|
12
|
+
//console.log('y: ', getY(ps));
|
|
13
|
+
//console.log('t: ', pos.t);
|
|
16
14
|
|
|
17
15
|
let $elems = drawFs.crossHair(
|
|
18
16
|
g, p, 'red thin10 nofill'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { getOsculatingCircle, IPointOnShape } from '../../../point-on-shape';
|
|
3
|
-
import { Circle, scaleCircle } from '../../../circle';
|
|
4
1
|
import { drawFs } from 'flo-draw';
|
|
2
|
+
import { getOsculatingCircle, IPointOnShape } from '../../../point-on-shape.js';
|
|
3
|
+
import { Circle, scaleCircle } from '../../../circle.js';
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
/** @hidden */
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { ThreeProngForDebugging } from '../../three-prong-for-debugging';
|
|
3
|
-
|
|
4
|
-
import { Circle, scaleCircle } from '../../../circle';
|
|
5
1
|
import { drawFs } from 'flo-draw';
|
|
2
|
+
import { ThreeProngForDebugging } from '../../three-prong-for-debugging.js';
|
|
3
|
+
import { Circle, scaleCircle } from '../../../circle.js';
|
|
6
4
|
|
|
7
5
|
|
|
8
6
|
/** @hidden */
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { TwoProngForDebugging } from '../../two-prong-for-debugging';
|
|
3
|
-
import { getTwoProngType } from '../../../mat/get-two-prong-type';
|
|
4
1
|
import { drawFs } from 'flo-draw';
|
|
2
|
+
import { TwoProngForDebugging } from '../../two-prong-for-debugging.js';
|
|
3
|
+
import { getTwoProngType } from '../../../mat/get-two-prong-type.js';
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
/** @hidden */
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
1
|
/** @hidden */
|
|
3
2
|
declare let _debug_: Debug;
|
|
4
3
|
|
|
5
|
-
import { Debug } from '../debug';
|
|
6
|
-
import { equal, getObjClosestTo } from 'flo-vector2d';
|
|
7
|
-
import { ThreeProngForDebugging } from '../three-prong-for-debugging';
|
|
8
4
|
import { drawFs } from 'flo-draw';
|
|
5
|
+
import { equal, getObjClosestTo } from 'flo-vector2d';
|
|
6
|
+
import { Debug } from '../debug.js';
|
|
7
|
+
import { ThreeProngForDebugging } from '../three-prong-for-debugging.js';
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
/** @hidden */
|