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
package/node/{compare-curvatures-at-interface.js → corner/compare-curvatures-at-interface.js}
RENAMED
|
@@ -91,8 +91,8 @@ function compareCurvaturesAtInterface(psI, psO) {
|
|
|
91
91
|
// <=> (de - 3af)²b⁵ > (bg - 3ch)²d⁵
|
|
92
92
|
// <=> i²b⁵ > j²d⁵
|
|
93
93
|
// Get x′′′ and y′′′ for incoming curve evaluated at 1
|
|
94
|
-
const [dddxI, dddyI] = toPowerBasis_3rdDerivative(psI); // max bitlength increase === max shift === 6
|
|
95
|
-
const [dddxO, dddyO] = toPowerBasis_3rdDerivative(psO); // max bitlength increase === max shift === 6
|
|
94
|
+
const [[dddxI], [dddyI]] = toPowerBasis_3rdDerivative(psI); // max bitlength increase === max shift === 6
|
|
95
|
+
const [[dddxO], [dddyO]] = toPowerBasis_3rdDerivative(psO); // max bitlength increase === max shift === 6
|
|
96
96
|
const e = eDiff(twoProduct(dxI, dddyI), twoProduct(dyI, dddxI));
|
|
97
97
|
const f = fastExpansionSum(twoProduct(dxI, ddxI), twoProduct(dyI, ddyI));
|
|
98
98
|
const g = eDiff(twoProduct(dxO, dddyO), twoProduct(dyO, dddxO));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare-curvatures-at-interface.js","sourceRoot":"","sources":["../../src/corner/compare-curvatures-at-interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5G,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAG/F;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,4BAA4B,CAC7B,GAAe,EACf,GAAe;IAEnB,kDAAkD;IAClD,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GA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KAAK,CAAC,CAAC,CAAC,CAAC;IACvB,IAAI,KAAK,KAAK,KAAK,EAAE;QACjB,OAAO,KAAK,GAAG,KAAK,CAAC;KACxB;IAED,IAAI,KAAK,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,EAAE;QAC5B,iEAAiE;QACjE,OAAO,CAAC,CAAC;KACZ;IAED,MAAM,EAAE,GAAG,gBAAgB,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IACjC,MAAM,EAAE,GAAG,gBAAgB,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;IACnC,MAAM,EAAE,GAAG,gBAAgB,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IACjC,MAAM,EAAE,GAAG,gBAAgB,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;IAEnC,MAAM,GAAG,GAAG,gBAAgB,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;IACpC,MAAM,GAAG,GAAG,gBAAgB,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;IAEpC,MAAM,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAEnC,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAE9B,2EAA2E;IAC3E,2CAA2C;AAC/C,CAAC;AAGD,OAAO,EAAE,4BAA4B,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"corner.js","sourceRoot":"","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"corner.js","sourceRoot":"","sources":["../../src/corner/corner.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Corner } from "./corner";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* Returns a new corner with properties.
|
|
5
|
+
*
|
|
6
|
+
* PRECONDITION: The beziers has control points with max bit-length of 26 and
|
|
7
|
+
* aligned to a 'grid' to have the same exponent. This is so the vectors between
|
|
8
|
+
* control points can be calculated exactly without resorting to adaptive
|
|
9
|
+
* infinite precision floating point operations.
|
|
10
|
+
*
|
|
11
|
+
* @param psI The incoming bezier that ends in the corner
|
|
12
|
+
* @param psO The outgoing bezier that starts at the corner
|
|
13
|
+
*/
|
|
14
|
+
declare function getCorner(psI: number[][], psO: number[][]): Corner;
|
|
15
|
+
export { getCorner };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { cross, dot, toUnitVector } from 'flo-vector2d';
|
|
1
|
+
import { cross, dot, toUnitVector } from "flo-vector2d";
|
|
3
2
|
import { getInterfaceCcw } from './get-interface-ccw.js';
|
|
4
3
|
/**
|
|
5
|
-
* @
|
|
4
|
+
* @internal
|
|
6
5
|
* Angle in degrees to radians.
|
|
7
6
|
*/
|
|
8
7
|
const DEGREES = {
|
|
@@ -12,12 +11,12 @@ const DEGREES = {
|
|
|
12
11
|
4: 0.0698,
|
|
13
12
|
16: 0.2756,
|
|
14
13
|
};
|
|
15
|
-
/** @
|
|
14
|
+
/** @internal */
|
|
16
15
|
//const DEGREE_LIMIT = DEGREES[1];
|
|
17
16
|
const DEGREE_LIMIT = DEGREES[4];
|
|
18
17
|
//const DEGREE_LIMIT = DEGREES[16];
|
|
19
18
|
/**
|
|
20
|
-
* @
|
|
19
|
+
* @internal
|
|
21
20
|
* Returns a new corner with properties.
|
|
22
21
|
*
|
|
23
22
|
* PRECONDITION: The beziers has control points with max bit-length of 26 and
|
|
@@ -75,15 +74,5 @@ function getCorner(psI, psO) {
|
|
|
75
74
|
isQuiteDull
|
|
76
75
|
};
|
|
77
76
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
* Returns information about the corner created at the end of this curve
|
|
81
|
-
* (at t === 1) and the start of the next curve (at t === 0).
|
|
82
|
-
*/
|
|
83
|
-
const getCornerAtEnd = memoize(function (curve) {
|
|
84
|
-
const psE = curve.ps;
|
|
85
|
-
const psS = curve.next.ps;
|
|
86
|
-
return getCorner(psE, psS);
|
|
87
|
-
});
|
|
88
|
-
export { getCorner, getCornerAtEnd };
|
|
89
|
-
//# sourceMappingURL=curve.js.map
|
|
77
|
+
export { getCorner };
|
|
78
|
+
//# sourceMappingURL=get-corner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-corner.js","sourceRoot":"","sources":["../../src/corner/get-corner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD;;;GAGG;AACH,MAAM,OAAO,GAAG;IACf,kBAAkB;IAClB,IAAI,EAAG,MAAM;IACb,CAAC,EAAM,MAAM;IACb,CAAC,EAAM,MAAM;IACb,EAAE,EAAK,MAAM;CACb,CAAC;AAGF,gBAAgB;AAChB,kCAAkC;AAClC,MAAM,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAChC,oCAAoC;AAGpC;;;;;;;;;;;GAWG;AACH,SAAS,SAAS,CAChB,GAAe,EACf,GAAe;IAEhB,wEAAwE;IACxE,qDAAqD;IACrD,MAAM,GAAG,GAAG,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,GAAG,GAAG,CAAC,CAAC;IACxB,MAAM,MAAM,GAAI,GAAG,GAAG,CAAC,CAAC;IAExB,uDAAuD;IACvD,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC;IAC9B,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC;IAC9B,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAC3B,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG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|
+
import { eAdd, eEstimate, eMult, eNegativeOf, twoDiff } from 'big-float-ts';
|
|
2
2
|
import { dot } from "flo-vector2d";
|
|
3
3
|
import { compareCurvaturesAtInterface } from "./compare-curvatures-at-interface.js";
|
|
4
4
|
/**
|
|
@@ -32,31 +32,6 @@ function getInterfaceCcw(psI, psO) {
|
|
|
32
32
|
const p1 = psO[0];
|
|
33
33
|
// second control point of outgoing curve
|
|
34
34
|
const p2 = psO[1];
|
|
35
|
-
/*
|
|
36
|
-
if (typeof _bez_debug_ !== 'undefined') {
|
|
37
|
-
let maxBitLength = 25;
|
|
38
|
-
let p1_ = psI[lenI-1];
|
|
39
|
-
// ---- precondition: does endpoints coincide
|
|
40
|
-
if (p1_[0] !== p1[0] || p1_[1] !== p1[1]) {
|
|
41
|
-
throw new Error('Curve endpoints must coincide.');
|
|
42
|
-
}
|
|
43
|
-
// ---- precondition: are coordinates grid-aligned
|
|
44
|
-
// Get all coordinate values into an array
|
|
45
|
-
let xs: number[] = [];
|
|
46
|
-
[psI, psO].forEach(ps => ps.forEach(p => p.forEach(x => {
|
|
47
|
-
xs.push(x);
|
|
48
|
-
})));
|
|
49
|
-
|
|
50
|
-
let msb = xs.reduce((prevX, x) => Math.max(prevX, msbExponent(x)), Number.NEGATIVE_INFINITY);
|
|
51
|
-
let lsb = xs.reduce((prevX, x) => Math.min(prevX, lsbExponent(x)), Number.POSITIVE_INFINITY);
|
|
52
|
-
let bitlengthAll = msb - lsb + 1;
|
|
53
|
-
if (bitlengthAll > maxBitLength) {
|
|
54
|
-
throw new Error(
|
|
55
|
-
`Curve control point coordinates must be bit-aligned and <= ${maxBitLength}. bitlength === ${bitlengthAll}, coordinates: ${xs}`
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
*/
|
|
60
35
|
// Max one bit can be added in the calculations below due to bit-alignment
|
|
61
36
|
const xE = p1[0] - p0[0]; // tangent x-coordinate
|
|
62
37
|
const yE = p1[1] - p0[1]; // tangent y-coordinate
|
|
@@ -68,17 +43,13 @@ function getInterfaceCcw(psI, psO) {
|
|
|
68
43
|
const tangentAtEnd = [xE, yE];
|
|
69
44
|
// (non-normalized) tangent of outgoing curve at t === 0
|
|
70
45
|
const tangentAtStart = [xS, yS];
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
// If the preconditions are met it is exact
|
|
74
|
-
//let crossTangents = cross(tangentAtEnd, tangentAtStart);
|
|
75
|
-
// The cross below is exact by adaptive infinite precision
|
|
76
|
-
const crossTangents = orient2d(p0, p1, p2);
|
|
46
|
+
// const crossTangents = orient2d(p0, p1, p2);
|
|
47
|
+
const crossTangents = orient2dPrecise(p0, p1, p2);
|
|
77
48
|
if (crossTangents !== 0) {
|
|
78
49
|
return crossTangents;
|
|
79
50
|
}
|
|
80
51
|
// The dot calculated below will have a max bitlength of
|
|
81
|
-
// (2*(maxBitLength+1))+1 === e.g. (2*(25+1)) + 1 === 53
|
|
52
|
+
// (2*(maxBitLength + 1)) + 1 === e.g. (2*(25 + 1)) + 1 === 53
|
|
82
53
|
// If the preconditions are met it is exact
|
|
83
54
|
const dotTangents = dot(tangentAtEnd, tangentAtStart);
|
|
84
55
|
if (dotTangents > 0) {
|
|
@@ -94,5 +65,19 @@ function getInterfaceCcw(psI, psO) {
|
|
|
94
65
|
// Look at curvature
|
|
95
66
|
return compareCurvaturesAtInterface(psI.slice().reverse(), psO);
|
|
96
67
|
}
|
|
68
|
+
/** Returns the cross from A to B to C */
|
|
69
|
+
function orient2dPrecise(A, B, C) {
|
|
70
|
+
// const detleft = (A[0] - C[0]) * (B[1] - C[1]);
|
|
71
|
+
// const detright = (A[1] - C[1]) * (B[0] - C[0]);
|
|
72
|
+
// const det = detleft - detright;
|
|
73
|
+
const a = twoDiff(A[0], C[0]);
|
|
74
|
+
const b = twoDiff(B[1], C[1]);
|
|
75
|
+
const c = twoDiff(A[1], C[1]);
|
|
76
|
+
const d = twoDiff(B[0], C[0]);
|
|
77
|
+
const e = eMult(a, b);
|
|
78
|
+
const f = eMult(c, d);
|
|
79
|
+
const g = eAdd(e, eNegativeOf(f));
|
|
80
|
+
return eEstimate(g);
|
|
81
|
+
}
|
|
97
82
|
export { getInterfaceCcw };
|
|
98
83
|
//# sourceMappingURL=get-interface-ccw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-interface-ccw.js","sourceRoot":"","sources":["../../src/corner/get-interface-ccw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAsB,OAAO,EAAE,MAAM,cAAc,CAAC;AAChG,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAGpF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,6DAA6D;AAC7D,SAAS,eAAe,CAAC,GAAe,EAAE,GAAe;IACrD,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC;IAExB,8CAA8C;IAC9C,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,GAAC,CAAC,CAAC,CAAC;IACvB,yEAAyE;IACzE,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAClB,yCAAyC;IACzC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAElB,0EAA0E;IAC1E,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,uBAAuB;IACrD,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,uBAAuB;IAClD,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,uBAAuB;IAC/C,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,C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AC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE7B,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IACrB,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;IAErB,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;AACxB,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
package/node/cp-node/clone.d.ts
CHANGED
package/node/cp-node/clone.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/** @
|
|
1
|
+
import { createCpNode } from "./create-cp-node.js";
|
|
2
|
+
/** @internal */
|
|
3
3
|
const EDGES = ['prev', 'next', 'prevOnCircle', 'nextOnCircle'];
|
|
4
4
|
/**
|
|
5
5
|
* Returns a deep clone of this [[CpNode]]. Can be used to copy the MAT
|
|
@@ -10,7 +10,8 @@ function clone(cpNode) {
|
|
|
10
10
|
// Don't change this function to be recursive, the call stack may
|
|
11
11
|
// overflow if there are too many CpNodes.
|
|
12
12
|
const nodeMap = new Map();
|
|
13
|
-
const newCpNode = new CpNode(cpNode.cp, cpNode.isHoleClosing, cpNode.isIntersection);
|
|
13
|
+
// const newCpNode = new CpNode(cpNode.cp, cpNode.isHoleClosing, cpNode.isIntersection);
|
|
14
|
+
const newCpNode = createCpNode(cpNode.cp, cpNode.isHoleClosing, cpNode.isIntersection);
|
|
14
15
|
nodeMap.set(cpNode, newCpNode);
|
|
15
16
|
const cpStack = [{ cpNode, newCpNode }];
|
|
16
17
|
while (cpStack.length) {
|
|
@@ -19,7 +20,8 @@ function clone(cpNode) {
|
|
|
19
20
|
const node = cpNode[edge];
|
|
20
21
|
let newNode = nodeMap.get(node);
|
|
21
22
|
if (!newNode) {
|
|
22
|
-
newNode = new CpNode(node.cp, node.isHoleClosing, node.isIntersection);
|
|
23
|
+
// newNode = new CpNode(node.cp, node.isHoleClosing, node.isIntersection);
|
|
24
|
+
newNode = createCpNode(node.cp, node.isHoleClosing, node.isIntersection);
|
|
23
25
|
nodeMap.set(node, newNode);
|
|
24
26
|
cpStack.push({ cpNode: node, newCpNode: newNode });
|
|
25
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clone.js","sourceRoot":"","sources":["../../src/cp-node/clone.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clone.js","sourceRoot":"","sources":["../../src/cp-node/clone.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAUnD,gBAAgB;AAChB,MAAM,KAAK,GAAW,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;AAGvE;;;;GAIG;AACH,SAAS,KAAK,CAAC,MAAc;IACzB,kEAAkE;IAClE,0CAA0C;IAE1C,MAAM,OAAO,GAAwB,IAAI,GAAG,EAAE,CAAC;IAE/C,wFAAwF;IACxF,MAAM,SAAS,GAAG,YAAY,CAC1B,MAAM,CAAC,EAAE,EACT,MAAM,CAAC,aAAa,EACpB,MAAM,CAAC,cAAc,CACxB,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC/B,MAAM,OAAO,GAAG,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAExC,OAAO,OAAO,CAAC,MAAM,EAAE;QACnB,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,GAAG,EAAG,CAAC;QAE7C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;YACtB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;YAC1B,IAAI,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAChC,IAAI,CAAC,OAAO,EAAE;gBACV,0EAA0E;gBAC1E,OAAO,GAAG,YAAY,CAClB,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,cAAc,CACtB,CAAC;gBACF,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBAC3B,OAAO,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;aACrD;YACD,SAAS,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;SAC7B;KACJ;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAGD,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
+
import { ContactPoint } from '../contact-point/contact-point.js';
|
|
3
|
+
import { removeCpNode } from './remove.js';
|
|
4
|
+
/**
|
|
5
|
+
* The primary interface of the library.
|
|
6
|
+
*
|
|
7
|
+
* Since the MAT is a full representation of the shape boundary an instance of
|
|
8
|
+
* this class contains both the information of a boundary point and a medial
|
|
9
|
+
* axis point (and edge to the next point(s)). It also contains edges to other
|
|
10
|
+
* [[CpNode]]s which allows for traversal of the MAT and thus implictly
|
|
11
|
+
* represents the entire MAT.
|
|
12
|
+
*
|
|
13
|
+
* To get the maximal disk circle (of which the center is on the medial axis)
|
|
14
|
+
* use [[cp]].circle.
|
|
15
|
+
*
|
|
16
|
+
* To get the boundary point, use [[cp]].pointOnShape.
|
|
17
|
+
*
|
|
18
|
+
* The edge [[next]] (resp. [[prev]]) allows one to move anti-clockwise (resp.
|
|
19
|
+
* clockwise) on the shape boundary to the next [[CpNode]]. This also imposes a
|
|
20
|
+
* direction of traversal of the MAT edges and vertices.
|
|
21
|
+
*
|
|
22
|
+
* The edge [[nextOnCircle]] (resp. [[prevOnCircle]]) allows one to go
|
|
23
|
+
* anti-clockwise (resp. clockwise) around the maximal disks implied by
|
|
24
|
+
* the CpNode to the next maximal disk contact point. This is equivalent to
|
|
25
|
+
* following other branches on the MAT.
|
|
26
|
+
*
|
|
27
|
+
* Call [[getCurveBetween]](cpNodeFrom, cpNodeTo) or getCurveToNext(cpNode)
|
|
28
|
+
* (replacing the older CpNode.[[matCurveToNextVertex]]) to get a bezier curve
|
|
29
|
+
* from the maximal disk of this [[CpNode]] to the next [[CpNode]]'s
|
|
30
|
+
* maximal disk and thus directly representing a piece of the medial axis.
|
|
31
|
+
*
|
|
32
|
+
* The function, [[getChildren]], returns the children of this [[CpNode]] when
|
|
33
|
+
* seen as a MAT edge. Only children in a 'forward' direction are returned. These
|
|
34
|
+
* include all edges except the 'backward' edge given by [[prevOnCircle]]. For
|
|
35
|
+
* [[CpNode]]s having a maximal disk with 2 contact points (a 2-prong, the usual
|
|
36
|
+
* case) the children will be the single edge [[next]]. For a 3-prong this will
|
|
37
|
+
* be the edges [[next]] and [[nextOnCircle]], etc. [[getChildren]] allows one to
|
|
38
|
+
* easily traverse the MAT tree - see e.g. the implementation of [[traverseEdges]].
|
|
39
|
+
*
|
|
40
|
+
* The getter, [[vertexChildren]], is similar to [[getChildren]] but returns the
|
|
41
|
+
* child nodes of the tree when [[CpNode]] is seen as a MAT vertex point (as
|
|
42
|
+
* opposed to edge). In this way the dual graph of the tree can easily be
|
|
43
|
+
* traversed - see e.g. [[traverseVertices]]. Generally, however, traversing the
|
|
44
|
+
* edges is preferred as it returns the entire Medial Axis (by utilizing
|
|
45
|
+
* [[getCurveToNext]] on each returned edge).
|
|
46
|
+
*
|
|
47
|
+
* It may be worth mentioning that by traversing from the CpNode by following
|
|
48
|
+
* [[next]] repeatedly until one is back at the same CpNode allows one
|
|
49
|
+
* to 'go around' the shape boundary and at the same time traverse the MAT twice
|
|
50
|
+
* in opposite directions.
|
|
51
|
+
*/
|
|
52
|
+
interface CpNode {
|
|
53
|
+
/** The shape boundary contact point, i.e. a [[CpNode]] without its edges. */
|
|
54
|
+
cp: ContactPoint;
|
|
55
|
+
/** If true, this [[CpNode]] belongs to a hole-closing maximal disk. */
|
|
56
|
+
isHoleClosing: boolean;
|
|
57
|
+
/** true if this cpNode is at a shape boundary intersection point, false otherwise */
|
|
58
|
+
isIntersection: boolean;
|
|
59
|
+
/** The previous (going clockwise around the boundary) contact point ([[CpNode]]).*/
|
|
60
|
+
prev: CpNode;
|
|
61
|
+
/** The next (going anti-clockwise around the boundary) contact point ([[CpNode]]). */
|
|
62
|
+
next: CpNode;
|
|
63
|
+
/**
|
|
64
|
+
* The previous [[CpNode]] (going clockwise around the inscribed circle
|
|
65
|
+
* defined by the maximal disk).
|
|
66
|
+
*/
|
|
67
|
+
prevOnCircle: CpNode;
|
|
68
|
+
/**
|
|
69
|
+
* The next [[CpNode]] (going anti-clockwise around
|
|
70
|
+
* the inscribed circle defined by the maximal disk).
|
|
71
|
+
*/
|
|
72
|
+
nextOnCircle: CpNode;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Returns the bezier curve from the maximal disk of this [[CpNode]] to the
|
|
76
|
+
* next [[CpNode]]'s maximal disk and thus directly represents a piece of the
|
|
77
|
+
* medial axis.
|
|
78
|
+
* @deprecated Use [[getCurveToNext]] instead
|
|
79
|
+
* @param cpNode
|
|
80
|
+
*/
|
|
81
|
+
declare function matCurveToNextVertex(cpNode: CpNode): number[][];
|
|
82
|
+
/**
|
|
83
|
+
* Primarily for internal use.
|
|
84
|
+
*
|
|
85
|
+
* Compares the order of two [[CpNode]]s. The order is cyclic and depends
|
|
86
|
+
* on a [[CpNode]]'s relative position along the shape boundary.
|
|
87
|
+
*/
|
|
88
|
+
declare const cpNodeComparator: (a: CpNode, b: CpNode) => number;
|
|
89
|
+
/**
|
|
90
|
+
* Returns the children of this [[CpNode]] when seen as a MAT edge. Only
|
|
91
|
+
* children in a 'forward' direction are returned. These include all edges
|
|
92
|
+
* except the 'backward' edge given by [[prevOnCircle]], even terminating
|
|
93
|
+
* edges.
|
|
94
|
+
*/
|
|
95
|
+
declare function getChildren(cpNode: CpNode): CpNode[];
|
|
96
|
+
/**
|
|
97
|
+
* Similar to [[getChildren]] but returns the child nodes of the tree when
|
|
98
|
+
* [[CpNode]] is seen as a MAT vertex point (as opposed to edge). In this
|
|
99
|
+
* way the dual graph of the tree can easily be traversed - see e.g.
|
|
100
|
+
* [[traverseVertices]]. Generally, however, traversing the edges is
|
|
101
|
+
* preferred as it returns the entire Medial Axis (by utilizing
|
|
102
|
+
* [[getCurveToNext]] on each returned edge).
|
|
103
|
+
*/
|
|
104
|
+
declare function vertexChildren(cpNode: CpNode): CpNode[];
|
|
105
|
+
/**
|
|
106
|
+
* Returns all [[CpNode]]s on the MAT that this [[CpNode]] is part of
|
|
107
|
+
* starting from the current one and going anti-clockwise around the shape.
|
|
108
|
+
*/
|
|
109
|
+
declare function getAllOnLoop(cpNode: CpNode): CpNode[];
|
|
110
|
+
/**
|
|
111
|
+
* Primarily for internal use.
|
|
112
|
+
*
|
|
113
|
+
* Insert a [[CpNode]] into the MAT tree graph after the specified point
|
|
114
|
+
* and returns the freshly inserted [[CpNode]].
|
|
115
|
+
* @param isHoleClosing True if this is a hole closing contact point.
|
|
116
|
+
* @param isIntersection True if this is a contact point at a shape boundary
|
|
117
|
+
* intersection point.
|
|
118
|
+
* @param cpTree The tree graph holding the [[CpNodes]] of the MAT.
|
|
119
|
+
* @param cp [[ContactPoint]] defining the [[CpNode]].
|
|
120
|
+
* @param prev_ Inserts the new [[CpNode]] right after this item if the
|
|
121
|
+
* loop is not empty, else insert the new [[CpNode]] as the only item in the
|
|
122
|
+
* loop.
|
|
123
|
+
*/
|
|
124
|
+
declare function insertCpNode(isHoleClosing: boolean, isIntersection: boolean, cpTree: LlRbTree<CpNode>, cp: ContactPoint, prev_: CpNode): CpNode;
|
|
125
|
+
/**
|
|
126
|
+
* Return this (except if exclThis is truthy) and the the other CpNodes
|
|
127
|
+
* around the maximal disk vertex circle in an anti-clockwise order.
|
|
128
|
+
* @param exclThis If true the returned array does not include this
|
|
129
|
+
* [[CpNode]].
|
|
130
|
+
*/
|
|
131
|
+
declare function getCpNodesOnCircle(cpNode: CpNode, exclThis?: boolean): CpNode[];
|
|
132
|
+
/**
|
|
133
|
+
* Returns true if the 2 given [[CpNode]]s are on the same maximal disk
|
|
134
|
+
* circle.
|
|
135
|
+
* @param cpNode1 A [[CpNode]].
|
|
136
|
+
* @param cpNode2 Another [[CpNode]]
|
|
137
|
+
*/
|
|
138
|
+
declare function isOnSameCircle(cpNode1: CpNode, cpNode2: CpNode): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Returns true if this [[CpNode]] is terminating, i.e. implies a leaf MAT
|
|
141
|
+
* vertex.
|
|
142
|
+
*
|
|
143
|
+
* This is always the case for sharp corners and maximal disks with
|
|
144
|
+
* a single contact point. Note, however, that even in these cases there are
|
|
145
|
+
* two contact points stored (sitting 'on top' of each other) for the
|
|
146
|
+
* maximal disk. It can be seen as a limiting case of a two-prong where the
|
|
147
|
+
* distance between two of the contact points tend to zero. One point
|
|
148
|
+
* (represented by a [[CpNode]] of course) will be terminating with the
|
|
149
|
+
* other point being its [[next]], whereas the other point will *not* be
|
|
150
|
+
* terminating and 'points' back into the shape.
|
|
151
|
+
*/
|
|
152
|
+
declare function isTerminating(cpNode: CpNode): boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Like isTerminating() but only returns true if all cpNodes on the circle
|
|
155
|
+
* (except this.prevOnCircle) is terminating.
|
|
156
|
+
*/
|
|
157
|
+
declare function isFullyTerminating(cpNode: CpNode): boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Returns the first [[CpNode]] (from this one by successively applying
|
|
160
|
+
* .nextOnCircle) that exits the circle.
|
|
161
|
+
*/
|
|
162
|
+
declare function getFirstExit(cpNode: CpNode): CpNode | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* Returns true if this [[CpNode]] represents a sharp corner, i.e. the
|
|
165
|
+
* limiting case of a two-prong having zero radius.
|
|
166
|
+
*
|
|
167
|
+
* Note that two [[CpNode]]s are stored for each sharp corner, one being
|
|
168
|
+
* terminating and one not. See [[isTerminating]] for more details.
|
|
169
|
+
*/
|
|
170
|
+
declare function isSharp(cpNode: CpNode): boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Returns the number of contact points on the maximal disk circle implied
|
|
173
|
+
* by this [[CpNode]].
|
|
174
|
+
*
|
|
175
|
+
* Note, however, that even one-prongs and sharp corners will return 2 (see
|
|
176
|
+
* [[isTerminating]] for more details); if this is not desired use
|
|
177
|
+
* [[getRealProngCount]] instead which will return 1 in these cases.
|
|
178
|
+
*/
|
|
179
|
+
declare function getProngCount(cpNode: CpNode): number;
|
|
180
|
+
/**
|
|
181
|
+
* Returns the number of contact points (up to planar coordinates) on the
|
|
182
|
+
* maximal disk circle implied by this [[CpNode]].
|
|
183
|
+
*
|
|
184
|
+
* See also [[getProngCount]].
|
|
185
|
+
*/
|
|
186
|
+
declare function getRealProngCount(cpNode: CpNode): number;
|
|
187
|
+
/**
|
|
188
|
+
* Returns true if this [[CpNode]]'s maximal disk has only one contact point
|
|
189
|
+
* on the shape boundary (up to planar coordinates). These includes sharp
|
|
190
|
+
* corners.
|
|
191
|
+
*
|
|
192
|
+
* Note, however, that two [[CpNode]]s are stored for each such point to
|
|
193
|
+
* preserve symmetry - see [[isTerminating]] for more details.
|
|
194
|
+
*/
|
|
195
|
+
declare function isOneProng(cpNode: CpNode): boolean;
|
|
196
|
+
export { CpNode, matCurveToNextVertex, getChildren, vertexChildren, getAllOnLoop, insertCpNode, getCpNodesOnCircle, isOnSameCircle, isTerminating, isFullyTerminating, getFirstExit, isSharp, isOneProng, getProngCount, getRealProngCount, cpNodeComparator, removeCpNode };
|