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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getBestDistanceSquared } from './get-best-distance-squared.js';
|
|
2
|
+
import { cullByLooseBoundingBox } from './cull-by-loose-bounding-box.js';
|
|
3
|
+
import { cullByTightBoundingBox } from './cull-by-tight-boundary-box.js';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* @param bezierPieces
|
|
7
|
+
* @param p
|
|
8
|
+
* @param extreme
|
|
9
|
+
*/
|
|
10
|
+
function cullBezierPieces1(bezierPieces, p) {
|
|
11
|
+
const bestSquaredDistance = getBestDistanceSquared(bezierPieces, p);
|
|
12
|
+
bezierPieces = cullByLooseBoundingBox(bezierPieces, p, bestSquaredDistance);
|
|
13
|
+
bezierPieces = cullByTightBoundingBox(bezierPieces, p, bestSquaredDistance);
|
|
14
|
+
return bezierPieces;
|
|
15
|
+
}
|
|
16
|
+
export { cullBezierPieces1 };
|
|
17
|
+
//# sourceMappingURL=cull-bezier-pieces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cull-bezier-pieces.js","sourceRoot":"","sources":["../../src/closest-boundary-point/cull-bezier-pieces.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAGzE;;;;;GAKG;AACH,SAAS,iBAAiB,CAClB,YAA2B,EAC3B,CAAW;IAEf,MAAM,mBAAmB,GAAG,sBAAsB,CAC9C,YAAY,EAAE,CAAC,CAClB,CAAC;IACF,YAAY,GAAG,sBAAsB,CACjC,YAAY,EAAE,CAAC,EACf,mBAAmB,CACtB,CAAC;IAEF,YAAY,GAAG,sBAAsB,CACjC,YAAY,EAAE,CAAC,EACf,mBAAmB,CACtB,CAAC;IAGF,OAAO,YAAY,CAAC;AACxB,CAAC;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.d.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BezierPiece } from '../bezier-piece.js';
|
|
1
|
+
import { BezierPiece } from '../mat/bezier-piece.js';
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @internal
|
|
4
4
|
* When checking distances, ignore all those with closest possible distance
|
|
5
5
|
* further than 'bestSquaredDistance', i.e. cull them.
|
|
6
6
|
* @param bezierPieces
|
package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.js
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getBoundingBox_ } from '../../get-bounding-box-.js';
|
|
2
1
|
import { getClosestSquareDistanceToRect } from '../geometry/get-closest-square-distance-to-rect.js';
|
|
2
|
+
import { getBoundingBox_ } from '../geometry/get-bounding-box-.js';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @internal
|
|
5
5
|
* When checking distances, ignore all those with closest possible distance
|
|
6
6
|
* further than 'bestSquaredDistance', i.e. cull them.
|
|
7
7
|
* @param bezierPieces
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cull-by-loose-bounding-box.js","sourceRoot":"","sources":["../../src/closest-boundary-point/cull-by-loose-bounding-box.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE;;;;;;;GAOG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW,EACX,QAAgB;IAEpB,MAAM,qBAAqB,GAAG,EAAE,CAAC;IAEjC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAEhC,MAAM,WAAW,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;QAExC,MAAM,CAAC,GAAG,8BAA8B,CACpC,WAAW,EACX,CAAC,CACJ,CAAC;QACF,IAAI,CAAC,IAAI,QAAQ,EAAE;YACf,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC3C;KACJ;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
|
package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.d.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BezierPiece } from "../bezier-piece.js";
|
|
1
|
+
import { BezierPiece } from "../mat/bezier-piece.js";
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @internal
|
|
4
4
|
* When checking distances, ignore all those with closest possible distance
|
|
5
5
|
* further than 'bestSquaredDistance', i.e. cull them.
|
|
6
6
|
* @param bezierPieces
|
package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.js
RENAMED
|
@@ -3,7 +3,7 @@ import { memoize } from "flo-memoize";
|
|
|
3
3
|
import { getClosestSquaredDistanceToRotatedRect } from '../geometry/get-closest-squared-distance-to-rotated-rect.js';
|
|
4
4
|
const getBoundingBoxTight_ = memoize(getBoundingBoxTight);
|
|
5
5
|
/**
|
|
6
|
-
* @
|
|
6
|
+
* @internal
|
|
7
7
|
* When checking distances, ignore all those with closest possible distance
|
|
8
8
|
* further than 'bestSquaredDistance', i.e. cull them.
|
|
9
9
|
* @param bezierPieces
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cull-by-tight-boundary-box.js","sourceRoot":"","sources":["../../src/closest-boundary-point/cull-by-tight-boundary-box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,sCAAsC,EAAE,MAAM,6DAA6D,CAAC;AAGrH,MAAM,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAG1D;;;;;;;GAOG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW,EACX,mBAA2B;IAE/B,MAAM,qBAAqB,GAAG,EAAE,CAAC;IAEjC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAEhC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,EAAE,CAAC,CAAC;QAClD,MAAM,CAAC,GAAG,sCAAsC,CACxC,gBAAgB,EAChB,CAAC,CACR,CAAC;QACF,IAAI,CAAC,IAAI,mBAAmB,EAAE;YAC1B,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC3C;KACJ;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deflates the given polynomial *approximately* by removing a factor (x - t).
|
|
3
|
+
*
|
|
4
|
+
* @param p a polynomial with coefficients given densely as an array of
|
|
5
|
+
* double-double precision floating point numbers from highest to lowest power,
|
|
6
|
+
* e.g. `[[0,5],[0,-3],[0,0]]` represents the polynomial `5x^2 - 3x`
|
|
7
|
+
* @param pE the coefficient-wise absolute error of the input polynomial that
|
|
8
|
+
* still need to be multiplied by γγ3, i.e. it is `γγ3` times too big.
|
|
9
|
+
* @param t an evaluation point of the polynomial.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // The polynomial x^3 - 5x^2 + 8x - 4 has a root at 1 and a double root at 2
|
|
14
|
+
* ddDeflate([[0,1], [0,-5], [0,8], [0,-4]], [0,2]); //=> [[0,1], [0,-3], [0,2]]
|
|
15
|
+
* ddDeflate([[0,1], [0,-3], [0,2], [0,2]); //=> [[0,1], [0,-1]]
|
|
16
|
+
* ddDeflate([[0,1], [0,-1]], [0,1]); //=> [[0,1]]
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @doc
|
|
20
|
+
*/
|
|
21
|
+
declare function ddDeflateWithRunningError(p: number[][], pE: number[], t: number): {
|
|
22
|
+
coeffs: number[][];
|
|
23
|
+
errBound: number[];
|
|
24
|
+
};
|
|
25
|
+
export { ddDeflateWithRunningError };
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
// We *have* to do the below❗ The assignee is a getter❗ The assigned is a pure function❗ Otherwise code is too slow❗
|
|
6
|
+
const qmd = ddMultDouble2;
|
|
7
|
+
const qaq = ddAddDd;
|
|
8
|
+
const { abs } = Math;
|
|
9
|
+
const γγ3 = γγ(3);
|
|
10
|
+
/**
|
|
11
|
+
* Deflates the given polynomial *approximately* by removing a factor (x - t).
|
|
12
|
+
*
|
|
13
|
+
* @param p a polynomial with coefficients given densely as an array of
|
|
14
|
+
* double-double precision floating point numbers from highest to lowest power,
|
|
15
|
+
* e.g. `[[0,5],[0,-3],[0,0]]` represents the polynomial `5x^2 - 3x`
|
|
16
|
+
* @param pE the coefficient-wise absolute error of the input polynomial that
|
|
17
|
+
* still need to be multiplied by γγ3, i.e. it is `γγ3` times too big.
|
|
18
|
+
* @param t an evaluation point of the polynomial.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* // The polynomial x^3 - 5x^2 + 8x - 4 has a root at 1 and a double root at 2
|
|
23
|
+
* ddDeflate([[0,1], [0,-5], [0,8], [0,-4]], [0,2]); //=> [[0,1], [0,-3], [0,2]]
|
|
24
|
+
* ddDeflate([[0,1], [0,-3], [0,2], [0,2]); //=> [[0,1], [0,-1]]
|
|
25
|
+
* ddDeflate([[0,1], [0,-1]], [0,1]); //=> [[0,1]]
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @doc
|
|
29
|
+
*/
|
|
30
|
+
function ddDeflateWithRunningError(p, pE, t) {
|
|
31
|
+
//--------------------------------------------------------------------------
|
|
32
|
+
// `var` -> a variable
|
|
33
|
+
// `$var` -> the double precision approximation to `var`
|
|
34
|
+
// `_var` -> the absolute value of $var (a prefix underscore on a variable means absolute value)
|
|
35
|
+
// `var_` -> the error in var (a postfix underscore means error bound but should still be multiplied by 3*γ²)
|
|
36
|
+
// `_var_` -> means both absolute value and absolute error bound
|
|
37
|
+
// recall: `a*b`, where both `a` and `b` have errors |a| and |b| we get for the
|
|
38
|
+
// * error bound of (a*b) === a_|b| + |a|b_ + |a*b| (when either of a and b is double)
|
|
39
|
+
// * error bound of (a*b) === a_|b| + |a|b_ + 2|a*b| (when both a and b is double-double)
|
|
40
|
+
// * error bound of (a+b) === a_ + b_ + |a+b| (when a and/or b is double or double-double)
|
|
41
|
+
// * the returned errors need to be multiplied by 3γ² to get the true error
|
|
42
|
+
// * can use either `$var` or `var[var.length-1]` (the approx value) in error calculations
|
|
43
|
+
// due to multiplication by 3*γ² and not 3*u²
|
|
44
|
+
//--------------------------------------------------------------------------
|
|
45
|
+
const d = p.length - 1;
|
|
46
|
+
const bs = [p[0]]; // coefficients
|
|
47
|
+
let b_ = pE[0]; // running error
|
|
48
|
+
const bEs = [b_]; // coefficient-wise error bound
|
|
49
|
+
for (let i = 1; i < d; i++) {
|
|
50
|
+
// p[i] + t*bs[i-1];
|
|
51
|
+
const a = bs[i - 1];
|
|
52
|
+
const $m = t * a[1];
|
|
53
|
+
const _t = abs(t);
|
|
54
|
+
const m_ = _t * b_ + abs($m);
|
|
55
|
+
const pi = p[i];
|
|
56
|
+
const p_ = pE[i];
|
|
57
|
+
b_ = p_ + m_ + abs(pi[1] + $m);
|
|
58
|
+
const b = qaq(pi, qmd(t, a));
|
|
59
|
+
bs.push(b);
|
|
60
|
+
bEs.push(b_);
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
coeffs: bs,
|
|
64
|
+
errBound: bEs.map(e => γγ3 * e)
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export { ddDeflateWithRunningError };
|
|
68
|
+
//# sourceMappingURL=dd-deflate-with-running-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dd-deflate-with-running-error.js","sourceRoot":"","sources":["../../src/closest-boundary-point/dd-deflate-with-running-error.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,EAAE,EAAE,MAAM,4BAA4B,CAAC;AAGhD,oHAAoH;AACpH,MAAM,GAAG,GAAG,aAAa,CAAC;AAC1B,MAAM,GAAG,GAAG,OAAO,CAAC;AAEpB,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAErB,MAAM,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AAGlB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAS,yBAAyB,CAChC,CAAa,EACb,EAAY,EACZ,CAAS;IAKV,4EAA4E;IACzE,sBAAsB;IACtB,wDAAwD;IACxD,gGAAgG;IAChG,6GAA6G;IAC7G,gEAAgE;IAChE,+EAA+E;IAC/E,0FAA0F;IAC1F,4F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AG,GAAC,CAAC,CAAC;KAChC,CAAC;AACN,CAAC;AAGD,OAAO,EAAE,yBAAyB,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"foot-and-endpoint-info.js","sourceRoot":"","sources":["../../src/closest-boundary-point/foot-and-endpoint-info.ts"],"names":[],"mappings":""}
|
package/node/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.js
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { evalDeCasteljau } from 'flo-bezier3';
|
|
2
2
|
import { squaredDistanceBetween } from 'flo-vector2d';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @internal
|
|
5
5
|
* Finds an initial distance such that the closest point can not be further than
|
|
6
6
|
* this distance away.
|
|
7
7
|
*/
|
|
@@ -18,8 +18,7 @@ function getBestDistanceSquared(bezierPieces, p) {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
// The extra multiplier is to account for floating point precision.
|
|
21
|
-
|
|
22
|
-
return bestSquaredDistance * 1.01;
|
|
21
|
+
return (1 + 2 ** -10) * bestSquaredDistance;
|
|
23
22
|
}
|
|
24
23
|
export { getBestDistanceSquared };
|
|
25
24
|
//# sourceMappingURL=get-best-distance-squared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-best-distance-squared.js","sourceRoot":"","sources":["../../src/closest-boundary-point/get-best-distance-squared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAItD;;;;GAIG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW;IAEf,IAAI,mBAAmB,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACnD,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAEpC,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAEhC,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAClD,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAElD,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CACd,sBAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,EAC7B,sBAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,CAChC,CAAC;QAEF,IAAI,CAAC,GAAG,mBAAmB,EAAE;YACzB,mBAAmB,GAAG,CAAC,CAAC;SAC3B;KACJ;IAED,mEAAmE;IACnE,OAAO,CAAC,CAAC,GAAG,CAAC,IAAE,CAAC,EAAE,CAAC,GAAC,mBAAmB,CAAC;AAC5C,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BezierPiece } from '../mat/bezier-piece.js';
|
|
2
|
+
import { Curve } from '../curve/curve.js';
|
|
3
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* Returns the closest boundary point to the given point, limited to the given
|
|
7
|
+
* bezier pieces, including the beziers actually checked after culling.
|
|
8
|
+
* @param bezierPieces
|
|
9
|
+
* @param x
|
|
10
|
+
* @param touchedCurve
|
|
11
|
+
* @param t
|
|
12
|
+
* @param extreme
|
|
13
|
+
*/
|
|
14
|
+
declare function getCloseBoundaryPointsCertified(bezierPieces: BezierPiece[], x: number[], touchedCurve?: Curve | undefined, t?: number | undefined, for1Prong?: boolean, angle?: number): PointOnShape[];
|
|
15
|
+
export { getCloseBoundaryPointsCertified };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getPotentialClosestPointsOnCurveCertified } from './get-potential-closest-points-on-curve-certified.js';
|
|
2
|
+
import { cullBezierPieces1 } from './cull-bezier-pieces.js';
|
|
3
|
+
import { createPos } from '../point-on-shape/create-pos.js';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* Returns the closest boundary point to the given point, limited to the given
|
|
7
|
+
* bezier pieces, including the beziers actually checked after culling.
|
|
8
|
+
* @param bezierPieces
|
|
9
|
+
* @param x
|
|
10
|
+
* @param touchedCurve
|
|
11
|
+
* @param t
|
|
12
|
+
* @param extreme
|
|
13
|
+
*/
|
|
14
|
+
function getCloseBoundaryPointsCertified(bezierPieces, x, touchedCurve = undefined, t = undefined, for1Prong = false, angle = 0) {
|
|
15
|
+
bezierPieces = cullBezierPieces1(bezierPieces, x);
|
|
16
|
+
const pInfoss = [];
|
|
17
|
+
for (let i = 0; i < bezierPieces.length; i++) {
|
|
18
|
+
const bezierPiece = bezierPieces[i];
|
|
19
|
+
const pInfos = getPotentialClosestPointsOnCurveCertified(bezierPiece.curve, x, bezierPiece.ts, touchedCurve, t, for1Prong, angle);
|
|
20
|
+
pInfoss.push(...pInfos);
|
|
21
|
+
}
|
|
22
|
+
/** the minimum max interval value */
|
|
23
|
+
let minMax = Number.POSITIVE_INFINITY;
|
|
24
|
+
for (let i = 0; i < pInfoss.length; i++) {
|
|
25
|
+
const diMax = pInfoss[i].dSquaredI[1];
|
|
26
|
+
if (diMax < minMax) {
|
|
27
|
+
minMax = diMax;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const closestPointInfos = [];
|
|
31
|
+
for (let i = 0; i < pInfoss.length; i++) {
|
|
32
|
+
const info = pInfoss[i];
|
|
33
|
+
if (info.dSquaredI[0] <= minMax) {
|
|
34
|
+
closestPointInfos.push(info);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return closestPointInfos.map(info => createPos(info.curve, info.t, false));
|
|
38
|
+
}
|
|
39
|
+
export { getCloseBoundaryPointsCertified };
|
|
40
|
+
//# sourceMappingURL=get-close-boundary-points-certified.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-close-boundary-points-certified.js","sourceRoot":"","sources":["../../src/closest-boundary-point/get-close-boundary-points-certified.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yCAAyC,EAAE,MAAM,sDAAsD,CAAC;AACjH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAI5D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAG5D;;;;;;;;;GASG;AACH,SAAS,+BAA+B,CAChC,YAA2B,EAC3B,CAAW,EACjB,eAAkC,SAAS,EAC3C,IAAwB,SAAS,EACjC,SAAS,GAAG,KAAK,EACjB,KAAK,GAAG,CAAC;IAEV,YAAY,GAAG,iBAAiB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAElD,MAAM,OAAO,GAA0B,EAAE,CAAC;IAC1C,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACzC,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAEpC,MAAM,MAAM,GAAG,yCAAyC,CACvD,WAAW,CAAC,KAAK,EACjB,CAAC,EACD,WAAW,CAAC,EAAE,EACd,YAAY,EACZ,CAAC,EACD,SAAS,EACT,KAAK,CACL,CAAC;QAEF,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;KACxB;IAED,qCAAqC;IACrC,IAAI,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACtC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACtC,IAAI,KAAK,GAAG,MAAM,EAAE;YACnB,MAAM,GAAG,KAAK,CAAC;SACf;KACD;IAED,MAAM,iBAAiB,GAA0B,EAAE,CAAC;IAEpD,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE;YAChC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC7B;KACD;IAED,OAAO,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AAC5E,CAAC;AAGD,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Curve } from '../curve/curve.js';
|
|
2
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
3
|
+
import { BezierPiece } from '../mat/bezier-piece.js';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* Returns the closest boundary point to the given point, limited to the given
|
|
7
|
+
* bezier pieces, including the beziers actually checked after culling.
|
|
8
|
+
* @param bezierPieces
|
|
9
|
+
* @param x
|
|
10
|
+
* @param touchedCurve
|
|
11
|
+
* @param t
|
|
12
|
+
* @param extreme
|
|
13
|
+
*/
|
|
14
|
+
declare function getClosestBoundaryPointCertified(angle: number, bezierPieces: BezierPiece[], x: number[], touchedCurve: Curve, t: number, for1Prong: boolean): PointOnShape;
|
|
15
|
+
export { getClosestBoundaryPointCertified };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getObjClosestTo } from 'flo-vector2d';
|
|
2
|
+
import { createPos } from '../point-on-shape/create-pos.js';
|
|
3
|
+
import { cullBezierPieces1 } from './cull-bezier-pieces.js';
|
|
4
|
+
import { getPotentialClosestPointsOnCurveCertified } from './get-potential-closest-points-on-curve-certified.js';
|
|
5
|
+
import { squaredDistanceBetweenDd } from '../find-2-prong/squared-distance-between-dd.js';
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
* Returns the closest boundary point to the given point, limited to the given
|
|
9
|
+
* bezier pieces, including the beziers actually checked after culling.
|
|
10
|
+
* @param bezierPieces
|
|
11
|
+
* @param x
|
|
12
|
+
* @param touchedCurve
|
|
13
|
+
* @param t
|
|
14
|
+
* @param extreme
|
|
15
|
+
*/
|
|
16
|
+
function getClosestBoundaryPointCertified(angle, bezierPieces, x, touchedCurve, t, for1Prong) {
|
|
17
|
+
bezierPieces = cullBezierPieces1(bezierPieces, x);
|
|
18
|
+
let bestDistance = Number.POSITIVE_INFINITY;
|
|
19
|
+
let pos;
|
|
20
|
+
for (let i = 0; i < bezierPieces.length; i++) {
|
|
21
|
+
const bezierPiece = bezierPieces[i];
|
|
22
|
+
const ps = getPotentialClosestPointsOnCurveCertified(bezierPiece.curve, x, bezierPiece.ts, touchedCurve, t, for1Prong, angle);
|
|
23
|
+
const p = getObjClosestTo(x, ps, p => p.p);
|
|
24
|
+
if (p === undefined) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
const d = squaredDistanceBetweenDd(p.p, x);
|
|
28
|
+
let curve = bezierPiece.curve;
|
|
29
|
+
let t_ = p.t;
|
|
30
|
+
if (d < bestDistance) {
|
|
31
|
+
if (t_ === 0) {
|
|
32
|
+
t_ = 1;
|
|
33
|
+
curve = bezierPiece.curve.prev;
|
|
34
|
+
}
|
|
35
|
+
pos = createPos(curve, t_, false);
|
|
36
|
+
bestDistance = d;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return pos;
|
|
40
|
+
}
|
|
41
|
+
export { getClosestBoundaryPointCertified };
|
|
42
|
+
//# sourceMappingURL=get-closest-boundary-point-certified.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-closest-boundary-point-certified.js","sourceRoot":"","sources":["../../src/closest-boundary-point/get-closest-boundary-point-certified.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,yCAAyC,EAAE,MAAM,sDAAsD,CAAC;AACjH,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAG1F;;;;;;;;;GASG;AACH,SAAS,gCAAgC,CACvC,KAAa,EACP,YAA2B,EAC3B,CAAW,EACjB,YAAmB,EACnB,CAAS,EACT,SAAkB;IAEnB,YAAY,GAAG,iBAAiB,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAElD,IAAI,YAAY,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAC5C,IAAI,GAAiB,CAAC;IACtB,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACzC,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAE9B,MAAM,EAAE,GAAG,yCAAyC,CAChD,WAAW,CAAC,KAAK,EACjB,CAAC,EACD,WAAW,CAAC,EAAE,EACd,YAAY,EACZ,CAAC,EACV,SAAS,EACT,KAAK,CACC,CAAC;QAER,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAE1C,IAAI,CAAC,KAAK,SAAS,EAAE;YAAE,SAAS;SAAE;QAElC,MAAM,CAAC,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAE3C,IAAI,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;QAC9B,IAAI,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC;QAEZ,IAAI,CAAC,GAAG,YAAY,EAAE;YACrB,IAAI,EAAE,KAAK,CAAC,EAAE;gBACb,EAAE,GAAG,CAAC,CAAC;gBACP,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC;aAC/B;YAED,GAAG,GAAG,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;YAClC,YAAY,GAAG,CAAC,CAAC;SACjB;KACD;IAED,OAAO,GAAI,CAAC;AACb,CAAC;AAGD,OAAO,EAAE,gCAAgC,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-p-from-box.js","sourceRoot":"","sources":["../../src/closest-boundary-point/get-p-from-box.ts"],"names":[],"mappings":"AACA,gBAAgB;AAChB,SAAS,WAAW,CAAC,GAAe;IAChC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAClB,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAElB,OAAO;QACH,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAC,CAAC;QACjB,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAC,CAAC;KACpB,CAAC;AACN,CAAC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Curve } from "../curve/curve.js";
|
|
2
|
+
import { FootAndEndpointInfo } from './foot-and-endpoint-info.js';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* @param curve The curve
|
|
6
|
+
* @param x The point from which to check
|
|
7
|
+
* @param tRange The allowed t range
|
|
8
|
+
* @param touchedCurve The bezier on which p is located
|
|
9
|
+
* @param t The t value of the bezier that locates p
|
|
10
|
+
*/
|
|
11
|
+
declare function getPotentialClosestPointsOnCurveCertified(curve: Curve, x: number[], [tS, tE]?: number[], touchedCurve?: Curve | undefined, t?: number | undefined, for1Prong?: boolean, angle?: number): FootAndEndpointInfo[];
|
|
12
|
+
export { getPotentialClosestPointsOnCurveCertified };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { allRootsCertified } from 'flo-poly';
|
|
2
|
+
import { getFootPointsOnBezierPolysCertified, getIntervalBox } from 'flo-bezier3';
|
|
3
|
+
import { ddDeflateWithRunningError } from './dd-deflate-with-running-error.js';
|
|
4
|
+
import { eDeflate } from 'flo-poly';
|
|
5
|
+
import { γγ } from '../error-analysis/gamma.js';
|
|
6
|
+
import { rootIntervalToDistanceSquaredInterval } from './root-interval-to-distance-squared-interval.js';
|
|
7
|
+
import { getPFromBox } from './get-p-from-box.js';
|
|
8
|
+
const γγ3 = γγ(3);
|
|
9
|
+
const { sqrt } = Math;
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
* @param curve The curve
|
|
13
|
+
* @param x The point from which to check
|
|
14
|
+
* @param tRange The allowed t range
|
|
15
|
+
* @param touchedCurve The bezier on which p is located
|
|
16
|
+
* @param t The t value of the bezier that locates p
|
|
17
|
+
*/
|
|
18
|
+
function getPotentialClosestPointsOnCurveCertified(curve, x, [tS, tE] = [0, 1], touchedCurve = undefined, t = undefined, for1Prong = false, angle = 0) {
|
|
19
|
+
const ps = curve.ps;
|
|
20
|
+
const shouldDeflate = angle === 0 && curve === touchedCurve;
|
|
21
|
+
let { polyDd: polyDdO, polyE: polyEO, getPolyExact: getPolyExactO } = getFootPointsOnBezierPolysCertified(ps, x);
|
|
22
|
+
const def = shouldDeflate
|
|
23
|
+
? ddDeflateWithRunningError(polyDdO, polyEO.map(e => e / γγ3), t)
|
|
24
|
+
: undefined;
|
|
25
|
+
const def2 = for1Prong && shouldDeflate
|
|
26
|
+
? ddDeflateWithRunningError(def.coeffs, def.errBound.map(e => e / γγ3), t)
|
|
27
|
+
: undefined;
|
|
28
|
+
const def3 = for1Prong && shouldDeflate
|
|
29
|
+
? ddDeflateWithRunningError(def2.coeffs, def2.errBound.map(e => e / γγ3), t)
|
|
30
|
+
: undefined;
|
|
31
|
+
const { polyDd, polyE, getPolyExact } = def3 !== undefined
|
|
32
|
+
? { polyDd: def3.coeffs, polyE: def3.errBound.map(e => e / γγ3), getPolyExact: () => eDeflate(eDeflate(eDeflate(getPolyExactO(), t), t), t) }
|
|
33
|
+
: def !== undefined
|
|
34
|
+
? { polyDd: def.coeffs, polyE: def.errBound.map(e => e / γγ3), getPolyExact: () => eDeflate(getPolyExactO(), t) }
|
|
35
|
+
: { polyDd: polyDdO, polyE: polyEO, getPolyExact: getPolyExactO };
|
|
36
|
+
const ris = allRootsCertified(polyDd, tS, tE, polyE, getPolyExact);
|
|
37
|
+
const dontPush0 = ((t === 1 && curve === touchedCurve.next) ||
|
|
38
|
+
(t === 0 && curve === touchedCurve));
|
|
39
|
+
const dontPush1 = ((t === 0 && curve === touchedCurve.prev) ||
|
|
40
|
+
(t === 1 && curve === touchedCurve));
|
|
41
|
+
if (tS === 0) {
|
|
42
|
+
if (!dontPush0) {
|
|
43
|
+
ris.push({ tS: 0, tE: 0, multiplicity: 1 });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else if (tS === 1) {
|
|
47
|
+
if (!dontPush1) {
|
|
48
|
+
ris.push({ tS: 1, tE: 1, multiplicity: 1 });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
ris.push({ tS: tS, tE: tS, multiplicity: 1 });
|
|
53
|
+
}
|
|
54
|
+
if (tE === 0) {
|
|
55
|
+
if (!dontPush0) {
|
|
56
|
+
ris.push({ tS: 0, tE: 0, multiplicity: 1 });
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else if (tE === 1) {
|
|
60
|
+
if (!dontPush1) {
|
|
61
|
+
ris.push({ tS: 1, tE: 1, multiplicity: 1 });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
ris.push({ tS: tE, tE: tE, multiplicity: 1 });
|
|
66
|
+
}
|
|
67
|
+
const infos = ris
|
|
68
|
+
.map(ri => {
|
|
69
|
+
const { tS: ts, tE: te } = ri;
|
|
70
|
+
if (te < tS || ts > tE) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
const _t = (ts + te) / 2;
|
|
74
|
+
const t = _t < 0 ? 0 : _t > 1 ? 1 : _t;
|
|
75
|
+
const box = getIntervalBox(ps, [ts, te]);
|
|
76
|
+
const p_ = getPFromBox(box);
|
|
77
|
+
const dSquaredI = rootIntervalToDistanceSquaredInterval(box, x);
|
|
78
|
+
const t_ = t === 0 ? 1 : t;
|
|
79
|
+
const curve_ = t === 0 ? curve.prev : curve;
|
|
80
|
+
return {
|
|
81
|
+
curve: curve_,
|
|
82
|
+
p: p_,
|
|
83
|
+
t: t_,
|
|
84
|
+
d: (sqrt(dSquaredI[0]) + sqrt(dSquaredI[1])) / 2,
|
|
85
|
+
dSquaredI,
|
|
86
|
+
box,
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
const infos_ = infos.filter(info => info !== undefined);
|
|
90
|
+
return infos_;
|
|
91
|
+
}
|
|
92
|
+
export { getPotentialClosestPointsOnCurveCertified };
|
|
93
|
+
//# sourceMappingURL=get-potential-closest-points-on-curve-certified.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-potential-closest-points-on-curve-certified.js","sourceRoot":"","sources":["../../src/closest-boundary-point/get-potential-closest-points-on-curve-certified.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,mCAAmC,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC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C;IAEjF,OAAO,MAAM,CAAC;AAClB,CAAC;AAGD,OAAO,EAAE,yCAAyC,EAAE,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the distance interval squared given the root interval (currently
|
|
3
|
+
* ignoring multiplicity).
|
|
4
|
+
*
|
|
5
|
+
* * the result is returned as `[minPossibleSquared, maxPossibleSquared]` distance.
|
|
6
|
+
*
|
|
7
|
+
* @param box
|
|
8
|
+
* @param p
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
declare function rootIntervalToDistanceSquaredInterval(box: number[][], p: number[]): number[];
|
|
13
|
+
export { rootIntervalToDistanceSquaredInterval };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { twoDiff, eEstimate, eMult, eAdd } from 'big-float-ts';
|
|
2
|
+
// We *have* to do the below to improve performance with bundlers❗ The assignee is a getter❗ The assigned is a pure function❗
|
|
3
|
+
const estimate = eEstimate;
|
|
4
|
+
const td = twoDiff;
|
|
5
|
+
const emult = eMult;
|
|
6
|
+
const eadd = eAdd;
|
|
7
|
+
const eps = Number.EPSILON;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the distance interval squared given the root interval (currently
|
|
10
|
+
* ignoring multiplicity).
|
|
11
|
+
*
|
|
12
|
+
* * the result is returned as `[minPossibleSquared, maxPossibleSquared]` distance.
|
|
13
|
+
*
|
|
14
|
+
* @param box
|
|
15
|
+
* @param p
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
function rootIntervalToDistanceSquaredInterval(box, p) {
|
|
20
|
+
const bl = box[0];
|
|
21
|
+
const tr = box[1];
|
|
22
|
+
const minX = bl[0];
|
|
23
|
+
const minY = bl[1];
|
|
24
|
+
const maxX = tr[0];
|
|
25
|
+
const maxY = tr[1];
|
|
26
|
+
const x = p[0]; // <0>
|
|
27
|
+
const y = p[1]; // <0>
|
|
28
|
+
let minDSquared = Number.POSITIVE_INFINITY;
|
|
29
|
+
let maxDSquared = Number.NEGATIVE_INFINITY;
|
|
30
|
+
// for each corner of the interval box
|
|
31
|
+
for (const [a, b] of [[minX, minY], [minX, maxY], [maxX, minY], [maxX, maxY]]) {
|
|
32
|
+
/*
|
|
33
|
+
// distance to 1st corner of interval box - `distance² = x² + y²`
|
|
34
|
+
const dc1 = (a - x)**2 + (b - y)**2;
|
|
35
|
+
// max absolute roundoff error of `dc1`
|
|
36
|
+
// <4>dc1 <-- <4>(<3>(<1>(a - x)**2) + <3>(<1>((b - y)**2))
|
|
37
|
+
const dc1E = 4*γ1*((a + x)**2 + (b + y)**2);
|
|
38
|
+
const dc1Min = dc1 - dc1E; // distance minus max error
|
|
39
|
+
const dc1Max = dc1 + dc1E; // distance plus max error
|
|
40
|
+
*/
|
|
41
|
+
/** distance to 1st corner of interval box - `distance² = x² + y²` */
|
|
42
|
+
const ax = td(a, x); // a - x
|
|
43
|
+
const by = td(b, y); // b - y
|
|
44
|
+
const dc1Exact = eadd(emult(ax, ax), emult(by, by)); // ax**2 + bx**2
|
|
45
|
+
const dc1 = estimate(dc1Exact);
|
|
46
|
+
const dc1Min = dc1 * (1 - eps); // distance minus max error
|
|
47
|
+
const dc1Max = dc1 * (1 + eps); // distance plus max error
|
|
48
|
+
if (dc1Min <= minDSquared) {
|
|
49
|
+
minDSquared = dc1Min;
|
|
50
|
+
}
|
|
51
|
+
if (dc1Max >= maxDSquared) {
|
|
52
|
+
maxDSquared = dc1Max;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return [minDSquared, maxDSquared];
|
|
56
|
+
}
|
|
57
|
+
export { rootIntervalToDistanceSquaredInterval };
|
|
58
|
+
//# sourceMappingURL=root-interval-to-distance-squared-interval.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-interval-to-distance-squared-interval.js","sourceRoot":"","sources":["../../src/closest-boundary-point/root-interval-to-distance-squared-interval.ts"],"names":[],"mappings":"AA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AAC,CAAC,CAAC,CAAE,QAAQ;QAC7B,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAE,QAAQ;QAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,EAAC,EAAE,CAAC,EAAC,KAAK,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC,CAAC,CAAE,gBAAgB;QACnE,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAE/B,MAAM,MAAM,GAAG,GAAG,GAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAE,2BAA2B;QAC1D,MAAM,MAAM,GAAG,GAAG,GAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAE,0BAA0B;QAEzD,IAAI,MAAM,IAAI,WAAW,EAAE;YACvB,WAAW,GAAG,MAAM,CAAC;SACxB;QAED,IAAI,MAAM,IAAI,WAAW,EAAE;YACvB,WAAW,GAAG,MAAM,CAAC;SACxB;KACJ;IAED,OAAO,CAAC,WAAW,EAAC,WAAW,CAAC,CAAC;AACrC,CAAC;AAGD,OAAO,EAAE,qCAAqC,EAAE,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Circle } from '
|
|
1
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
2
|
+
import { Circle } from '../geometry/circle.js';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a point on the shape boundary for which MAT data has been
|
|
5
5
|
* calculated.
|
|
6
6
|
*/
|
|
7
7
|
interface ContactPoint {
|
|
8
8
|
/** Identifies the point on the shape boundary. */
|
|
9
|
-
pointOnShape:
|
|
9
|
+
pointOnShape: PointOnShape;
|
|
10
10
|
/** The maximal disk circle touching this point. */
|
|
11
11
|
circle: Circle;
|
|
12
12
|
/** Internally used to order two points lying at the same planar point. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { comparePoss } from '
|
|
1
|
+
import { comparePoss } from '../point-on-shape/compare-poss.js';
|
|
2
2
|
/**
|
|
3
3
|
* Primarily for internal use.
|
|
4
4
|
*
|
|
@@ -8,11 +8,7 @@ import { comparePoss } from './point-on-shape.js';
|
|
|
8
8
|
* @param b The second contact point.
|
|
9
9
|
*/
|
|
10
10
|
function compareCps(a, b) {
|
|
11
|
-
//let res = PointOnShape.compare(a.pointOnShape, b.pointOnShape);
|
|
12
11
|
let res = comparePoss(a.pointOnShape, b.pointOnShape);
|
|
13
|
-
if (res === undefined) {
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
12
|
if (res !== 0) {
|
|
17
13
|
return res;
|
|
18
14
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact-point.js","sourceRoot":"","sources":["../../src/contact-point/contact-point.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAoBhE;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,CAAe,EAAE,CAAe;IACnD,IAAI,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC;IAEtD,IAAI,GAAG,KAAK,CAAC,EAAE;QAAE,OAAO,GAAG,CAAC;KAAE;IAE9B,GAAG,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;IACxB,IAAI,GAAG,KAAK,CAAC,EAAE;QAAE,OAAO,GAAG,CAAC;KAAE;IAE9B,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;AAC5B,CAAC;AAGD,OAAO,EAAgB,UAAU,EAAE,CAAA"}
|