flo-mat 2.0.4 → 3.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/.quokka +4 -0
- package/browser/index.js +18434 -14538
- package/browser/index.min.js +1 -1
- package/node/closest-boundary-point/cull-bezier-pieces.d.ts +9 -0
- package/node/closest-boundary-point/cull-bezier-pieces.js +17 -0
- package/node/closest-boundary-point/cull-bezier-pieces.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.js +2 -2
- package/node/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.js +1 -1
- package/node/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.d.ts +25 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.js +68 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.js.map +1 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.d.ts +10 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.js +2 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.js +2 -3
- package/node/closest-boundary-point/get-best-distance-squared.js.map +1 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.d.ts +15 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.js +40 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.d.ts +15 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.js +42 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.js.map +1 -0
- package/node/closest-boundary-point/get-p-from-box.d.ts +3 -0
- package/node/closest-boundary-point/get-p-from-box.js +11 -0
- package/node/closest-boundary-point/get-p-from-box.js.map +1 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.d.ts +12 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js +93 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js.map +1 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.d.ts +13 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js +58 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js.map +1 -0
- package/node/{contact-point.d.ts → contact-point/contact-point.d.ts} +3 -3
- package/node/{contact-point.js → contact-point/contact-point.js} +1 -5
- package/node/contact-point/contact-point.js.map +1 -0
- package/node/{compare-curvatures-at-interface.js → corner/compare-curvatures-at-interface.js} +2 -2
- package/node/corner/compare-curvatures-at-interface.js.map +1 -0
- package/node/{mat → corner}/corner.d.ts +1 -1
- package/node/{mat → corner}/corner.js.map +1 -1
- package/node/corner/get-corner.d.ts +15 -0
- package/node/{curve.js → corner/get-corner.js} +6 -17
- package/node/corner/get-corner.js.map +1 -0
- package/node/{get-interface-ccw.js → corner/get-interface-ccw.js} +18 -33
- package/node/corner/get-interface-ccw.js.map +1 -0
- package/node/cp-node/clone.d.ts +1 -1
- package/node/cp-node/clone.js +6 -4
- package/node/cp-node/clone.js.map +1 -1
- package/node/cp-node/cp-node.d.ts +196 -0
- package/node/cp-node/cp-node.js +249 -0
- package/node/cp-node/cp-node.js.map +1 -0
- package/node/cp-node/create-cp-node.d.ts +4 -0
- package/node/cp-node/create-cp-node.js +8 -0
- package/node/cp-node/create-cp-node.js.map +1 -0
- package/node/cp-node/enhance-cp-node.d.ts +24 -0
- package/node/cp-node/enhance-cp-node.js +20 -0
- package/node/cp-node/enhance-cp-node.js.map +1 -0
- package/node/{get-boundary-bezier-parts-to-next.js → cp-node/get-boundary-bezier-parts-to-next.js} +1 -1
- package/node/cp-node/get-boundary-bezier-parts-to-next.js.map +1 -0
- package/node/{get-boundary-beziers-to-next.d.ts → cp-node/get-boundary-beziers-to-next.d.ts} +1 -1
- package/node/{get-boundary-beziers-to-next.js → cp-node/get-boundary-beziers-to-next.js} +1 -1
- package/node/cp-node/get-boundary-beziers-to-next.js.map +1 -0
- package/node/cp-node/get-cp-node-ordering.d.ts +8 -0
- package/node/cp-node/get-cp-node-ordering.js +12 -0
- package/node/cp-node/get-cp-node-ordering.js.map +1 -0
- package/node/{get-curve-to-next.js → cp-node/get-curve-to-next.js} +1 -1
- package/node/cp-node/get-curve-to-next.js.map +1 -0
- package/node/cp-node/remove.d.ts +1 -1
- package/node/cp-node/traverse-cp.d.ts +12 -0
- package/node/cp-node/traverse-cp.js +26 -0
- package/node/cp-node/traverse-cp.js.map +1 -0
- package/node/{traverse-edges.js → cp-node/traverse-edges.js} +4 -3
- package/node/cp-node/traverse-edges.js.map +1 -0
- package/node/{traverse-vertices.js → cp-node/traverse-vertices.js} +4 -3
- package/node/cp-node/traverse-vertices.js.map +1 -0
- package/node/{curve.d.ts → curve/curve.d.ts} +4 -17
- package/node/curve/curve.js +14 -0
- package/node/curve/curve.js.map +1 -0
- package/node/debug/cp-node-for-debugging.d.ts +2 -2
- package/node/debug/debug-elem-types.d.ts +8 -8
- package/node/debug/debug.d.ts +6 -6
- package/node/debug/debug.js +2 -2
- package/node/debug/debug.js.map +1 -1
- package/node/debug/functions/draw-elem/bounding-hull.d.ts +2 -2
- package/node/debug/functions/draw-elem/bounding-hull.js +3 -3
- package/node/debug/functions/draw-elem/bounding-hull.js.map +1 -1
- package/node/debug/functions/draw-elem/branch.d.ts +2 -2
- package/node/debug/functions/draw-elem/branch.js +4 -3
- package/node/debug/functions/draw-elem/branch.js.map +1 -1
- package/node/debug/functions/draw-elem/culls.d.ts +2 -2
- package/node/debug/functions/draw-elem/culls.js +2 -2
- package/node/debug/functions/draw-elem/culls.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.js +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-elem.d.ts +3 -3
- package/node/debug/functions/draw-elem/draw-elem.js +3 -3
- package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
- package/node/debug/functions/draw-elem/dull-corner.d.ts +3 -3
- package/node/debug/functions/draw-elem/dull-corner.js +3 -4
- package/node/debug/functions/draw-elem/dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/leaves.d.ts +2 -2
- package/node/debug/functions/draw-elem/leaves.js +1 -1
- package/node/debug/functions/draw-elem/leaves.js.map +1 -1
- package/node/debug/functions/draw-elem/loop.d.ts +2 -2
- package/node/debug/functions/draw-elem/loop.js +1 -2
- 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 +0 -1
- package/node/debug/functions/draw-elem/loops.js.map +1 -1
- package/node/debug/functions/draw-elem/loose-bounding-box.d.ts +2 -2
- package/node/debug/functions/draw-elem/loose-bounding-box.js +3 -3
- package/node/debug/functions/draw-elem/loose-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/mat.d.ts +3 -3
- package/node/debug/functions/draw-elem/mat.js +9 -7
- package/node/debug/functions/draw-elem/mat.js.map +1 -1
- package/node/debug/functions/draw-elem/max-vertex.d.ts +2 -2
- package/node/debug/functions/draw-elem/max-vertex.js +1 -1
- package/node/debug/functions/draw-elem/max-vertex.js.map +1 -1
- package/node/debug/functions/draw-elem/min-y.d.ts +3 -3
- package/node/debug/functions/draw-elem/min-y.js +2 -6
- 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 +2 -2
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js +2 -2
- 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 +2 -2
- package/node/debug/functions/draw-elem/one-prong.js +6 -11
- package/node/debug/functions/draw-elem/one-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/sharp-corner.d.ts +3 -3
- package/node/debug/functions/draw-elem/sharp-corner.js +3 -4
- package/node/debug/functions/draw-elem/sharp-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/three-prong.d.ts +2 -2
- package/node/debug/functions/draw-elem/three-prong.js +8 -10
- package/node/debug/functions/draw-elem/three-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/tight-bounding-box.d.ts +2 -2
- package/node/debug/functions/draw-elem/tight-bounding-box.js +3 -3
- package/node/debug/functions/draw-elem/tight-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/two-prong.d.ts +2 -2
- package/node/debug/functions/draw-elem/two-prong.js +7 -8
- package/node/debug/functions/draw-elem/two-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/vertex.d.ts +4 -3
- package/node/debug/functions/draw-elem/vertex.js +11 -9
- package/node/debug/functions/draw-elem/vertex.js.map +1 -1
- package/node/debug/functions/general.d.ts +8 -8
- package/node/debug/functions/general.js +8 -8
- package/node/debug/functions/general.js.map +1 -1
- package/node/debug/functions/three-prong.d.ts +2 -2
- package/node/debug/functions/three-prong.js +10 -13
- package/node/debug/functions/three-prong.js.map +1 -1
- package/node/debug/functions/two-prong.d.ts +16 -5
- package/node/debug/functions/two-prong.js +56 -58
- package/node/debug/functions/two-prong.js.map +1 -1
- package/node/debug/three-prong-for-debugging.d.ts +6 -6
- package/node/debug/three-prong-for-debugging.js +1 -1
- package/node/debug/three-prong-for-debugging.js.map +1 -1
- package/node/debug/two-prong-for-debugging.d.ts +7 -7
- package/node/error-analysis/gamma.d.ts +26 -0
- package/node/error-analysis/gamma.js +35 -0
- package/node/error-analysis/gamma.js.map +1 -0
- package/node/find-2-prong/add-1-prong.d.ts +12 -0
- package/node/{mat/find-mat → find-2-prong}/add-1-prong.js +11 -11
- package/node/find-2-prong/add-1-prong.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/add-2-prong.d.ts +6 -9
- package/node/{mat/find-mat → find-2-prong}/add-2-prong.js +26 -74
- package/node/find-2-prong/add-2-prong.js.map +1 -0
- package/node/find-2-prong/add-debug-info.d.ts +8 -0
- package/node/{mat/find-mat/find-2-prong → find-2-prong}/add-debug-info.js +5 -4
- package/node/find-2-prong/add-debug-info.js.map +1 -0
- package/node/find-2-prong/cull-bezier-pieces.d.ts +11 -0
- package/node/find-2-prong/cull-bezier-pieces.js +28 -0
- package/node/find-2-prong/cull-bezier-pieces.js.map +1 -0
- package/node/{mat/find-mat/find-2-prong → find-2-prong}/find-2-prong.d.ts +9 -13
- package/node/find-2-prong/find-2-prong.js +144 -0
- package/node/find-2-prong/find-2-prong.js.map +1 -0
- package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.d.ts +15 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-2-prongs-on-all-paths.js +5 -4
- package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-2-prongs.d.ts +5 -5
- package/node/find-2-prong/find-and-add-2-prongs.js +60 -0
- package/node/find-2-prong/find-and-add-2-prongs.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.d.ts +3 -3
- package/node/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.js +5 -5
- package/node/find-2-prong/find-and-add-hole-closing-2-prongs.js.map +1 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.d.ts +10 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.js +56 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.js.map +1 -0
- package/node/find-2-prong/get-initial-bezier-pieces.d.ts +15 -0
- package/node/find-2-prong/get-initial-bezier-pieces.js +40 -0
- package/node/find-2-prong/get-initial-bezier-pieces.js.map +1 -0
- package/node/find-2-prong/reduce-radius.d.ts +8 -0
- package/node/find-2-prong/reduce-radius.js +72 -0
- package/node/find-2-prong/reduce-radius.js.map +1 -0
- package/node/find-2-prong/squared-distance-between-dd.d.ts +2 -0
- package/node/find-2-prong/squared-distance-between-dd.js +17 -0
- package/node/find-2-prong/squared-distance-between-dd.js.map +1 -0
- package/node/find-2-prong/x-for-debugging.d.ts +9 -0
- package/node/find-2-prong/x-for-debugging.js.map +1 -0
- package/node/{mat/find-mat → find-3-prong.ts}/add-3-prong.d.ts +12 -7
- package/node/find-3-prong.ts/add-3-prong.js +82 -0
- package/node/find-3-prong.ts/add-3-prong.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.d.ts +4 -4
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.js +1 -1
- package/node/find-3-prong.ts/calc-better-x.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.d.ts +3 -3
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.js +5 -7
- package/node/find-3-prong.ts/calc-initial-3-prong-center.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.d.ts +6 -6
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.js +11 -12
- package/node/find-3-prong.ts/find-3-prong-for-delta3s.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong.d.ts +5 -5
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong.js +52 -39
- package/node/find-3-prong.ts/find-3-prong.js.map +1 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.d.ts +5 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.js +74 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.js.map +1 -0
- package/node/{mat/find-mat/find-and-add-3-prongs.d.ts → find-3-prong.ts/find-and-add-all-3-prongs.d.ts} +3 -3
- package/node/find-3-prong.ts/find-and-add-all-3-prongs.js +66 -0
- package/node/find-3-prong.ts/find-and-add-all-3-prongs.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/get-closest-points.d.ts +3 -3
- package/node/find-3-prong.ts/get-closest-points.js +14 -0
- package/node/find-3-prong.ts/get-closest-points.js.map +1 -0
- package/node/{mat/find-mat → find-mat}/add-debug-info.d.ts +4 -4
- package/node/{mat/find-mat → find-mat}/add-debug-info.js +6 -6
- package/node/find-mat/add-debug-info.js.map +1 -0
- package/node/{mat/find-mat → find-mat}/create-initial-cp-graph.d.ts +5 -5
- package/node/{mat/find-mat → find-mat}/create-initial-cp-graph.js +5 -6
- package/node/find-mat/create-initial-cp-graph.js.map +1 -0
- package/node/find-mat/find-mat.d.ts +10 -0
- package/node/find-mat/find-mat.js +57 -0
- package/node/find-mat/find-mat.js.map +1 -0
- package/node/{find-mats.d.ts → find-mat/find-mats.d.ts} +1 -1
- package/node/find-mat/find-mats.js +58 -0
- package/node/find-mat/find-mats.js.map +1 -0
- package/node/find-mat/fix-ordering.d.ts +8 -0
- package/node/find-mat/fix-ordering.js +59 -0
- package/node/find-mat/fix-ordering.js.map +1 -0
- package/node/find-mat/get-dull-corners.d.ts +5 -0
- package/node/find-mat/get-dull-corners.js +22 -0
- package/node/find-mat/get-dull-corners.js.map +1 -0
- package/node/find-mat/get-for-1-prongs-on-loop.d.ts +11 -0
- package/node/find-mat/get-for-1-prongs-on-loop.js +28 -0
- package/node/find-mat/get-for-1-prongs-on-loop.js.map +1 -0
- package/node/find-mat/get-for-2-prongs-on-loop.d.ts +11 -0
- package/node/find-mat/get-for-2-prongs-on-loop.js +30 -0
- package/node/find-mat/get-for-2-prongs-on-loop.js.map +1 -0
- package/node/find-mat/get-sharp-corners.d.ts +5 -0
- package/node/find-mat/get-sharp-corners.js +21 -0
- package/node/find-mat/get-sharp-corners.js.map +1 -0
- package/node/find-mat/get-size-params.d.ts +7 -0
- package/node/find-mat/get-size-params.js +33 -0
- package/node/find-mat/get-size-params.js.map +1 -0
- package/node/geometry/circle.js.map +1 -0
- package/node/geometry/get-bounding-box-.js.map +1 -0
- package/node/{mat/geometry → geometry}/get-closest-square-distance-to-rect.d.ts +1 -1
- package/node/{mat/geometry → geometry}/get-closest-square-distance-to-rect.js +1 -1
- package/node/geometry/get-closest-square-distance-to-rect.js.map +1 -0
- package/node/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.d.ts +1 -1
- package/node/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.js +1 -1
- package/node/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -0
- package/node/get-curve/get-curve-between.d.ts +1 -1
- package/node/get-curve/get-curve-between.js +2 -2
- package/node/get-curve/get-curve-between.js.map +1 -1
- package/node/get-curve/get-edge-direction.d.ts +2 -2
- package/node/get-curve/get-edge-direction.js +2 -4
- package/node/get-curve/get-edge-direction.js.map +1 -1
- package/node/index.d.ts +24 -20
- package/node/index.js +21 -16
- package/node/index.js.map +1 -1
- package/node/loop/get-max-coordinate.d.ts +1 -1
- package/node/loop/get-max-coordinate.js +1 -1
- package/node/mat/add-to-cp-graph.d.ts +8 -7
- package/node/mat/add-to-cp-graph.js +6 -4
- package/node/mat/add-to-cp-graph.js.map +1 -1
- package/node/mat/bezier-piece.d.ts +2 -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.d.ts +1 -1
- package/node/mat/get-boundary-piece-beziers.d.ts +2 -2
- package/node/mat/get-boundary-piece-beziers.js +4 -4
- package/node/mat/get-boundary-piece-beziers.js.map +1 -1
- package/node/{get-branches.d.ts → mat/get-branches.d.ts} +1 -1
- package/node/{get-branches.js → mat/get-branches.js} +7 -6
- package/node/mat/get-branches.js.map +1 -0
- package/node/mat/get-largest-vertex.d.ts +2 -2
- package/node/mat/get-largest-vertex.js +1 -1
- package/node/mat/get-largest-vertex.js.map +1 -1
- package/node/mat/get-neighboring-cps.d.ts +6 -4
- package/node/mat/get-neighboring-cps.js +5 -3
- package/node/mat/get-neighboring-cps.js.map +1 -1
- package/node/mat/get-two-prong-type.d.ts +1 -1
- package/node/mat/get-two-prong-type.js +1 -1
- package/node/mat/get-two-prong-type.js.map +1 -1
- package/node/mat/is-another-cp-closeby.d.ts +9 -8
- package/node/mat/is-another-cp-closeby.js +21 -29
- package/node/mat/is-another-cp-closeby.js.map +1 -1
- package/node/{mat.d.ts → mat/mat.d.ts} +2 -2
- package/node/mat/mat.js.map +1 -0
- package/node/mat/simplify-mat-map-only.d.ts +1 -1
- package/node/mat/simplify-mat-map-only.js +4 -3
- package/node/mat/simplify-mat-map-only.js.map +1 -1
- package/node/{simplify-mat.d.ts → mat/simplify-mat.d.ts} +3 -5
- package/node/{simplify-mat.js → mat/simplify-mat.js} +11 -13
- package/node/mat/simplify-mat.js.map +1 -0
- package/node/mat/trim-mat.d.ts +1 -1
- package/node/mat/trim-mat.js +1 -1
- package/node/mat/trim-mat.js.map +1 -1
- package/node/point-on-shape/calc-pos-order.d.ts +13 -0
- package/node/point-on-shape/calc-pos-order.js +27 -0
- package/node/point-on-shape/calc-pos-order.js.map +1 -0
- package/node/point-on-shape/compare-poss.d.ts +10 -0
- package/node/point-on-shape/compare-poss.js +18 -0
- package/node/point-on-shape/compare-poss.js.map +1 -0
- package/node/point-on-shape/create-pos.d.ts +4 -0
- package/node/point-on-shape/create-pos.js +12 -0
- package/node/point-on-shape/create-pos.js.map +1 -0
- package/node/point-on-shape/get-osculating-circle.d.ts +10 -0
- package/node/point-on-shape/get-osculating-circle.js +25 -0
- package/node/point-on-shape/get-osculating-circle.js.map +1 -0
- package/node/point-on-shape/get-pos-corner.d.ts +7 -0
- package/node/point-on-shape/get-pos-corner.js +9 -0
- package/node/point-on-shape/get-pos-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-corner.js +8 -0
- package/node/point-on-shape/is-pos-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-dull-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-dull-corner.js +14 -0
- package/node/point-on-shape/is-pos-dull-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.js +14 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-sharp-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-sharp-corner.js +14 -0
- package/node/point-on-shape/is-pos-sharp-corner.js.map +1 -0
- package/node/point-on-shape/point-on-shape.d.ts +11 -0
- package/node/point-on-shape/point-on-shape.js +2 -0
- package/node/point-on-shape/point-on-shape.js.map +1 -0
- package/node/point-on-shape/pos-to-human-string.d.ts +8 -0
- package/node/point-on-shape/pos-to-human-string.js +12 -0
- package/node/point-on-shape/pos-to-human-string.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/add-debug-info.d.ts +2 -2
- package/node/{mat/to-scale-axis → sat}/add-debug-info.js +1 -1
- package/node/sat/add-debug-info.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/cull-non-cycles.d.ts +3 -3
- package/node/{mat/to-scale-axis → sat}/cull-non-cycles.js +6 -6
- package/node/sat/cull-non-cycles.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/cull.d.ts +3 -3
- package/node/{mat/to-scale-axis → sat}/cull.js +4 -4
- package/node/sat/cull.js.map +1 -0
- package/node/{mat → sat}/get-leaves.d.ts +2 -2
- package/node/sat/get-leaves.js +14 -0
- package/node/sat/get-leaves.js.map +1 -0
- package/node/{to-scale-axis.d.ts → sat/to-scale-axis.d.ts} +2 -2
- package/node/{to-scale-axis.js → sat/to-scale-axis.js} +11 -10
- package/node/sat/to-scale-axis.js.map +1 -0
- package/node/svg/get-loop-bounds.d.ts +7 -7
- package/node/svg/get-loop-bounds.js +11 -7
- package/node/svg/get-loop-bounds.js.map +1 -1
- package/node/svg/get-min-y-pos.d.ts +4 -4
- package/node/svg/get-min-y-pos.js +1 -1
- package/node/svg/get-shape-bounds.d.ts +6 -5
- package/node/svg/get-shape-bounds.js +6 -2
- package/node/svg/get-shape-bounds.js.map +1 -1
- package/node/sweep-line/sweep-line.d.ts +1 -1
- package/node/sweep-line/sweep-line.js +4 -4
- package/node/sweep-line/sweep-line.js.map +1 -1
- package/package.json +10 -10
- package/src/closest-boundary-point/closest-points-on-curve-precise.ts +75 -0
- package/src/closest-boundary-point/closest-points-on-curve.ts +72 -0
- package/src/closest-boundary-point/cull-bezier-pieces.ts +35 -0
- package/src/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.ts +4 -3
- package/src/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.ts +2 -2
- package/src/closest-boundary-point/dd-deflate-with-running-error.ts +88 -0
- package/src/closest-boundary-point/foot-and-endpoint-info.ts +16 -0
- package/src/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.ts +3 -4
- package/src/closest-boundary-point/get-close-boundary-points-certified.ts +69 -0
- package/src/closest-boundary-point/get-closest-boundary-point-certified.ts +70 -0
- package/src/closest-boundary-point/get-p-from-box.ts +14 -0
- package/src/closest-boundary-point/get-potential-closest-points-on-curve-certified.ts +122 -0
- package/src/closest-boundary-point/root-interval-to-distance-squared-interval.ts +75 -0
- package/src/{contact-point.ts → contact-point/contact-point.ts} +4 -6
- package/src/{compare-curvatures-at-interface.ts → corner/compare-curvatures-at-interface.ts} +2 -2
- package/src/{mat → corner}/corner.ts +1 -1
- package/src/{curve.ts → corner/get-corner.ts} +10 -49
- package/src/{get-interface-ccw.ts → corner/get-interface-ccw.ts} +28 -35
- package/src/cp-node/clone.ts +17 -6
- package/src/cp-node/cp-node.ts +422 -0
- package/src/cp-node/create-cp-node.ts +21 -0
- package/src/cp-node/enhance-cp-node.ts +27 -0
- package/src/{get-boundary-bezier-parts-to-next.ts → cp-node/get-boundary-bezier-parts-to-next.ts} +3 -3
- package/src/{get-boundary-beziers-to-next.ts → cp-node/get-boundary-beziers-to-next.ts} +2 -2
- package/src/cp-node/get-cp-node-ordering.ts +17 -0
- package/src/{get-curve-to-next.ts → cp-node/get-curve-to-next.ts} +1 -1
- package/src/cp-node/remove.ts +1 -1
- package/src/cp-node/traverse-cp.ts +35 -0
- package/src/{traverse-edges.ts → cp-node/traverse-edges.ts} +5 -5
- package/src/{traverse-vertices.ts → cp-node/traverse-vertices.ts} +5 -5
- package/src/curve/curve.ts +46 -0
- package/src/debug/cp-node-for-debugging.ts +2 -2
- package/src/debug/debug-elem-types.ts +8 -8
- package/src/debug/debug.ts +11 -11
- package/src/debug/functions/draw-elem/bounding-hull.ts +5 -3
- package/src/debug/functions/draw-elem/branch.ts +4 -4
- package/src/debug/functions/draw-elem/culls.ts +3 -3
- package/src/debug/functions/draw-elem/draw-circle-percent.ts +1 -1
- package/src/debug/functions/draw-elem/draw-elem.ts +10 -6
- package/src/debug/functions/draw-elem/dull-corner.ts +10 -6
- package/src/debug/functions/draw-elem/leaves.ts +2 -2
- package/src/debug/functions/draw-elem/loop.ts +4 -3
- package/src/debug/functions/draw-elem/loops.ts +1 -2
- package/src/debug/functions/draw-elem/loose-bounding-box.ts +8 -3
- package/src/debug/functions/draw-elem/mat.ts +16 -8
- package/src/debug/functions/draw-elem/max-vertex.ts +2 -2
- package/src/debug/functions/draw-elem/min-y.ts +4 -9
- package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +10 -2
- package/src/debug/functions/draw-elem/one-prong.ts +12 -15
- package/src/debug/functions/draw-elem/sharp-corner.ts +10 -6
- package/src/debug/functions/draw-elem/three-prong.ts +13 -11
- package/src/debug/functions/draw-elem/tight-bounding-box.ts +9 -3
- package/src/debug/functions/draw-elem/two-prong.ts +12 -8
- package/src/debug/functions/draw-elem/vertex.ts +12 -11
- package/src/debug/functions/general.ts +10 -10
- package/src/debug/functions/three-prong.ts +16 -20
- package/src/debug/functions/two-prong.ts +89 -77
- package/src/debug/three-prong-for-debugging.ts +17 -16
- package/src/debug/two-prong-for-debugging.ts +7 -7
- package/src/error-analysis/gamma.ts +41 -0
- package/src/{mat/find-mat → find-2-prong}/add-1-prong.ts +19 -16
- package/src/{mat/find-mat → find-2-prong}/add-2-prong.ts +45 -91
- package/src/find-2-prong/add-debug-info.ts +49 -0
- package/src/{mat/find-mat/find-2-prong → find-2-prong}/cull-bezier-pieces.ts +9 -11
- package/src/find-2-prong/find-2-prong.ts +191 -0
- package/src/{mat/find-mat → find-2-prong}/find-and-add-2-prongs-on-all-paths.ts +12 -9
- package/src/find-2-prong/find-and-add-2-prongs.ts +88 -0
- package/src/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.ts +7 -7
- package/src/find-2-prong/find-equidistant-point-on-line-dd.ts +77 -0
- package/src/{mat/find-mat/find-2-prong → find-2-prong}/find-equidistant-point-on-line.ts +1 -1
- package/src/find-2-prong/get-initial-bezier-pieces.ts +61 -0
- package/src/find-2-prong/pyth-trips.ts +146 -0
- package/src/find-2-prong/reduce-radius.ts +98 -0
- package/src/find-2-prong/squared-distance-between-dd.ts +25 -0
- package/src/find-2-prong/x-for-debugging.ts +13 -0
- package/src/find-3-prong.ts/add-3-prong.ts +110 -0
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.ts +5 -5
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.ts +11 -12
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.ts +28 -28
- package/src/find-3-prong.ts/find-3-prong.ts +148 -0
- package/src/find-3-prong.ts/find-and-add-3-prongs.ts +111 -0
- package/src/find-3-prong.ts/find-and-add-all-3-prongs.ts +109 -0
- package/src/find-3-prong.ts/get-closest-points.ts +24 -0
- package/src/{mat/find-mat → find-mat}/add-debug-info.ts +10 -10
- package/src/{mat/find-mat → find-mat}/create-initial-cp-graph.ts +11 -12
- package/src/find-mat/find-mat.ts +89 -0
- package/src/find-mat/find-mats.ts +83 -0
- package/src/find-mat/fix-ordering.ts +69 -0
- package/src/find-mat/get-dull-corners.ts +34 -0
- package/src/find-mat/get-for-1-prongs-on-loop.ts +40 -0
- package/src/find-mat/get-for-2-prongs-on-loop.ts +44 -0
- package/src/find-mat/get-sharp-corners.ts +33 -0
- package/src/find-mat/get-size-params.ts +34 -0
- package/src/{mat/find-mat → find-mat}/get-total-by.ts +4 -4
- package/src/{mat/geometry → geometry}/get-closest-square-distance-to-rect.ts +1 -1
- package/src/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.ts +2 -2
- package/src/get-curve/get-curve-between.ts +7 -7
- package/src/get-curve/get-edge-direction.ts +11 -11
- package/src/index.ts +64 -21
- package/src/loop/get-max-coordinate.ts +1 -1
- package/src/mat/add-to-cp-graph.ts +15 -12
- package/src/mat/bezier-piece.ts +2 -2
- package/src/mat/cmp-cp-on-delta.ts +6 -3
- package/src/mat/create-new-cp-tree.ts +6 -9
- package/src/mat/elem-type-two-prong.ts +1 -1
- package/src/mat/get-boundary-piece-beziers.ts +7 -7
- package/src/{get-branches.ts → mat/get-branches.ts} +8 -8
- package/src/mat/get-edges-as-array.ts +2 -2
- package/src/mat/get-largest-three-prong.ts +3 -3
- package/src/mat/get-largest-vertex.ts +2 -2
- package/src/mat/get-neighboring-cps.ts +9 -6
- package/src/mat/get-two-prong-type.ts +1 -1
- package/src/mat/is-another-cp-closeby.ts +29 -44
- package/src/{mat.ts → mat/mat.ts} +2 -2
- package/src/mat/simplify-mat-map-only.ts +5 -5
- package/src/{simplify-mat.ts → mat/simplify-mat.ts} +12 -14
- package/src/mat/trim-mat.ts +3 -3
- package/src/point-on-shape/calc-pos-order.ts +35 -0
- package/src/point-on-shape/compare-poss.ts +26 -0
- package/src/point-on-shape/create-pos.ts +21 -0
- package/src/point-on-shape/get-osculating-circle.ts +39 -0
- package/src/point-on-shape/get-pos-corner.ts +16 -0
- package/src/point-on-shape/is-pos-corner.ts +12 -0
- package/src/point-on-shape/is-pos-dull-corner.ts +16 -0
- package/src/point-on-shape/is-pos-quite-dull-corner.ts +17 -0
- package/src/point-on-shape/is-pos-quite-sharp-corner.ts +17 -0
- package/src/point-on-shape/is-pos-sharp-corner.ts +17 -0
- package/src/point-on-shape/point-on-shape.ts +15 -0
- package/src/point-on-shape/pos-to-human-string.ts +16 -0
- package/src/{mat/to-scale-axis → sat}/add-debug-info.ts +3 -3
- package/src/{mat/to-scale-axis → sat}/cull-non-cycles.ts +7 -7
- package/src/{mat/to-scale-axis → sat}/cull.ts +6 -6
- package/src/{mat → sat}/get-leaves.ts +4 -4
- package/src/{mat/to-scale-axis → sat}/t-tree.ts +2 -2
- package/src/{to-scale-axis.ts → sat/to-scale-axis.ts} +16 -16
- package/src/{mat/to-scale-axis → sat}/traverse-spacial-tree.ts +5 -5
- package/src/svg/get-loop-bounds.ts +22 -17
- package/src/svg/get-min-y-pos.ts +3 -3
- package/src/svg/get-shape-bounds.ts +12 -9
- package/src/sweep-line/are-boxes-intersecting.ts +1 -1
- package/src/sweep-line/sweep-line.ts +7 -7
- package/tsconfig.json +3 -7
- package/wallaby.mjs +32 -0
- package/node/circle.js.map +0 -1
- package/node/compare-curvatures-at-interface.js.map +0 -1
- package/node/contact-point.js.map +0 -1
- package/node/cp-node.d.ts +0 -202
- package/node/cp-node.js +0 -321
- package/node/cp-node.js.map +0 -1
- package/node/curve.js.map +0 -1
- package/node/find-mats.js +0 -123
- package/node/find-mats.js.map +0 -1
- package/node/get-boundary-bezier-parts-to-next.js.map +0 -1
- package/node/get-boundary-beziers-to-next.js.map +0 -1
- package/node/get-bounding-box-.js.map +0 -1
- package/node/get-branches.js.map +0 -1
- package/node/get-curve-to-next.js.map +0 -1
- package/node/get-interface-ccw.js.map +0 -1
- package/node/loop.d.ts +0 -16
- package/node/loop.js +0 -35
- package/node/loop.js.map +0 -1
- package/node/mat/closest-boundary-point/closest-points-on-curve.d.ts +0 -14
- package/node/mat/closest-boundary-point/closest-points-on-curve.js +0 -73
- package/node/mat/closest-boundary-point/closest-points-on-curve.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-bezier-pieces.d.ts +0 -9
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js +0 -20
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js.map +0 -1
- package/node/mat/closest-boundary-point/get-best-distance-squared.js.map +0 -1
- package/node/mat/closest-boundary-point/get-close-boundary-points.d.ts +0 -17
- package/node/mat/closest-boundary-point/get-close-boundary-points.js +0 -81
- package/node/mat/closest-boundary-point/get-close-boundary-points.js.map +0 -1
- package/node/mat/closest-boundary-point/get-closest-boundary-point.d.ts +0 -18
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js +0 -41
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js.map +0 -1
- package/node/mat/find-mat/add-1-prong.d.ts +0 -12
- package/node/mat/find-mat/add-1-prong.js.map +0 -1
- package/node/mat/find-mat/add-2-prong.js.map +0 -1
- package/node/mat/find-mat/add-3-prong.js +0 -55
- package/node/mat/find-mat/add-3-prong.js.map +0 -1
- package/node/mat/find-mat/add-debug-info.js.map +0 -1
- package/node/mat/find-mat/create-get-interesting-points-on-loop.d.ts +0 -11
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js +0 -52
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js.map +0 -1
- package/node/mat/find-mat/create-initial-cp-graph.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/add-debug-info.d.ts +0 -8
- package/node/mat/find-mat/find-2-prong/add-debug-info.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.d.ts +0 -11
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js +0 -30
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/find-2-prong.js +0 -233
- package/node/mat/find-mat/find-2-prong/find-2-prong.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.d.ts +0 -9
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js +0 -40
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.d.ts +0 -11
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js +0 -38
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/x-for-debugging.d.ts +0 -9
- package/node/mat/find-mat/find-2-prong/x-for-debugging.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/calc-better-x.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/get-closest-points.js +0 -17
- package/node/mat/find-mat/find-3-prong/get-closest-points.js.map +0 -1
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.d.ts +0 -15
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js.map +0 -1
- package/node/mat/find-mat/find-and-add-2-prongs.js +0 -74
- package/node/mat/find-mat/find-and-add-2-prongs.js.map +0 -1
- package/node/mat/find-mat/find-and-add-3-prongs.js +0 -147
- package/node/mat/find-mat/find-and-add-3-prongs.js.map +0 -1
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js.map +0 -1
- package/node/mat/find-mat/get-potential-2-prongs.d.ts +0 -4
- package/node/mat/find-mat/get-potential-2-prongs.js +0 -17
- package/node/mat/find-mat/get-potential-2-prongs.js.map +0 -1
- package/node/mat/find-mat/get-sharp-corners.d.ts +0 -4
- package/node/mat/find-mat/get-sharp-corners.js +0 -18
- package/node/mat/find-mat/get-sharp-corners.js.map +0 -1
- package/node/mat/geometry/get-closest-square-distance-to-rect.js.map +0 -1
- package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js.map +0 -1
- package/node/mat/get-contact-circles-at-interface.d.ts +0 -8
- package/node/mat/get-contact-circles-at-interface.js +0 -21
- package/node/mat/get-contact-circles-at-interface.js.map +0 -1
- package/node/mat/get-leaves.js +0 -13
- package/node/mat/get-leaves.js.map +0 -1
- package/node/mat/to-scale-axis/add-debug-info.js.map +0 -1
- package/node/mat/to-scale-axis/cull-non-cycles.js.map +0 -1
- package/node/mat/to-scale-axis/cull.js.map +0 -1
- package/node/mat.js.map +0 -1
- package/node/point-on-shape.d.ts +0 -73
- package/node/point-on-shape.js +0 -168
- package/node/point-on-shape.js.map +0 -1
- package/node/simplify-mat.js.map +0 -1
- package/node/to-scale-axis.js.map +0 -1
- package/node/traverse-edges.js.map +0 -1
- package/node/traverse-vertices.js.map +0 -1
- package/src/cp-node.ts +0 -388
- package/src/find-mats.ts +0 -171
- package/src/loop.ts +0 -56
- package/src/mat/closest-boundary-point/closest-point-on-curve-old.ts_ +0 -88
- package/src/mat/closest-boundary-point/closest-point-on-curve.ts_ +0 -95
- package/src/mat/closest-boundary-point/closest-points-on-curve.ts +0 -84
- package/src/mat/closest-boundary-point/cull-bezier-pieces.ts +0 -38
- package/src/mat/closest-boundary-point/get-close-boundary-points.ts +0 -107
- package/src/mat/closest-boundary-point/get-closest-boundary-point.ts +0 -64
- package/src/mat/find-mat/add-3-prong.ts +0 -75
- package/src/mat/find-mat/create-get-interesting-points-on-loop.ts +0 -73
- package/src/mat/find-mat/find-2-prong/add-debug-info.ts +0 -46
- package/src/mat/find-mat/find-2-prong/find-2-prong.ts +0 -316
- package/src/mat/find-mat/find-2-prong/get-initial-bezier-pieces.ts +0 -52
- package/src/mat/find-mat/find-2-prong/x-for-debugging.ts +0 -13
- package/src/mat/find-mat/find-3-prong/find-3-prong.ts +0 -106
- package/src/mat/find-mat/find-3-prong/get-closest-points.ts +0 -28
- package/src/mat/find-mat/find-and-add-2-prongs.ts +0 -108
- package/src/mat/find-mat/find-and-add-3-prongs.ts +0 -218
- package/src/mat/find-mat/get-potential-2-prongs.ts +0 -24
- package/src/mat/find-mat/get-sharp-corners.ts +0 -25
- package/src/mat/find-mat/get-total-abs-curvature.ts +0 -17
- package/src/mat/get-contact-circles-at-interface.ts +0 -26
- package/src/mat/to-scale-axis/add-to-tree.ts +0 -66
- package/src/mat/to-scale-axis/calc-groups.ts +0 -82
- package/src/mat/to-scale-axis/create-spacial-tree.ts +0 -41
- package/src/mat/to-scale-axis/get-engulfed-vertices.ts +0 -135
- package/src/point-on-shape.ts +0 -231
- package/src/svg/get-curvature-at-interface.ts +0 -55
- /package/node/{compare-curvatures-at-interface.d.ts → corner/compare-curvatures-at-interface.d.ts} +0 -0
- /package/node/{mat → corner}/corner.js +0 -0
- /package/node/{get-interface-ccw.d.ts → corner/get-interface-ccw.d.ts} +0 -0
- /package/node/{get-boundary-bezier-parts-to-next.d.ts → cp-node/get-boundary-bezier-parts-to-next.d.ts} +0 -0
- /package/node/{get-curve-to-next.d.ts → cp-node/get-curve-to-next.d.ts} +0 -0
- /package/node/{traverse-edges.d.ts → cp-node/traverse-edges.d.ts} +0 -0
- /package/node/{traverse-vertices.d.ts → cp-node/traverse-vertices.d.ts} +0 -0
- /package/node/{mat/find-mat/find-2-prong → find-2-prong}/x-for-debugging.js +0 -0
- /package/node/{circle.d.ts → geometry/circle.d.ts} +0 -0
- /package/node/{circle.js → geometry/circle.js} +0 -0
- /package/node/{get-bounding-box-.d.ts → geometry/get-bounding-box-.d.ts} +0 -0
- /package/node/{get-bounding-box-.js → geometry/get-bounding-box-.js} +0 -0
- /package/node/{mat.js → mat/mat.js} +0 -0
- /package/src/{circle.ts → geometry/circle.ts} +0 -0
- /package/src/{get-bounding-box-.ts → geometry/get-bounding-box-.ts} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Loop } from '
|
|
2
|
-
import {
|
|
1
|
+
import { Loop } from 'flo-boolean';
|
|
2
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @internal
|
|
5
5
|
*/
|
|
6
6
|
declare const getLoopBounds: (a: Loop) => {
|
|
7
|
-
minX:
|
|
8
|
-
minY:
|
|
9
|
-
maxX:
|
|
10
|
-
maxY:
|
|
7
|
+
minX: PointOnShape;
|
|
8
|
+
minY: PointOnShape;
|
|
9
|
+
maxX: PointOnShape;
|
|
10
|
+
maxY: PointOnShape;
|
|
11
11
|
};
|
|
12
12
|
export { getLoopBounds };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getBounds } from 'flo-bezier3';
|
|
2
2
|
import { memoize } from 'flo-memoize';
|
|
3
|
-
import {
|
|
4
|
-
/** @
|
|
3
|
+
import { createPos } from '../point-on-shape/create-pos.js';
|
|
4
|
+
/** @internal */
|
|
5
5
|
const INF = Number.POSITIVE_INFINITY;
|
|
6
6
|
/**
|
|
7
|
-
* @
|
|
7
|
+
* @internal
|
|
8
8
|
*/
|
|
9
9
|
const getLoopBounds = memoize(function (loop) {
|
|
10
10
|
const extremes = [
|
|
@@ -71,10 +71,14 @@ const getLoopBounds = memoize(function (loop) {
|
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
return {
|
|
74
|
-
minX: new PointOnShape(extremes[0][0].bezier, extremes[0][0].t),
|
|
75
|
-
minY: new PointOnShape(extremes[0][1].bezier, extremes[0][1].t),
|
|
76
|
-
maxX: new PointOnShape(extremes[1][0].bezier, extremes[1][0].t),
|
|
77
|
-
maxY: new PointOnShape(extremes[1][1].bezier, extremes[1][1].t)
|
|
74
|
+
// minX : new PointOnShape(extremes[0][0].bezier, extremes[0][0].t),
|
|
75
|
+
// minY : new PointOnShape(extremes[0][1].bezier, extremes[0][1].t),
|
|
76
|
+
// maxX : new PointOnShape(extremes[1][0].bezier, extremes[1][0].t),
|
|
77
|
+
// maxY : new PointOnShape(extremes[1][1].bezier, extremes[1][1].t)
|
|
78
|
+
minY: createPos(extremes[0][1].bezier, extremes[0][1].t, true),
|
|
79
|
+
minX: createPos(extremes[0][0].bezier, extremes[0][0].t, true),
|
|
80
|
+
maxX: createPos(extremes[1][0].bezier, extremes[1][0].t, true),
|
|
81
|
+
maxY: createPos(extremes[1][1].bezier, extremes[1][1].t, true)
|
|
78
82
|
};
|
|
79
83
|
});
|
|
80
84
|
export { getLoopBounds };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-loop-bounds.js","sourceRoot":"","sources":["../../src/svg/get-loop-bounds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"get-loop-bounds.js","sourceRoot":"","sources":["../../src/svg/get-loop-bounds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAItC,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAG5D,gBAAgB;AAChB,MAAM,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAGrC;;GAEG;AACH,MAAM,aAAa,GAAG,OAAO,CAAC,UAAS,IAAU;IAMhD,MAAM,QAAQ,GAIN;QACP;YACC,EAAE,MAAM,EAAE,SAAU,EAAE,CAAC,EAAE,SAAU,EAAE,GAAG,EAAE,GAAG,EAAC;YAC9C,EAAE,MAAM,EAAE,SAAU,EAAE,CAAC,EAAE,SAAU,EAAE,GAAG,EAAE,GAAG,EAAC;SAC9C;QACD;YACC,EAAE,MA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
* Get topmost PointOnShape of the given loop.
|
|
6
6
|
*/
|
|
7
|
-
declare function getMinYPos(loop: Loop): import("../point-on-shape.js").
|
|
7
|
+
declare function getMinYPos(loop: Loop): import("../point-on-shape/point-on-shape.js").PointOnShape;
|
|
8
8
|
export { getMinYPos };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Loop } from '
|
|
1
|
+
import { Loop } from 'flo-boolean';
|
|
2
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
2
3
|
/** @internal */
|
|
3
4
|
declare const getShapeBounds: (a: Loop[]) => {
|
|
4
|
-
minX:
|
|
5
|
-
minY:
|
|
6
|
-
maxX:
|
|
7
|
-
maxY:
|
|
5
|
+
minX: PointOnShape;
|
|
6
|
+
minY: PointOnShape;
|
|
7
|
+
maxX: PointOnShape;
|
|
8
|
+
maxY: PointOnShape;
|
|
8
9
|
};
|
|
9
10
|
export { getShapeBounds };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { memoize } from 'flo-memoize';
|
|
2
2
|
import { getLoopBounds } from './get-loop-bounds.js';
|
|
3
|
-
// TODO - move to another library
|
|
4
3
|
/** @internal */
|
|
5
4
|
const getShapeBounds = memoize(function (loops) {
|
|
6
5
|
let minX_ = Number.POSITIVE_INFINITY;
|
|
@@ -30,7 +29,12 @@ const getShapeBounds = memoize(function (loops) {
|
|
|
30
29
|
maxY_ = bounds.maxY.p[1];
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
|
-
return {
|
|
32
|
+
return {
|
|
33
|
+
minX: minX,
|
|
34
|
+
minY: minY,
|
|
35
|
+
maxX: maxX,
|
|
36
|
+
maxY: maxY
|
|
37
|
+
};
|
|
34
38
|
});
|
|
35
39
|
export { getShapeBounds };
|
|
36
40
|
//# sourceMappingURL=get-shape-bounds.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-shape-bounds.js","sourceRoot":"","sources":["../../src/svg/get-shape-bounds.ts"],"names":[],"m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nB,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5B;QACD,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE;YAC1B,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;YACnB,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5B;KACJ;IAED,OAAO;QACH,IAAI,EAAE,IAAK;QACX,IAAI,EAAE,IAAK;QACX,IAAI,EAAE,IAAK;QACX,IAAI,EAAE,IAAK;KACd,CAAC;AACN,CAAC,CAAC,CAAC;AAGH,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/** @
|
|
1
|
+
/** @internal */
|
|
2
2
|
const EVENT_LEFT = 0;
|
|
3
|
-
/** @
|
|
3
|
+
/** @internal */
|
|
4
4
|
const EVENT_RIGHT = 1;
|
|
5
5
|
/**
|
|
6
|
-
* @
|
|
6
|
+
* @internal
|
|
7
7
|
* Generalized sweepline algorithm.
|
|
8
8
|
*
|
|
9
9
|
* Typically used to turn O(n^2) algorithms into roughly O(n logn) algorithms.
|
|
@@ -54,7 +54,7 @@ function sweepLine(items, getLeftmost, getRightmost, predicate) {
|
|
|
54
54
|
return pairedItems;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* @
|
|
57
|
+
* @internal
|
|
58
58
|
* Compare two Events by their x-axis and then by their type. Since it is
|
|
59
59
|
* open boxes that are compared we must let the right endpoint type come
|
|
60
60
|
* before the left.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sweep-line.js","sourceRoot":"","sources":["../../src/sweep-line/sweep-line.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"sweep-line.js","sourceRoot":"","sources":["../../src/sweep-line/sweep-line.ts"],"names":[],"mappings":"AACA,gBAAgB;AAChB,MA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;;;;GAOG;AACH,SAAS,OAAO,CAAI,CAAY,EAAE,CAAY;IAC1C,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAEtB,IAAI,GAAG,KAAK,CAAC,EAAE;QAAE,OAAO,GAAG,CAAC;KAAE;IAE9B,2CAA2C;IAC3C,OAAO,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "flo-mat",
|
|
3
3
|
"sideEffects": false,
|
|
4
4
|
"description": "Medial / Scale Axis Transform (MAT/SAT) Library.",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "3.0.0",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Floris Steenkamp"
|
|
8
8
|
},
|
|
@@ -33,25 +33,25 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"big-float-ts": "^3.0.3",
|
|
35
35
|
"double-double": "^2.0.7",
|
|
36
|
-
"flo-bezier3": "^
|
|
37
|
-
"flo-boolean": "^2.1.
|
|
36
|
+
"flo-bezier3": "^5.0.0",
|
|
37
|
+
"flo-boolean": "^2.1.8",
|
|
38
38
|
"flo-draw": "^2.0.2",
|
|
39
39
|
"flo-gauss-quadrature": "^2.1.2",
|
|
40
40
|
"flo-ll-rb-tree": "^0.3.3",
|
|
41
41
|
"flo-memoize": "^1.1.1",
|
|
42
|
-
"flo-poly": "^6.0.
|
|
42
|
+
"flo-poly": "^6.0.8",
|
|
43
43
|
"flo-vector2d": "^4.0.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/chai": "^4.3.5",
|
|
47
47
|
"@types/mocha": "^10.0.1",
|
|
48
|
-
"@types/node": "^20.4.
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
50
|
-
"@typescript-eslint/parser": "^6.
|
|
51
|
-
"c8": "^8.0.
|
|
48
|
+
"@types/node": "^20.4.8",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
|
50
|
+
"@typescript-eslint/parser": "^6.2.1",
|
|
51
|
+
"c8": "^8.0.1",
|
|
52
52
|
"chai": "^4.3.7",
|
|
53
53
|
"circular-dependency-plugin": "^5.2.2",
|
|
54
|
-
"eslint": "^8.
|
|
54
|
+
"eslint": "^8.46.0",
|
|
55
55
|
"eslint-plugin-tree-shaking": "^1.10.0",
|
|
56
56
|
"mocha": "^10.2.0",
|
|
57
57
|
"resolve-typescript-plugin": "^2.0.1",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"ts-loader": "^9.4.4",
|
|
61
61
|
"ts-node": "^10.9.1",
|
|
62
62
|
"typescript": "^5.1.6",
|
|
63
|
-
"webpack": "^5.88.
|
|
63
|
+
"webpack": "^5.88.2",
|
|
64
64
|
"webpack-cli": "^5.1.4"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ddDeflate, allRootsCertified, RootInterval } from 'flo-poly';
|
|
2
|
+
import { evalDeCasteljauDd, getFootpointPolyDd } from 'flo-bezier3';
|
|
3
|
+
import { Curve } from "../curve/curve.js";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
* @param curve The curve
|
|
9
|
+
* @param p The point from which to check
|
|
10
|
+
* @param tRange The allowed t range
|
|
11
|
+
* @param touchedCurve The bezier on which p is located
|
|
12
|
+
* @param t The t value of the bezier that locates p
|
|
13
|
+
*/
|
|
14
|
+
function closestPointsOnCurvePrecise(
|
|
15
|
+
curve: Curve,
|
|
16
|
+
p: number[],
|
|
17
|
+
[tS,tE]: number[] = [0,1],
|
|
18
|
+
touchedCurve: Curve,
|
|
19
|
+
t: number): {
|
|
20
|
+
p: number[];
|
|
21
|
+
t: number;
|
|
22
|
+
}[] {
|
|
23
|
+
|
|
24
|
+
const _poly = getFootpointPolyDd(curve.ps, p);
|
|
25
|
+
|
|
26
|
+
const poly = curve === touchedCurve
|
|
27
|
+
? ddDeflate(_poly, t)
|
|
28
|
+
: _poly;
|
|
29
|
+
|
|
30
|
+
const roots: Omit<RootInterval,'multiplicity'>[] =
|
|
31
|
+
allRootsCertified(poly, tS, tE);
|
|
32
|
+
|
|
33
|
+
// Also test the endpoints
|
|
34
|
+
const dontPush0 = (
|
|
35
|
+
(t === 1 && curve === touchedCurve.next) ||
|
|
36
|
+
(t === 0 && curve === touchedCurve)
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const dontPush1 = (
|
|
40
|
+
(t === 0 && curve === touchedCurve.prev) ||
|
|
41
|
+
(t === 1 && curve === touchedCurve)
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
if (tS === 0) {
|
|
45
|
+
if (!dontPush0) { roots.push({ tS: 0, tE: 0 }); }
|
|
46
|
+
} else if (tS === 1) {
|
|
47
|
+
if (!dontPush1) { roots.push({ tS: 1, tE: 1 }); }
|
|
48
|
+
} else {
|
|
49
|
+
roots.push({ tS: tS, tE: tS });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (tE === 0) {
|
|
53
|
+
if (!dontPush0) { roots.push({ tS: 0, tE: 0 }); }
|
|
54
|
+
} else if (tE === 1) {
|
|
55
|
+
if (!dontPush1) { roots.push({ tS: 1, tE: 1 }); }
|
|
56
|
+
} else {
|
|
57
|
+
roots.push({ tS: tE, tE: tE });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const ps = roots.map(
|
|
61
|
+
root => {
|
|
62
|
+
const tS = root.tS;
|
|
63
|
+
const tE = root.tE;
|
|
64
|
+
const t = tS < 0
|
|
65
|
+
? 0
|
|
66
|
+
: tE > 1 ? 1 : (tS + tE)/2;
|
|
67
|
+
return { p: evalDeCasteljauDd(curve.ps,[0,t]).map(v => v[1]), t }
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
return ps;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
export { closestPointsOnCurvePrecise }
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { allRoots, deflate } from 'flo-poly';
|
|
2
|
+
import { evalDeCasteljau, getFootpointPoly } from 'flo-bezier3';
|
|
3
|
+
import { Curve } from "../curve/curve.js";
|
|
4
|
+
import { eAdd, growExpansion } from 'big-float-ts';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
* @param curve The curve
|
|
10
|
+
* @param p The point from which to check
|
|
11
|
+
* @param tRange The allowed t range
|
|
12
|
+
* @param touchedCurve The bezier on which p is located
|
|
13
|
+
* @param t The t value of the bezier that locates p
|
|
14
|
+
*/
|
|
15
|
+
function closestPointsOnCurve(
|
|
16
|
+
curve: Curve,
|
|
17
|
+
p: number[],
|
|
18
|
+
[tS,tE]: number[] = [0,1],
|
|
19
|
+
touchedCurve: Curve,
|
|
20
|
+
t: number): {
|
|
21
|
+
p: number[];
|
|
22
|
+
t: number;
|
|
23
|
+
}[] {
|
|
24
|
+
|
|
25
|
+
const _poly = getFootpointPoly(curve.ps, p);
|
|
26
|
+
|
|
27
|
+
const poly = curve === touchedCurve
|
|
28
|
+
? deflate(_poly, t)
|
|
29
|
+
: _poly;
|
|
30
|
+
|
|
31
|
+
const roots = allRoots(poly, tS, tE);
|
|
32
|
+
|
|
33
|
+
// Also test the endpoints
|
|
34
|
+
let push0 = true;
|
|
35
|
+
let push1 = true;
|
|
36
|
+
if ((t === 1 && curve === touchedCurve.next) ||
|
|
37
|
+
(t === 0 && curve === touchedCurve)) {
|
|
38
|
+
push0 = false;
|
|
39
|
+
}
|
|
40
|
+
if ((t === 0 && curve === touchedCurve.prev) ||
|
|
41
|
+
(t === 1 && curve === touchedCurve)) {
|
|
42
|
+
push1 = false;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (tS === 0) {
|
|
46
|
+
if (push0) { roots.push(0); }
|
|
47
|
+
} else if (tS === 1) {
|
|
48
|
+
if (push1) { roots.push(1); }
|
|
49
|
+
} else {
|
|
50
|
+
roots.push(tS);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (tE === 0) {
|
|
54
|
+
if (push0) { roots.push(0); }
|
|
55
|
+
} else if (tE === 1) {
|
|
56
|
+
if (push1) { roots.push(1); }
|
|
57
|
+
} else {
|
|
58
|
+
roots.push(tE);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const ps = roots.map(
|
|
62
|
+
r => {
|
|
63
|
+
const t = r < 0 ? 0 : r > 1 ? 1 : r;
|
|
64
|
+
return { p: evalDeCasteljau(curve.ps,t), t }
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
return ps;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
export { closestPointsOnCurve }
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BezierPiece } from '../mat/bezier-piece.js';
|
|
2
|
+
import { getBestDistanceSquared } from './get-best-distance-squared.js';
|
|
3
|
+
import { cullByLooseBoundingBox } from './cull-by-loose-bounding-box.js';
|
|
4
|
+
import { cullByTightBoundingBox } from './cull-by-tight-boundary-box.js';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
* @param bezierPieces
|
|
10
|
+
* @param p
|
|
11
|
+
* @param extreme
|
|
12
|
+
*/
|
|
13
|
+
function cullBezierPieces1(
|
|
14
|
+
bezierPieces: BezierPiece[],
|
|
15
|
+
p: number[]) {
|
|
16
|
+
|
|
17
|
+
const bestSquaredDistance = getBestDistanceSquared(
|
|
18
|
+
bezierPieces, p
|
|
19
|
+
);
|
|
20
|
+
bezierPieces = cullByLooseBoundingBox(
|
|
21
|
+
bezierPieces, p,
|
|
22
|
+
bestSquaredDistance
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
bezierPieces = cullByTightBoundingBox(
|
|
26
|
+
bezierPieces, p,
|
|
27
|
+
bestSquaredDistance
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
return bezierPieces;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
export { cullBezierPieces1 }
|
package/src/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.ts
RENAMED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BezierPiece } from '../bezier-piece.js';
|
|
1
|
+
import { allRoots, deflate } from 'flo-poly';
|
|
2
|
+
import { BezierPiece } from '../mat/bezier-piece.js';
|
|
3
3
|
import { getClosestSquareDistanceToRect } from '../geometry/get-closest-square-distance-to-rect.js';
|
|
4
|
+
import { getBoundingBox_ } from '../geometry/get-bounding-box-.js';
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
|
-
* @
|
|
8
|
+
* @internal
|
|
8
9
|
* When checking distances, ignore all those with closest possible distance
|
|
9
10
|
* further than 'bestSquaredDistance', i.e. cull them.
|
|
10
11
|
* @param bezierPieces
|
package/src/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getBoundingBoxTight } from "flo-bezier3";
|
|
2
2
|
import { memoize } from "flo-memoize";
|
|
3
|
-
import { BezierPiece } from "../bezier-piece.js";
|
|
3
|
+
import { BezierPiece } from "../mat/bezier-piece.js";
|
|
4
4
|
import { getClosestSquaredDistanceToRotatedRect } from '../geometry/get-closest-squared-distance-to-rotated-rect.js';
|
|
5
5
|
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ const getBoundingBoxTight_ = memoize(getBoundingBoxTight);
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* @
|
|
11
|
+
* @internal
|
|
12
12
|
* When checking distances, ignore all those with closest possible distance
|
|
13
13
|
* further than 'bestSquaredDistance', i.e. cull them.
|
|
14
14
|
* @param bezierPieces
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// TODO - import from `flo-poly` in the future
|
|
2
|
+
import { ddMultDouble2 } from "double-double";
|
|
3
|
+
import { ddAddDd } from "double-double";
|
|
4
|
+
import { γγ } from '../error-analysis/gamma.js';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
// We *have* to do the below❗ The assignee is a getter❗ The assigned is a pure function❗ Otherwise code is too slow❗
|
|
8
|
+
const qmd = ddMultDouble2;
|
|
9
|
+
const qaq = ddAddDd;
|
|
10
|
+
|
|
11
|
+
const { abs } = Math;
|
|
12
|
+
|
|
13
|
+
const γγ3 = γγ(3);
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Deflates the given polynomial *approximately* by removing a factor (x - t).
|
|
18
|
+
*
|
|
19
|
+
* @param p a polynomial with coefficients given densely as an array of
|
|
20
|
+
* double-double precision floating point numbers from highest to lowest power,
|
|
21
|
+
* e.g. `[[0,5],[0,-3],[0,0]]` represents the polynomial `5x^2 - 3x`
|
|
22
|
+
* @param pE the coefficient-wise absolute error of the input polynomial that
|
|
23
|
+
* still need to be multiplied by γγ3, i.e. it is `γγ3` times too big.
|
|
24
|
+
* @param t an evaluation point of the polynomial.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* // The polynomial x^3 - 5x^2 + 8x - 4 has a root at 1 and a double root at 2
|
|
29
|
+
* ddDeflate([[0,1], [0,-5], [0,8], [0,-4]], [0,2]); //=> [[0,1], [0,-3], [0,2]]
|
|
30
|
+
* ddDeflate([[0,1], [0,-3], [0,2], [0,2]); //=> [[0,1], [0,-1]]
|
|
31
|
+
* ddDeflate([[0,1], [0,-1]], [0,1]); //=> [[0,1]]
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @doc
|
|
35
|
+
*/
|
|
36
|
+
function ddDeflateWithRunningError(
|
|
37
|
+
p: number[][],
|
|
38
|
+
pE: number[],
|
|
39
|
+
t: number): {
|
|
40
|
+
coeffs: number[][];
|
|
41
|
+
errBound: number[];
|
|
42
|
+
} {
|
|
43
|
+
|
|
44
|
+
//--------------------------------------------------------------------------
|
|
45
|
+
// `var` -> a variable
|
|
46
|
+
// `$var` -> the double precision approximation to `var`
|
|
47
|
+
// `_var` -> the absolute value of $var (a prefix underscore on a variable means absolute value)
|
|
48
|
+
// `var_` -> the error in var (a postfix underscore means error bound but should still be multiplied by 3*γ²)
|
|
49
|
+
// `_var_` -> means both absolute value and absolute error bound
|
|
50
|
+
// recall: `a*b`, where both `a` and `b` have errors |a| and |b| we get for the
|
|
51
|
+
// * error bound of (a*b) === a_|b| + |a|b_ + |a*b| (when either of a and b is double)
|
|
52
|
+
// * error bound of (a*b) === a_|b| + |a|b_ + 2|a*b| (when both a and b is double-double)
|
|
53
|
+
// * error bound of (a+b) === a_ + b_ + |a+b| (when a and/or b is double or double-double)
|
|
54
|
+
// * the returned errors need to be multiplied by 3γ² to get the true error
|
|
55
|
+
// * can use either `$var` or `var[var.length-1]` (the approx value) in error calculations
|
|
56
|
+
// due to multiplication by 3*γ² and not 3*u²
|
|
57
|
+
//--------------------------------------------------------------------------
|
|
58
|
+
const d = p.length - 1;
|
|
59
|
+
const bs = [p[0]]; // coefficients
|
|
60
|
+
let b_ = pE[0]; // running error
|
|
61
|
+
const bEs = [b_]; // coefficient-wise error bound
|
|
62
|
+
|
|
63
|
+
for (let i=1; i<d; i++) {
|
|
64
|
+
// p[i] + t*bs[i-1];
|
|
65
|
+
|
|
66
|
+
const a = bs[i-1];
|
|
67
|
+
const $m = t*a[1];
|
|
68
|
+
const _t = abs(t);
|
|
69
|
+
const m_ = _t*b_ + abs($m);
|
|
70
|
+
|
|
71
|
+
const pi = p[i];
|
|
72
|
+
const p_ = pE[i];
|
|
73
|
+
b_ = p_ + m_ + abs(pi[1] + $m);
|
|
74
|
+
|
|
75
|
+
const b = qaq(pi,qmd(t,a));
|
|
76
|
+
|
|
77
|
+
bs.push(b);
|
|
78
|
+
bEs.push(b_);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
coeffs: bs,
|
|
83
|
+
errBound: bEs.map(e => γγ3*e)
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
export { ddDeflateWithRunningError }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RootInterval } from "flo-poly";
|
|
2
|
+
import { Curve } from "../curve/curve";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
type FootAndEndpointInfo = {
|
|
6
|
+
curve: Curve;
|
|
7
|
+
p: number[];
|
|
8
|
+
t: number;
|
|
9
|
+
d: number;
|
|
10
|
+
box: number[][];
|
|
11
|
+
// ri: RootInterval;
|
|
12
|
+
dSquaredI: number[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export { FootAndEndpointInfo }
|
package/src/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.ts
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { evalDeCasteljau } from 'flo-bezier3';
|
|
2
2
|
import { squaredDistanceBetween } from 'flo-vector2d';
|
|
3
|
-
import { BezierPiece } from "../bezier-piece.js";
|
|
3
|
+
import { BezierPiece } from "../mat/bezier-piece.js";
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* @
|
|
7
|
+
* @internal
|
|
8
8
|
* Finds an initial distance such that the closest point can not be further than
|
|
9
9
|
* this distance away.
|
|
10
10
|
*/
|
|
@@ -32,8 +32,7 @@ function getBestDistanceSquared(
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// The extra multiplier is to account for floating point precision.
|
|
35
|
-
|
|
36
|
-
return bestSquaredDistance * 1.01;
|
|
35
|
+
return (1 + 2**-10)*bestSquaredDistance;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { BezierPiece } from '../mat/bezier-piece.js';
|
|
2
|
+
import { getPotentialClosestPointsOnCurveCertified } from './get-potential-closest-points-on-curve-certified.js';
|
|
3
|
+
import { cullBezierPieces1 } from './cull-bezier-pieces.js';
|
|
4
|
+
import { Curve } from '../curve/curve.js';
|
|
5
|
+
import { FootAndEndpointInfo } from './foot-and-endpoint-info.js';
|
|
6
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
7
|
+
import { createPos } from '../point-on-shape/create-pos.js';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
* Returns the closest boundary point to the given point, limited to the given
|
|
13
|
+
* bezier pieces, including the beziers actually checked after culling.
|
|
14
|
+
* @param bezierPieces
|
|
15
|
+
* @param x
|
|
16
|
+
* @param touchedCurve
|
|
17
|
+
* @param t
|
|
18
|
+
* @param extreme
|
|
19
|
+
*/
|
|
20
|
+
function getCloseBoundaryPointsCertified(
|
|
21
|
+
bezierPieces: BezierPiece[],
|
|
22
|
+
x: number[],
|
|
23
|
+
touchedCurve: Curve | undefined = undefined,
|
|
24
|
+
t: number | undefined = undefined,
|
|
25
|
+
for1Prong = false,
|
|
26
|
+
angle = 0): PointOnShape[] {
|
|
27
|
+
|
|
28
|
+
bezierPieces = cullBezierPieces1(bezierPieces, x);
|
|
29
|
+
|
|
30
|
+
const pInfoss: FootAndEndpointInfo[] = [];
|
|
31
|
+
for (let i=0; i<bezierPieces.length; i++) {
|
|
32
|
+
const bezierPiece = bezierPieces[i];
|
|
33
|
+
|
|
34
|
+
const pInfos = getPotentialClosestPointsOnCurveCertified(
|
|
35
|
+
bezierPiece.curve,
|
|
36
|
+
x,
|
|
37
|
+
bezierPiece.ts,
|
|
38
|
+
touchedCurve,
|
|
39
|
+
t,
|
|
40
|
+
for1Prong,
|
|
41
|
+
angle
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
pInfoss.push(...pInfos);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** the minimum max interval value */
|
|
48
|
+
let minMax = Number.POSITIVE_INFINITY;
|
|
49
|
+
for (let i=0; i<pInfoss.length; i++) {
|
|
50
|
+
const diMax = pInfoss[i].dSquaredI[1];
|
|
51
|
+
if (diMax < minMax) {
|
|
52
|
+
minMax = diMax;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const closestPointInfos: FootAndEndpointInfo[] = [];
|
|
57
|
+
|
|
58
|
+
for (let i=0; i<pInfoss.length; i++) {
|
|
59
|
+
const info = pInfoss[i];
|
|
60
|
+
if (info.dSquaredI[0] <= minMax) {
|
|
61
|
+
closestPointInfos.push(info);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return closestPointInfos.map(info => createPos(info.curve, info.t, false));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
export { getCloseBoundaryPointsCertified };
|