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,8 +1,8 @@
|
|
|
1
|
-
import { CpNode } from '../../cp-node.js';
|
|
2
|
-
import { posToHumanString } from '../../point-on-shape.js';
|
|
1
|
+
import { CpNode } from '../../cp-node/cp-node.js';
|
|
2
|
+
import { posToHumanString } from '../../point-on-shape/pos-to-human-string.js';
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
/** @
|
|
5
|
+
/** @internal */
|
|
6
6
|
export interface IGeneralDebugFunctions {
|
|
7
7
|
nameObj : (obj: any, pre?: string) => void,
|
|
8
8
|
δToString : (cpNodes: CpNode[]) => string[],
|
|
@@ -12,10 +12,10 @@ export interface IGeneralDebugFunctions {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
/** @
|
|
15
|
+
/** @internal */
|
|
16
16
|
let i = 0;
|
|
17
17
|
/**
|
|
18
|
-
* @
|
|
18
|
+
* @internal
|
|
19
19
|
* Name the given object - for debugging purposes only
|
|
20
20
|
*/
|
|
21
21
|
function nameObj(o: any, pre = '') {
|
|
@@ -24,7 +24,7 @@ function nameObj(o: any, pre = '') {
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* @
|
|
27
|
+
* @internal
|
|
28
28
|
* Transforms a boundary piece (δ) into a human readable string.
|
|
29
29
|
* @param cpNodes A boundary piece given by two CpNodes.
|
|
30
30
|
*/
|
|
@@ -36,7 +36,7 @@ function δToString(cpNodes: CpNode[]) {
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* @
|
|
39
|
+
* @internal
|
|
40
40
|
* Transforms an array of boundary pieces (δs) into a human readable string.
|
|
41
41
|
* @param cpNodes An array of boundary pieces.
|
|
42
42
|
*/
|
|
@@ -46,7 +46,7 @@ function δsToString(cpNodes: CpNode[][]) {
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
* @
|
|
49
|
+
* @internal
|
|
50
50
|
* Convert the given points into a human readable string.
|
|
51
51
|
* @param ps
|
|
52
52
|
*/
|
|
@@ -56,7 +56,7 @@ function pointsToStr(ps: number[][], decimalPlaces = 3) {
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
* @
|
|
59
|
+
* @internal
|
|
60
60
|
* Converts the given point into a human readable string.
|
|
61
61
|
* @param p The point
|
|
62
62
|
* @param decimalPlaces number of decimal places
|
|
@@ -66,7 +66,7 @@ function pointToStr(p: number[], decimalPlaces = 3) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
/** @
|
|
69
|
+
/** @internal */
|
|
70
70
|
const generalDebugFunctions/*: IGeneralDebugFunctions*/ = {
|
|
71
71
|
δToString,
|
|
72
72
|
δsToString,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @
|
|
1
|
+
/** @internal */
|
|
2
2
|
declare let _debug_: Debug;
|
|
3
3
|
|
|
4
4
|
import { drawFs } from 'flo-draw';
|
|
@@ -7,7 +7,7 @@ import { Debug } from '../debug.js';
|
|
|
7
7
|
import { ThreeProngForDebugging } from '../three-prong-for-debugging.js';
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
/** @
|
|
10
|
+
/** @internal */
|
|
11
11
|
export interface IThreeProngDebugFunctions {
|
|
12
12
|
drawSpokes : (g: SVGGElement, n: number) => void,
|
|
13
13
|
traceConvergence : (g: SVGGElement, n: number, indx: number) => void,
|
|
@@ -22,28 +22,24 @@ export interface IThreeProngDebugFunctions {
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
* @
|
|
25
|
+
* @internal
|
|
26
26
|
* Draws 3 lines from the given 3-prong center to its 3 contact points.
|
|
27
27
|
* @param n - The 3-prong's zero-based index.
|
|
28
28
|
*/
|
|
29
29
|
function drawSpokes(g: SVGGElement, n: number): void {
|
|
30
30
|
const threeProng = _debug_.generated.elems.threeProng[n];
|
|
31
|
-
//const g = threeProng.generated.g;
|
|
32
31
|
const cc = threeProng.circle.center;
|
|
33
32
|
const poss = threeProng.poss;
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
drawFs.line(g, [poss[0].p, cc], 'thin5 red');
|
|
40
|
-
drawFs.line(g, [poss[1].p, cc], 'thin5 red');
|
|
41
|
-
drawFs.line(g, [poss[2].p, cc], 'thin5 red');
|
|
34
|
+
for (let i=0; i<poss.length; i++) {
|
|
35
|
+
const pos = poss[i];
|
|
36
|
+
drawFs.line(g, [pos.p, cc], 'thin5 red');
|
|
37
|
+
}
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
|
|
45
41
|
/**
|
|
46
|
-
* @
|
|
42
|
+
* @internal
|
|
47
43
|
* Shows the circle for each boundary iteration.
|
|
48
44
|
* @param n_ - The 3-prong's zero-based index. If ommitted, all will be shown.
|
|
49
45
|
* @param idx - The specific boundary iteration index to view. If ommitted, all
|
|
@@ -57,7 +53,7 @@ function traceConvergence(g: SVGGElement, n_: number, idx: number): void {
|
|
|
57
53
|
eIndx = _debug_.generated.elems.threeProng.length;
|
|
58
54
|
} else {
|
|
59
55
|
sIndx = n_;
|
|
60
|
-
eIndx = n_+1;
|
|
56
|
+
eIndx = n_ + 1;
|
|
61
57
|
}
|
|
62
58
|
|
|
63
59
|
for (let n=sIndx; n<eIndx; n++) {
|
|
@@ -76,14 +72,14 @@ function traceConvergence(g: SVGGElement, n_: number, idx: number): void {
|
|
|
76
72
|
let endIndx;
|
|
77
73
|
if (n_ === undefined || idx === -1) {
|
|
78
74
|
startIndx = forDebugging.bestIndx;
|
|
79
|
-
endIndx = forDebugging.bestIndx+1;
|
|
75
|
+
endIndx = forDebugging.bestIndx + 1;
|
|
80
76
|
} else {
|
|
81
77
|
if (idx === undefined) {
|
|
82
78
|
startIndx = 0;
|
|
83
79
|
endIndx = candidateThreeProngs.length;
|
|
84
80
|
} else {
|
|
85
81
|
startIndx = idx;
|
|
86
|
-
endIndx = idx+1;
|
|
82
|
+
endIndx = idx + 1;
|
|
87
83
|
}
|
|
88
84
|
}
|
|
89
85
|
|
|
@@ -105,7 +101,7 @@ function traceConvergence(g: SVGGElement, n_: number, idx: number): void {
|
|
|
105
101
|
|
|
106
102
|
|
|
107
103
|
/**
|
|
108
|
-
* @
|
|
104
|
+
* @internal
|
|
109
105
|
* Shows the actual boundary for each iteration.
|
|
110
106
|
* @param n The 3-prong's zero-based index.
|
|
111
107
|
* @param idx The specific boundary iteration index to view. If ommitted will
|
|
@@ -166,7 +162,7 @@ function showBoundary(g: SVGGElement, n: number, idx: number): void {
|
|
|
166
162
|
|
|
167
163
|
|
|
168
164
|
/**
|
|
169
|
-
* @
|
|
165
|
+
* @internal
|
|
170
166
|
* @param n The 3-prong's zero-based index.
|
|
171
167
|
*/
|
|
172
168
|
function logδs(n: number): void {
|
|
@@ -177,7 +173,7 @@ function logδs(n: number): void {
|
|
|
177
173
|
|
|
178
174
|
|
|
179
175
|
/**
|
|
180
|
-
* @
|
|
176
|
+
* @internal
|
|
181
177
|
* @param p
|
|
182
178
|
*/
|
|
183
179
|
function logNearest(
|
|
@@ -192,7 +188,7 @@ function logNearest(
|
|
|
192
188
|
p,
|
|
193
189
|
generated.elems.threeProng,
|
|
194
190
|
threeProng => threeProng.circle ? threeProng.circle.center : [0,0]
|
|
195
|
-
)
|
|
191
|
+
)!;
|
|
196
192
|
|
|
197
193
|
|
|
198
194
|
const circle = threeProng.circle;
|
|
@@ -240,7 +236,7 @@ function logNearest(
|
|
|
240
236
|
}
|
|
241
237
|
|
|
242
238
|
|
|
243
|
-
/** @
|
|
239
|
+
/** @internal */
|
|
244
240
|
const threeProngDebugFunctions: IThreeProngDebugFunctions = {
|
|
245
241
|
drawSpokes,
|
|
246
242
|
traceConvergence,
|
|
@@ -3,26 +3,29 @@ declare let _debug_: Debug;
|
|
|
3
3
|
import { drawFs } from 'flo-draw';
|
|
4
4
|
import { getObjClosestTo, distanceBetween, squaredDistanceBetween } from 'flo-vector2d';
|
|
5
5
|
import { Debug, Generated } from '../debug.js';
|
|
6
|
-
import { CpNode } from '../../cp-node.js';
|
|
7
|
-
import { Circle } from '../../circle.js';
|
|
6
|
+
import { CpNode } from '../../cp-node/cp-node.js';
|
|
7
|
+
import { Circle } from '../../geometry/circle.js';
|
|
8
8
|
import { TwoProngForDebugging } from '../two-prong-for-debugging.js';
|
|
9
9
|
import { ElemType_TwoProng } from '../../mat/elem-type-two-prong.js';
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
/** @
|
|
12
|
+
/** @internal */
|
|
13
13
|
interface ITwoProngDebugFunctions {
|
|
14
14
|
logδ : (n: number, type?: ElemType_TwoProng) => void,
|
|
15
15
|
log : (n: number, type?: ElemType_TwoProng) => void,
|
|
16
|
-
drawNormal :
|
|
16
|
+
drawNormal : typeof drawNormal,
|
|
17
17
|
logδBasic : (n: number) => void,
|
|
18
|
-
logNearest : (
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
logNearest : (
|
|
19
|
+
showSpokes? : boolean,
|
|
20
|
+
showTrace? : boolean,
|
|
21
|
+
showBoundaries? : boolean
|
|
22
|
+
) => (g: SVGGElement, p: number[], showDelay?: number, scale?: number) => void,
|
|
23
|
+
traceConvergence: typeof traceConvergence,
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
|
|
24
27
|
/**
|
|
25
|
-
* @
|
|
28
|
+
* @internal
|
|
26
29
|
*/
|
|
27
30
|
function logδ(n: number, type: ElemType_TwoProng = 'twoProng_regular') {
|
|
28
31
|
const δ =_debug_.generated.elems[type][n].δ;
|
|
@@ -32,7 +35,7 @@ function logδ(n: number, type: ElemType_TwoProng = 'twoProng_regular') {
|
|
|
32
35
|
|
|
33
36
|
|
|
34
37
|
/**
|
|
35
|
-
* @
|
|
38
|
+
* @internal
|
|
36
39
|
*/
|
|
37
40
|
function log(n: number, type: ElemType_TwoProng = 'twoProng_regular') {
|
|
38
41
|
const twoProng = _debug_.generated.elems[type][n];
|
|
@@ -41,29 +44,13 @@ function log(n: number, type: ElemType_TwoProng = 'twoProng_regular') {
|
|
|
41
44
|
|
|
42
45
|
|
|
43
46
|
/**
|
|
44
|
-
* @
|
|
47
|
+
* @internal
|
|
45
48
|
*/
|
|
46
49
|
function drawNormal(
|
|
47
50
|
g: SVGGElement,
|
|
48
|
-
|
|
49
|
-
showDelay = 1000
|
|
50
|
-
type: ElemType_TwoProng = 'twoProng_regular') {
|
|
51
|
-
|
|
52
|
-
const twoProngs = _debug_.generated.elems[type];
|
|
53
|
-
|
|
54
|
-
// If not specified which, draw all
|
|
55
|
-
if (n === undefined) {
|
|
56
|
-
for (let i=0; i<twoProngs.length; i++) {
|
|
57
|
-
drawNormal(g, i);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const twoProng = twoProngs[n];
|
|
51
|
+
twoProng: TwoProngForDebugging,
|
|
52
|
+
showDelay = 1000) {
|
|
62
53
|
|
|
63
|
-
//let g = twoProng.generated.g;
|
|
64
|
-
|
|
65
|
-
if (!twoProng) { return; }
|
|
66
|
-
|
|
67
54
|
drawFs.line(
|
|
68
55
|
g, [twoProng.pos.p, twoProng.circle.center], 'thin10 blue', showDelay
|
|
69
56
|
);
|
|
@@ -71,7 +58,7 @@ function drawNormal(
|
|
|
71
58
|
|
|
72
59
|
|
|
73
60
|
/**
|
|
74
|
-
* @
|
|
61
|
+
* @internal
|
|
75
62
|
*/
|
|
76
63
|
function logδBasic(
|
|
77
64
|
n: number,
|
|
@@ -79,7 +66,7 @@ function logδBasic(
|
|
|
79
66
|
|
|
80
67
|
const delta = _debug_.generated.elems[type][n].δ;
|
|
81
68
|
|
|
82
|
-
function
|
|
69
|
+
function logδBasic_(x: CpNode) {
|
|
83
70
|
const pos = x.cp.pointOnShape;
|
|
84
71
|
return {
|
|
85
72
|
bez: pos.curve.ps,
|
|
@@ -87,62 +74,93 @@ function logδBasic(
|
|
|
87
74
|
}
|
|
88
75
|
}
|
|
89
76
|
|
|
90
|
-
console.log(
|
|
91
|
-
console.log(
|
|
77
|
+
console.log(logδBasic_(delta[0]));
|
|
78
|
+
console.log(logδBasic_(delta[1]));
|
|
92
79
|
}
|
|
93
80
|
|
|
94
81
|
|
|
95
82
|
/**
|
|
96
|
-
* @
|
|
83
|
+
* @internal
|
|
84
|
+
* Draws 3 lines from the given 3-prong center to its 3 contact points.
|
|
85
|
+
* @param n - The 3-prong's zero-based index.
|
|
97
86
|
*/
|
|
98
|
-
function
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
);
|
|
107
|
-
|
|
87
|
+
function drawSpokes(
|
|
88
|
+
g: SVGGElement,
|
|
89
|
+
twoProng: TwoProngForDebugging,
|
|
90
|
+
showDelay = 1000): void {
|
|
91
|
+
|
|
92
|
+
const cc = twoProng.circle.center;
|
|
93
|
+
const { pos, circle, cpNode, xs, z, δ } = twoProng;
|
|
94
|
+
|
|
95
|
+
drawFs.line(g, [pos.p, cc], 'thin5 red', showDelay);
|
|
96
|
+
drawFs.line(g, [z, cc], 'thin5 red', showDelay);
|
|
97
|
+
}
|
|
108
98
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
function logNearest(
|
|
104
|
+
showSpokes?: boolean,
|
|
105
|
+
showTrace?: boolean,
|
|
106
|
+
showBoundaries?: boolean) {
|
|
107
|
+
|
|
108
|
+
return (g: SVGGElement,
|
|
109
|
+
p: number[],
|
|
110
|
+
showDelay = 1000,
|
|
111
|
+
scale = 1) => {
|
|
112
|
+
|
|
113
|
+
const closestPerLoops: TwoProngForDebugging[] = [];
|
|
114
|
+
|
|
115
|
+
const generated = _debug_.generated;
|
|
116
|
+
const twoProng = getObjClosestTo<TwoProngForDebugging>(
|
|
117
|
+
p,
|
|
118
|
+
// generated.elems[type],
|
|
119
|
+
generated.elems['twoProng_regular'],
|
|
120
|
+
twoProng => twoProng.circle.center
|
|
121
|
+
)!;
|
|
122
|
+
closestPerLoops.push(twoProng!);
|
|
123
|
+
|
|
124
|
+
console.log(twoProng);
|
|
125
|
+
|
|
126
|
+
let n;
|
|
127
|
+
//for (let i=0; i<_debug_.generated.elems[type].length; i++) {
|
|
128
|
+
// const twoProng_ = _debug_.generated.elems[type][i];
|
|
129
|
+
for (let i=0; i<_debug_.generated.elems['twoProng_regular'].length; i++) {
|
|
130
|
+
const twoProng_ = _debug_.generated.elems['twoProng_regular'][i];
|
|
131
|
+
if (twoProng_ === twoProng) {
|
|
132
|
+
n = i;
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (showSpokes) {
|
|
138
|
+
drawSpokes(g, twoProng, showDelay)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (n !== undefined && showTrace) {
|
|
142
|
+
traceConvergence(g, twoProng, showDelay, scale);
|
|
117
143
|
}
|
|
118
144
|
}
|
|
119
|
-
|
|
120
|
-
if (n !== undefined) { traceConvergence(g, n, true, showDelay); }
|
|
121
145
|
}
|
|
122
146
|
|
|
123
147
|
|
|
124
148
|
/**
|
|
125
|
-
* @
|
|
149
|
+
* @internal
|
|
126
150
|
* @param n - The 2-prong's zero-based index.
|
|
127
151
|
* @param range
|
|
128
152
|
*/
|
|
129
153
|
function traceConvergence(
|
|
130
154
|
g: SVGGElement,
|
|
131
|
-
|
|
132
|
-
finalOnly : boolean,
|
|
155
|
+
twoProng: TwoProngForDebugging,
|
|
133
156
|
showDelay = 1000,
|
|
134
|
-
|
|
135
|
-
type : ElemType_TwoProng = 'twoProng_regular') {
|
|
136
|
-
|
|
137
|
-
if (n === undefined) { return; }
|
|
157
|
+
scale = 1) {
|
|
138
158
|
|
|
139
|
-
const
|
|
140
|
-
const xs = twoProngInfo.xs;
|
|
141
|
-
//let g = twoProngInfo.generated.g;
|
|
159
|
+
const xs = twoProng.xs;
|
|
142
160
|
|
|
143
|
-
console.log(
|
|
161
|
+
console.log(twoProng);
|
|
144
162
|
console.log(
|
|
145
|
-
|
|
163
|
+
twoProng.xs.map(x => ({
|
|
146
164
|
x: x.x,
|
|
147
165
|
y: x.y,
|
|
148
166
|
z: x.z,
|
|
@@ -152,31 +170,25 @@ function traceConvergence(
|
|
|
152
170
|
)
|
|
153
171
|
);
|
|
154
172
|
|
|
173
|
+
console.log(xs.length)
|
|
155
174
|
for (let i=0; i<xs.length; i++) {
|
|
156
|
-
|
|
157
|
-
continue;
|
|
158
|
-
}
|
|
159
|
-
if (finalOnly && i !== xs.length-1) {
|
|
160
|
-
continue;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
const x = twoProngInfo.xs[i];
|
|
175
|
+
const x = twoProng.xs[i];
|
|
164
176
|
|
|
165
177
|
const circle = { center: x.x, radius: distanceBetween(x.x, x.y.p) };
|
|
166
|
-
drawFs.crossHair(g, x.x, 'red thin10 nofill',
|
|
178
|
+
drawFs.crossHair(g, x.x, 'red thin10 nofill', 0.002*scale, showDelay);
|
|
167
179
|
drawFs.circle(g, circle, 'blue thin10 nofill', showDelay);
|
|
168
180
|
if (x.z !== undefined) {
|
|
169
181
|
drawFs.crossHair(
|
|
170
|
-
g, x.z.p, 'yellow thin10 nofill',
|
|
182
|
+
g, x.z.p, 'yellow thin10 nofill', 0.001*scale, showDelay
|
|
171
183
|
);
|
|
172
184
|
}
|
|
173
185
|
}
|
|
174
186
|
|
|
175
|
-
twoProngDebugFunctions.drawNormal(g,
|
|
187
|
+
// twoProngDebugFunctions.drawNormal(g, twoProng, showDelay);
|
|
176
188
|
}
|
|
177
189
|
|
|
178
190
|
|
|
179
|
-
/** @
|
|
191
|
+
/** @internal */
|
|
180
192
|
const twoProngDebugFunctions: ITwoProngDebugFunctions = {
|
|
181
193
|
logδ,
|
|
182
194
|
log,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { CpNode } from '../cp-node.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
2
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
3
|
+
import { posToHumanString } from '../point-on-shape/pos-to-human-string.js';
|
|
4
|
+
import { Circle } from '../geometry/circle.js';
|
|
4
5
|
import { Generated } from './debug.js';
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
|
-
* @
|
|
9
|
+
* @internal
|
|
9
10
|
* Used for debugging only. A three-prong is a maximally inscribed circle that
|
|
10
11
|
* touches the shape boundary (tangentially) at 3 points.
|
|
11
12
|
*/
|
|
@@ -14,7 +15,7 @@ interface ThreeProngForDebugging {
|
|
|
14
15
|
/** The best fit circle found for the 3-prong. */
|
|
15
16
|
circle : Circle;
|
|
16
17
|
/** The best fit 3 points found for the 3-prong. */
|
|
17
|
-
poss :
|
|
18
|
+
poss : PointOnShape[];
|
|
18
19
|
/** The 3 boundary pieces on which the three prong points were found. */
|
|
19
20
|
cp3ss : CpNode[][];
|
|
20
21
|
/** The boundary pieces that were used to search the three prong on. */
|
|
@@ -23,7 +24,7 @@ interface ThreeProngForDebugging {
|
|
|
23
24
|
/** An array of 3-prongs, each of which may be a best fit 3-prong. */
|
|
24
25
|
candidateThreeProngs : {
|
|
25
26
|
circle: Circle;
|
|
26
|
-
ps:
|
|
27
|
+
ps: PointOnShape[];
|
|
27
28
|
}[];
|
|
28
29
|
visitedCps : CpNode[];
|
|
29
30
|
boundaries : number[][][][];
|
|
@@ -33,16 +34,16 @@ interface ThreeProngForDebugging {
|
|
|
33
34
|
|
|
34
35
|
function createEmptyThreeProngForDebugging(): ThreeProngForDebugging {
|
|
35
36
|
return {
|
|
36
|
-
generated : undefined
|
|
37
|
-
circle : undefined
|
|
38
|
-
poss : undefined
|
|
39
|
-
cp3ss : undefined
|
|
40
|
-
cpss : undefined
|
|
41
|
-
bestIndx : undefined
|
|
42
|
-
candidateThreeProngs : undefined
|
|
43
|
-
visitedCps : undefined
|
|
44
|
-
boundaries : undefined
|
|
45
|
-
traces : undefined
|
|
37
|
+
generated : undefined!,
|
|
38
|
+
circle : undefined!,
|
|
39
|
+
poss : undefined!,
|
|
40
|
+
cp3ss : undefined!,
|
|
41
|
+
cpss : undefined!,
|
|
42
|
+
bestIndx : undefined!,
|
|
43
|
+
candidateThreeProngs : undefined!,
|
|
44
|
+
visitedCps : undefined!,
|
|
45
|
+
boundaries : undefined!,
|
|
46
|
+
traces : undefined!,
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { CpNode } from '../cp-node.js';
|
|
2
|
-
import {
|
|
3
|
-
import { Circle } from '../circle.js';
|
|
1
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
2
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
3
|
+
import { Circle } from '../geometry/circle.js';
|
|
4
4
|
import { BezierPiece } from '../mat/bezier-piece.js';
|
|
5
5
|
import { Generated } from './debug.js';
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
/** @
|
|
8
|
+
/** @internal */
|
|
9
9
|
interface TwoProngForDebugging {
|
|
10
10
|
generated: Generated;
|
|
11
11
|
bezierPieces: BezierPiece[];
|
|
12
|
-
pos:
|
|
12
|
+
pos: PointOnShape;
|
|
13
13
|
δ: CpNode[];
|
|
14
14
|
z: number[];
|
|
15
15
|
circle: Circle;
|
|
16
16
|
xs: {
|
|
17
17
|
x: number[];
|
|
18
|
-
y:
|
|
19
|
-
z:
|
|
18
|
+
y: PointOnShape;
|
|
19
|
+
z: PointOnShape;
|
|
20
20
|
t: number;
|
|
21
21
|
}[];
|
|
22
22
|
failed: boolean;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const u = Number.EPSILON / 2;
|
|
2
|
+
const uu = u*u;
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The canonical floating point error function, γ.
|
|
7
|
+
*
|
|
8
|
+
* * roughly `=== n * (Number.EPSILON / 2)`
|
|
9
|
+
* * see e.g. [Algorithms for Accurate, Validated and Fast Polynomial Evaluation](https://hal.archives-ouvertes.fr/hal-00285603/document)
|
|
10
|
+
* @param n the parameter - typically a small positive integer, e.g. for
|
|
11
|
+
* polynomial evaluation this === 2*d + 1, where d is the degree of the
|
|
12
|
+
* polynomial
|
|
13
|
+
*
|
|
14
|
+
* @doc
|
|
15
|
+
*/
|
|
16
|
+
function γ(n: number): number {
|
|
17
|
+
const nu = n*u;
|
|
18
|
+
|
|
19
|
+
return nu/(1-nu);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The canonical, once compensated (implying double-double precision),
|
|
24
|
+
* floating point error function.
|
|
25
|
+
*
|
|
26
|
+
* * roughly `=== n * (Number.EPSILON / 2)**2`
|
|
27
|
+
* * see e.g. [Algorithms for Accurate, Validated and Fast Polynomial Evaluation](https://hal.archives-ouvertes.fr/hal-00285603/document)
|
|
28
|
+
* @param n the parameter - typically a small positive integer, e.g. for
|
|
29
|
+
* polynomial evaluation this === 2*d + 1, where d is the degree of the
|
|
30
|
+
* polynomial
|
|
31
|
+
*
|
|
32
|
+
* @doc
|
|
33
|
+
*/
|
|
34
|
+
function γγ(n: number): number {
|
|
35
|
+
const nuu = n*uu;
|
|
36
|
+
|
|
37
|
+
return nuu/(1-nuu);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
export { γ, γγ }
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
declare const _debug_: Debug;
|
|
3
3
|
|
|
4
4
|
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
5
|
-
import { Debug } from '
|
|
6
|
-
import { Loop } from '
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { Debug } from '../debug/debug.js';
|
|
6
|
+
import { Loop } from 'flo-boolean';
|
|
7
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
8
|
+
import { addToCpGraph } from '../mat/add-to-cp-graph.js';
|
|
9
|
+
import { isAnotherCpCloseby } from '../mat/is-another-cp-closeby.js';
|
|
10
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
11
|
+
import { isPosDullCorner } from '../point-on-shape/is-pos-dull-corner.js';
|
|
12
|
+
import { calcPosOrder } from '../point-on-shape/calc-pos-order.js';
|
|
13
|
+
import { Circle } from '../geometry/circle.js';
|
|
11
14
|
|
|
12
15
|
|
|
13
16
|
/**
|
|
@@ -17,9 +20,10 @@ import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
|
|
|
17
20
|
* @param pos
|
|
18
21
|
*/
|
|
19
22
|
function add1Prong(
|
|
20
|
-
|
|
23
|
+
radius: number,
|
|
24
|
+
center: number[],
|
|
21
25
|
cpGraphs: Map<Loop,LlRbTree<CpNode>>,
|
|
22
|
-
pos:
|
|
26
|
+
pos: PointOnShape) {
|
|
23
27
|
|
|
24
28
|
//if (PointOnShape.isDullCorner(pos)) {
|
|
25
29
|
if (isPosDullCorner(pos)) {
|
|
@@ -37,29 +41,28 @@ function add1Prong(
|
|
|
37
41
|
//toRemove.push(posNode); // this!
|
|
38
42
|
|
|
39
43
|
if (typeof _debug_ !== 'undefined') {
|
|
40
|
-
_debug_.generated.elems.oneProngAtDullCorner.push(pos);
|
|
44
|
+
// _debug_.generated.elems.oneProngAtDullCorner.push(pos);
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
return;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
|
-
//
|
|
47
|
-
|
|
50
|
+
// const circle = getOsculatingCircle(maxOsculatingCircleRadius, pos);
|
|
51
|
+
const circle: Circle = { radius, center };
|
|
48
52
|
|
|
49
|
-
//const order = PointOnShape.calcOrder(circle, pos);
|
|
50
53
|
const order = calcPosOrder(circle, pos);
|
|
51
54
|
// Make sure there isn't already a ContactPoint close by - it can cause
|
|
52
55
|
// floating point stability issues.
|
|
53
|
-
if (isAnotherCpCloseby(cpGraphs, pos, circle, order, 0, 1000
|
|
56
|
+
if (isAnotherCpCloseby(cpGraphs, pos, circle, order, 0, 1000)) {
|
|
54
57
|
return;
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
addToCpGraph(circle, [-0.5, +0.5], cpGraphs, [pos, pos]);
|
|
60
|
+
const cpNodes = addToCpGraph(circle, [-0.5, +0.5], cpGraphs, [pos, pos]);
|
|
58
61
|
|
|
59
62
|
if (typeof _debug_ !== 'undefined') {
|
|
60
|
-
_debug_.generated.elems.oneProng.push(
|
|
63
|
+
_debug_.generated.elems.oneProng.push(cpNodes);
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
|
|
65
|
-
export { add1Prong }
|
|
68
|
+
export { add1Prong }
|