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
|
-
/** @
|
|
1
|
+
/** @internal */
|
|
2
2
|
import { circumCenter } from 'flo-vector2d';
|
|
3
|
-
import {
|
|
3
|
+
import { getCloseBoundaryPointsCertified } from '../closest-boundary-point/get-close-boundary-points-certified.js';
|
|
4
4
|
/**
|
|
5
|
-
* @
|
|
5
|
+
* @internal
|
|
6
6
|
* Finds an initial 3-prong circle center point from which to iterate. The point
|
|
7
7
|
* must be within the shape.
|
|
8
8
|
* @param δ3s - The three boundary pieces of which we need to find the three
|
|
@@ -12,12 +12,10 @@ import { getClosestBoundaryPoint } from '../../closest-boundary-point/get-closes
|
|
|
12
12
|
*/
|
|
13
13
|
function calcInitial3ProngCenter(δ3s, bezierPiece3s) {
|
|
14
14
|
const twoProngCircleCenter = δ3s[0][0].cp.circle.center;
|
|
15
|
-
const
|
|
16
|
-
undefined // t
|
|
17
|
-
);
|
|
15
|
+
const pos = getCloseBoundaryPointsCertified(bezierPiece3s[1], twoProngCircleCenter)[0];
|
|
18
16
|
const meanPoints = [
|
|
19
17
|
δ3s[0][0].cp.pointOnShape.p,
|
|
20
|
-
|
|
18
|
+
pos.p,
|
|
21
19
|
δ3s[2][1].cp.pointOnShape.p,
|
|
22
20
|
];
|
|
23
21
|
return circumCenter(meanPoints);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calc-initial-3-prong-center.js","sourceRoot":"","sources":["../../src/find-3-prong.ts/calc-initial-3-prong-center.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,+BAA+B,EAAE,MAAM,kEAAkE,CAAC;AAInH;;;;;;;;GAQG;AACH,SAAS,uBAAuB,CACxB,GAAe,EACf,aAA8B;IAElC,MAAM,oBAAoB,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;IAExD,MAAM,GAAG,GAAG,+BAA+B,CACvC,aAAa,CAAC,CAAC,CAAC,EAChB,oBAAoB,CACvB,CAAC,CAAC,CAAC,CAAC;IAEL,MAAM,UAAU,GAAG;QACf,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;QAC3B,GAAG,CAAC,CAAC;QACL,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;KAC9B,CAAC;IAEF,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;AACpC,CAAC;AAGD,OAAO,EAAE,uBAAuB,EAAE,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CpNode } from '
|
|
2
|
-
import { BezierPiece } from '
|
|
3
|
-
import {
|
|
1
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
2
|
+
import { BezierPiece } from '../mat/bezier-piece.js';
|
|
3
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
4
4
|
/**
|
|
5
|
-
* @
|
|
5
|
+
* @internal
|
|
6
6
|
* Finds a 3-prong using only the 3 given δs.
|
|
7
7
|
* @param δs The boundary pieces
|
|
8
8
|
* @param idx δ identifier
|
|
@@ -11,12 +11,12 @@ import { IPointOnShape } from '../../../point-on-shape.js';
|
|
|
11
11
|
* tolerances.
|
|
12
12
|
*/
|
|
13
13
|
declare function find3ProngForDelta3s(δs: CpNode[][], idx: number, k: number, bezierPiecess: BezierPiece[][], extreme: number): {
|
|
14
|
-
ps:
|
|
14
|
+
ps: (PointOnShape | undefined)[];
|
|
15
15
|
circle: {
|
|
16
16
|
center: number[];
|
|
17
17
|
radius: number;
|
|
18
18
|
};
|
|
19
19
|
error: number;
|
|
20
20
|
δ3s: CpNode[][];
|
|
21
|
-
};
|
|
21
|
+
} | undefined;
|
|
22
22
|
export { find3ProngForDelta3s };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { fromTo, circumCenter, len, distanceBetween, toUnitVector, rotate90Degrees, cross } from 'flo-vector2d';
|
|
2
2
|
import { tangent } from 'flo-bezier3';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { isSharp } from '../cp-node/cp-node.js';
|
|
4
|
+
import { isPosDullCorner } from '../point-on-shape/is-pos-dull-corner.js';
|
|
5
5
|
import { calcInitial3ProngCenter } from './calc-initial-3-prong-center.js';
|
|
6
6
|
import { getClosestPoints } from './get-closest-points.js';
|
|
7
7
|
import { calcBetterX } from './calc-better-x.js';
|
|
8
|
-
import { getCornerAtEnd } from '
|
|
9
|
-
|
|
8
|
+
import { getCornerAtEnd } from '../curve/curve.js';
|
|
9
|
+
import { getCloseBoundaryPointsCertified } from '../closest-boundary-point/get-close-boundary-points-certified.js';
|
|
10
|
+
/** @internal */
|
|
10
11
|
const calcVectorToZeroV_StraightToIt = fromTo;
|
|
11
12
|
/**
|
|
12
|
-
* @
|
|
13
|
+
* @internal
|
|
13
14
|
* Finds a 3-prong using only the 3 given δs.
|
|
14
15
|
* @param δs The boundary pieces
|
|
15
16
|
* @param idx δ identifier
|
|
@@ -18,7 +19,7 @@ const calcVectorToZeroV_StraightToIt = fromTo;
|
|
|
18
19
|
* tolerances.
|
|
19
20
|
*/
|
|
20
21
|
function find3ProngForDelta3s(δs, idx, k, bezierPiecess, extreme) {
|
|
21
|
-
const TOLERANCE =
|
|
22
|
+
const TOLERANCE = 2 ** -32 * extreme;
|
|
22
23
|
const MAX_ITERATIONS = 10;
|
|
23
24
|
const δs_ = [
|
|
24
25
|
δs[0],
|
|
@@ -42,7 +43,7 @@ function find3ProngForDelta3s(δs, idx, k, bezierPiecess, extreme) {
|
|
|
42
43
|
];
|
|
43
44
|
const δ3s = δ3ss[k];
|
|
44
45
|
const bezierPiece3s = bezierPiecess_[k];
|
|
45
|
-
if (δ3s[0][0]
|
|
46
|
+
if (isSharp(δ3s[0][0])) {
|
|
46
47
|
return undefined;
|
|
47
48
|
}
|
|
48
49
|
let ps;
|
|
@@ -107,9 +108,7 @@ function find3ProngForDelta3s(δs, idx, k, bezierPiecess, extreme) {
|
|
|
107
108
|
//-----------------------------------
|
|
108
109
|
// Check if point is on dull crorner
|
|
109
110
|
//-----------------------------------
|
|
110
|
-
//if (PointOnShape.isDullCorner(p)) {
|
|
111
111
|
if (isPosDullCorner(p)) {
|
|
112
|
-
//const corner = Curve.getCornerAtEnd(p.curve);
|
|
113
112
|
const corner = getCornerAtEnd(p.curve);
|
|
114
113
|
const tans = corner.tangents;
|
|
115
114
|
const perps = tans.map(rotate90Degrees);
|
|
@@ -145,8 +144,8 @@ function find3ProngForDelta3s(δs, idx, k, bezierPiecess, extreme) {
|
|
|
145
144
|
//-------------------------------------------------------------------------
|
|
146
145
|
const closestDs = [];
|
|
147
146
|
for (let i = 0; i < bezierPiecess.length; i++) {
|
|
148
|
-
const p =
|
|
149
|
-
closestDs.push(distanceBetween(p.
|
|
147
|
+
const p = getCloseBoundaryPointsCertified(bezierPiecess[i], x)[0];
|
|
148
|
+
closestDs.push(distanceBetween(p.p, x));
|
|
150
149
|
}
|
|
151
150
|
const closestD = Math.min(...closestDs);
|
|
152
151
|
const radiusDelta = Math.abs(radius - closestD);
|
|
@@ -154,7 +153,7 @@ function find3ProngForDelta3s(δs, idx, k, bezierPiecess, extreme) {
|
|
|
154
153
|
const W1 = 1;
|
|
155
154
|
const W2 = 1;
|
|
156
155
|
const error = W1 * radiusDelta + W2 * totalAngleError;
|
|
157
|
-
return { ps, circle, error, δ3s };
|
|
156
|
+
return { ps: ps, circle, error, δ3s };
|
|
158
157
|
}
|
|
159
158
|
export { find3ProngForDelta3s };
|
|
160
159
|
//# sourceMappingURL=find-3-prong-for-delta3s.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-3-prong-for-delta3s.js","sourceRoot":"","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AAC,CAAC,EAAE,CAAC,GAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,MAAM,CAAC,GAAG,+BAA+B,CACrC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CACtB,CAAC,CAAC,CAAC,CAAC;QAEL,SAAS,CAAC,IAAI,CAAE,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAE,CAAC;KAC7C;IACD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC;IACxC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC;IAEhD,4CAA4C;IAC5C,MAAM,EAAE,GAAG,CAAC,CAAC;IACb,MAAM,EAAE,GAAG,CAAC,CAAC;IACb,MAAM,KAAK,GAAG,EAAE,GAAC,WAAW,GAAG,EAAE,GAAC,eAAe,CAAC;IAElD,OAAO,EAAE,EAAE,EAAE,EAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;AAC3C,CAAC;AAGD,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CpNode } from '
|
|
2
|
-
import { Circle } from '
|
|
3
|
-
import {
|
|
1
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
2
|
+
import { Circle } from '../geometry/circle.js';
|
|
3
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
4
4
|
/**
|
|
5
|
-
* @
|
|
5
|
+
* @internal
|
|
6
6
|
* Find and return a 3-prong from the given boundary piece.
|
|
7
7
|
* @param δs A boundary piece
|
|
8
8
|
* @param extreme The maximum coordinate value used to calculate floating point
|
|
@@ -10,7 +10,7 @@ import { IPointOnShape } from '../../../point-on-shape.js';
|
|
|
10
10
|
*/
|
|
11
11
|
declare function find3Prong(δs: CpNode[][], extreme: number): {
|
|
12
12
|
circle: Circle;
|
|
13
|
-
ps:
|
|
13
|
+
ps: PointOnShape[];
|
|
14
14
|
δ3s: CpNode[][];
|
|
15
15
|
};
|
|
16
16
|
export { find3Prong };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { fromTo } from 'flo-bezier3';
|
|
2
|
-
import { createEmptyThreeProngForDebugging } from '
|
|
2
|
+
import { createEmptyThreeProngForDebugging } from '../debug/three-prong-for-debugging.js';
|
|
3
3
|
import { find3ProngForDelta3s } from './find-3-prong-for-delta3s.js';
|
|
4
|
-
import { getBoundaryPieceBeziers } from '
|
|
4
|
+
import { getBoundaryPieceBeziers } from '../mat/get-boundary-piece-beziers.js';
|
|
5
5
|
/**
|
|
6
|
-
* @
|
|
6
|
+
* @internal
|
|
7
7
|
* Find and return a 3-prong from the given boundary piece.
|
|
8
8
|
* @param δs A boundary piece
|
|
9
9
|
* @param extreme The maximum coordinate value used to calculate floating point
|
|
@@ -11,26 +11,7 @@ import { getBoundaryPieceBeziers } from '../../get-boundary-piece-beziers.js';
|
|
|
11
11
|
*/
|
|
12
12
|
function find3Prong(δs, extreme) {
|
|
13
13
|
const bezierPiecess = δs.map(getBoundaryPieceBeziers);
|
|
14
|
-
|
|
15
|
-
const threeProngs = _debug_.generated.elems.threeProng;
|
|
16
|
-
threeProngs.push(createEmptyThreeProngForDebugging());
|
|
17
|
-
const d = threeProngs[threeProngs.length - 1];
|
|
18
|
-
d.boundaries = [];
|
|
19
|
-
for (const bezierPieces of bezierPiecess) {
|
|
20
|
-
const boundary = [];
|
|
21
|
-
d.boundaries.push(boundary);
|
|
22
|
-
for (const bezierPiece of bezierPieces) {
|
|
23
|
-
/* qqq
|
|
24
|
-
let bezier = fromTo(bezierPiece.curve.ps)(
|
|
25
|
-
bezierPiece.ts[0], bezierPiece.ts[1]
|
|
26
|
-
);
|
|
27
|
-
*/
|
|
28
|
-
const bezier = fromTo(bezierPiece.curve.ps, bezierPiece.ts[0], bezierPiece.ts[1]);
|
|
29
|
-
boundary.push(bezier);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
d.traces = [];
|
|
33
|
-
}
|
|
14
|
+
addDebugInfo1(bezierPiecess);
|
|
34
15
|
const candidateThreeProngs = [];
|
|
35
16
|
// The best candidate amongst the different 'permutations' of the given δs.
|
|
36
17
|
let threeProng;
|
|
@@ -38,40 +19,72 @@ function find3Prong(δs, extreme) {
|
|
|
38
19
|
let smallestError = Number.POSITIVE_INFINITY;
|
|
39
20
|
for (let i = 1; i < δs.length - 1; i++) {
|
|
40
21
|
for (let k = 0; k < 3; k++) {
|
|
41
|
-
|
|
42
|
-
const threeProngs = _debug_.generated.elems.threeProng;
|
|
43
|
-
const d = threeProngs[threeProngs.length - 1];
|
|
44
|
-
const trace = [];
|
|
45
|
-
d.traces.push(trace);
|
|
46
|
-
}
|
|
22
|
+
addDebugInfo2();
|
|
47
23
|
const threeProngInfo = find3ProngForDelta3s(δs, i, k, bezierPiecess, extreme);
|
|
48
24
|
if (!threeProngInfo) {
|
|
49
25
|
continue;
|
|
50
26
|
}
|
|
51
|
-
const { circle, ps, error, δ3s } = threeProngInfo;
|
|
52
|
-
|
|
53
|
-
candidateThreeProngs.push({ circle, ps });
|
|
54
|
-
}
|
|
27
|
+
const { circle, ps: poss, error, δ3s } = threeProngInfo;
|
|
28
|
+
addDebugInfo3(candidateThreeProngs, circle, poss);
|
|
55
29
|
if (error < smallestError) {
|
|
56
30
|
smallestError = error;
|
|
57
31
|
bestIndx = i - 1;
|
|
58
|
-
threeProng = { circle, ps, δ3s };
|
|
32
|
+
threeProng = { circle, ps: poss, δ3s };
|
|
59
33
|
}
|
|
60
34
|
}
|
|
61
35
|
}
|
|
62
|
-
|
|
36
|
+
addDebugInfo4(threeProng, δs, bestIndx, candidateThreeProngs);
|
|
37
|
+
return threeProng;
|
|
38
|
+
}
|
|
39
|
+
function addDebugInfo2() {
|
|
40
|
+
if (typeof _debug_ !== 'undefined') {
|
|
41
|
+
const threeProngs = _debug_.generated.elems.threeProng;
|
|
42
|
+
const d = threeProngs[threeProngs.length - 1];
|
|
43
|
+
const trace = [];
|
|
44
|
+
d.traces.push(trace);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function addDebugInfo3(candidateThreeProngs, circle, ps) {
|
|
48
|
+
if (typeof _debug_ !== 'undefined') {
|
|
49
|
+
candidateThreeProngs.push({ circle, ps });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function addDebugInfo4(threeProng, δs, bestIndx, candidateThreeProngs) {
|
|
63
53
|
if (typeof _debug_ !== 'undefined') {
|
|
64
54
|
const threeProngs = _debug_.generated.elems.threeProng;
|
|
65
55
|
const d = threeProngs[threeProngs.length - 1];
|
|
66
56
|
d.generated = _debug_.generated;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
57
|
+
if (threeProng !== undefined) {
|
|
58
|
+
d.circle = threeProng.circle;
|
|
59
|
+
d.poss = threeProng.ps;
|
|
60
|
+
d.cp3ss = threeProng.δ3s;
|
|
61
|
+
}
|
|
70
62
|
d.cpss = δs;
|
|
71
63
|
d.bestIndx = bestIndx;
|
|
72
64
|
d.candidateThreeProngs = candidateThreeProngs;
|
|
73
65
|
}
|
|
74
|
-
|
|
66
|
+
}
|
|
67
|
+
function addDebugInfo1(bezierPiecess) {
|
|
68
|
+
if (typeof _debug_ !== 'undefined') {
|
|
69
|
+
const threeProngs = _debug_.generated.elems.threeProng;
|
|
70
|
+
threeProngs.push(createEmptyThreeProngForDebugging());
|
|
71
|
+
const d = threeProngs[threeProngs.length - 1];
|
|
72
|
+
d.boundaries = [];
|
|
73
|
+
for (const bezierPieces of bezierPiecess) {
|
|
74
|
+
const boundary = [];
|
|
75
|
+
d.boundaries.push(boundary);
|
|
76
|
+
for (const bezierPiece of bezierPieces) {
|
|
77
|
+
/* qqq
|
|
78
|
+
let bezier = fromTo(bezierPiece.curve.ps)(
|
|
79
|
+
bezierPiece.ts[0], bezierPiece.ts[1]
|
|
80
|
+
);
|
|
81
|
+
*/
|
|
82
|
+
const bezier = fromTo(bezierPiece.curve.ps, bezierPiece.ts[0], bezierPiece.ts[1]);
|
|
83
|
+
boundary.push(bezier);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
d.traces = [];
|
|
87
|
+
}
|
|
75
88
|
}
|
|
76
89
|
export { find3Prong };
|
|
77
90
|
//# sourceMappingURL=find-3-prong.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-3-prong.js","sourceRoot":"","sources":["../../src/find-3-prong.ts/find-3-prong.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAKrC,OAAO,EAAE,iCAAiC,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAa/E;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,EAAc,EAAE,OAAe;IAClD,MAAM,aAAa,GAAG,EAAE,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IACtD,aAAa,CAAC,aAAa,CAAC,CAAC;IAC7B,MAAM,oBAAoB,GAA0B,EAAE,CAAC;IAEvD,2EAA2E;IAC3E,IAAI,UAIA,CAAC;IACL,IAAI,QAAQ,GAAG,SAAS,CAAC;IACzB,IAAI,aAAa,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAC7C,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,EAAE,CAAC,MAAM,GAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACjC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACvB,aAAa,EAAE,CAAC;YAEhB,MAAM,cAAc,GACnB,oBAAoB,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;YACxD,IAAI,CAAC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CAAC,CAAC,MAAM,GAAG,EAAE,CAAC;KACd;AACF,CAAC;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
3
|
+
import { Loop } from 'flo-boolean';
|
|
4
|
+
declare function findAndAdd3Prongs(cpGraphs: Map<Loop, LlRbTree<CpNode>>, cpStart: CpNode, extreme: number): CpNode[];
|
|
5
|
+
export { findAndAdd3Prongs };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { traverseCp } from '../cp-node/traverse-cp.js';
|
|
2
|
+
import { calcPosOrder } from '../point-on-shape/calc-pos-order.js';
|
|
3
|
+
import { find3Prong } from './find-3-prong.js';
|
|
4
|
+
import { add3Prong } from './add-3-prong.js';
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
* Starting from some ContactPoint, traverses the shape going around Vertices
|
|
8
|
+
* and if more than two Vertices have been visited in total then recursively
|
|
9
|
+
* adds 3-prongs until only one or two Vertices have been visited.
|
|
10
|
+
*
|
|
11
|
+
* This process further subdivides the shape.
|
|
12
|
+
*
|
|
13
|
+
* @param cpGraphs
|
|
14
|
+
* @param cpStart The ContactPoint from where to start the process.
|
|
15
|
+
* @param extreme The maximum coordinate value used to calculate floating point
|
|
16
|
+
* tolerances.
|
|
17
|
+
*/
|
|
18
|
+
let ii = 0;
|
|
19
|
+
function findAndAdd3Prongs(cpGraphs, cpStart, extreme) {
|
|
20
|
+
let visitedCps;
|
|
21
|
+
do {
|
|
22
|
+
visitedCps = traverseCp(cpStart);
|
|
23
|
+
if (visitedCps.length > 2) {
|
|
24
|
+
const newCpNodes = findAndAdd3Prong(cpGraphs, visitedCps, extreme);
|
|
25
|
+
if (newCpNodes.length === 1) {
|
|
26
|
+
// There was another closeby cpNode
|
|
27
|
+
const closeCpNode = newCpNodes[0];
|
|
28
|
+
}
|
|
29
|
+
ii++;
|
|
30
|
+
}
|
|
31
|
+
if (typeof _debug_ !== 'undefined') {
|
|
32
|
+
if (ii === _debug_.directives.stopAfterThreeProngsNum) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
} while (visitedCps.length > 2);
|
|
37
|
+
return visitedCps;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @internal
|
|
41
|
+
* Finds and add a 3-prong MAT circle to the given shape.
|
|
42
|
+
* @param cpGraphs
|
|
43
|
+
* @param visitedCps
|
|
44
|
+
* @param extreme The maximum coordinate value used to calculate floating point
|
|
45
|
+
* tolerances.
|
|
46
|
+
*/
|
|
47
|
+
function findAndAdd3Prong(cpGraphs, visitedCps, extreme) {
|
|
48
|
+
const δs = [];
|
|
49
|
+
for (const visitedCp of visitedCps) {
|
|
50
|
+
δs.push([visitedCp, visitedCp.next]);
|
|
51
|
+
}
|
|
52
|
+
const threeProng = find3Prong(δs, extreme);
|
|
53
|
+
const orders = [];
|
|
54
|
+
for (let i = 0; i < 3; i++) {
|
|
55
|
+
orders.push(calcPosOrder(threeProng.circle, threeProng.ps[i]));
|
|
56
|
+
}
|
|
57
|
+
const newCpNodes = add3Prong(cpGraphs, orders, threeProng);
|
|
58
|
+
if (typeof _debug_ !== 'undefined') {
|
|
59
|
+
if (newCpNodes.length === 3) {
|
|
60
|
+
add3ProngDebugInfo(newCpNodes[0].cp.circle, visitedCps);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return newCpNodes;
|
|
64
|
+
}
|
|
65
|
+
/** @internal */
|
|
66
|
+
function add3ProngDebugInfo(circle, visitedCps) {
|
|
67
|
+
const threeProngs = _debug_.generated.elems.threeProng;
|
|
68
|
+
const len = threeProngs.length;
|
|
69
|
+
const data = threeProngs[len - 1];
|
|
70
|
+
data.visitedCps = visitedCps;
|
|
71
|
+
data.circle = circle;
|
|
72
|
+
}
|
|
73
|
+
export { findAndAdd3Prongs };
|
|
74
|
+
//# sourceMappingURL=find-and-add-3-prongs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-and-add-3-prongs.js","sourceRoot":"","sources":["../../src/find-3-prong.ts/find-and-add-3-prongs.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAG,MAAM,kBAAkB,CAAC;AAG9C;;;;;;;;;;;;GAYG;AACH,IAAI,EAAE,GAAG,CAAC,CAAC;AACX,SAAS,iBAAiB,CACxB,QAAoC,EACpC,OAAe,EACf,OAAe;IAEhB,IAAI,UAAoB,CAAC;IAEzB,GAAG;QACF,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QAEjC,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;YAC1B,MAAM,UAAU,GAAG,gBAAgB,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;YACnE,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC5B,mCAAmC;gBACnC,MAAM,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;aAClC;YACD,EAAE,EAAE,CAAC;SACL;QAED,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;YAC1B,IAAI,EAAE,KAAK,OAAO,CAAC,UAAU,CAAC,uBAAuB,EAAE;gBACnD,OAAO,SAAU,CAAC;aACrB;SACJ;KACP,QAAQ,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;IAEhC,OAAO,UAAU,CAAC;AACnB,CAAC;AAGD;;;;;;;GAOG;AACH,SAAS,gBAAgB,CACvB,QAAoC,EACpC,UAAoB,EACpB,OAAe;IAEhB,MAAM,EAAE,GAAuB,EAAE,CAAC;IAClC,KAAK,MAAM,SAAS,I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
2
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
3
|
+
import { Loop } from 'flo-boolean';
|
|
4
4
|
/**
|
|
5
|
-
* @
|
|
5
|
+
* @internal
|
|
6
6
|
* Finds and adds all 3-prongs.
|
|
7
7
|
* @param cpGraphs
|
|
8
8
|
* @param cpStart The CpNode to start traversing from.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { getCpNodesOnCircle } from '../cp-node/cp-node.js';
|
|
2
|
+
import { isPosSharpCorner } from '../point-on-shape/is-pos-sharp-corner.js';
|
|
3
|
+
import { findAndAdd3Prongs } from './find-and-add-3-prongs.js';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* Finds and adds all 3-prongs.
|
|
7
|
+
* @param cpGraphs
|
|
8
|
+
* @param cpStart The CpNode to start traversing from.
|
|
9
|
+
* @param extreme The maximum coordinate value used to calculate floating point
|
|
10
|
+
* tolerances.
|
|
11
|
+
*/
|
|
12
|
+
function findAndAddAll3Prongs(cpGraphs, cpStart, extreme) {
|
|
13
|
+
// Don't change this function to be recursive, the call stack may overflow
|
|
14
|
+
// if there are too many two-prongs.
|
|
15
|
+
const visitedEdges = new Map();
|
|
16
|
+
const edgesToCheck = [{ fromCpNode: undefined, cpStart }];
|
|
17
|
+
while (edgesToCheck.length) {
|
|
18
|
+
const { fromCpNode, cpStart } = edgesToCheck.shift();
|
|
19
|
+
markEdgeAsTaken(visitedEdges, fromCpNode, cpStart);
|
|
20
|
+
for (const cpNode of getCpNodesOnCircle(cpStart)) {
|
|
21
|
+
if (!isPosSharpCorner(cpNode.cp.pointOnShape)) {
|
|
22
|
+
if (findAndAdd3Prongs(cpGraphs, cpNode, extreme) === undefined) {
|
|
23
|
+
console.log('Unable to find 3-prong');
|
|
24
|
+
return; // only for debugging purposes
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (hasEdgeBeenTaken(visitedEdges, cpNode, cpNode.next)) {
|
|
28
|
+
continue; // We already visited this edge
|
|
29
|
+
}
|
|
30
|
+
edgesToCheck.push({ fromCpNode: cpStart, cpStart: cpNode.next });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// for (const [k,v] of cpGraphs) {
|
|
34
|
+
// fixOrdering(v.root!.datum);
|
|
35
|
+
// }
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
* Marks the given edge as already taken.
|
|
40
|
+
*/
|
|
41
|
+
function markEdgeAsTaken(visitedEdges, cp1, cp2) {
|
|
42
|
+
if (cp1 === undefined) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
markEdgeAsTaken_(cp1, cp2);
|
|
46
|
+
markEdgeAsTaken_(cp2, cp1);
|
|
47
|
+
function markEdgeAsTaken_(cp1, cp2) {
|
|
48
|
+
let visited = visitedEdges.get(cp1);
|
|
49
|
+
if (!visited) {
|
|
50
|
+
visited = new Set();
|
|
51
|
+
visitedEdges.set(cp1, visited);
|
|
52
|
+
}
|
|
53
|
+
visited.add(cp2);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** @internal */
|
|
57
|
+
function hasEdgeBeenTaken(visitedEdges, cp1, cp2) {
|
|
58
|
+
let cps;
|
|
59
|
+
cps = visitedEdges.get(cp1);
|
|
60
|
+
const takenForward = cps && cps.has(cp2);
|
|
61
|
+
cps = visitedEdges.get(cp2);
|
|
62
|
+
const takenBackwards = cps && cps.has(cp1);
|
|
63
|
+
return takenForward || takenBackwards;
|
|
64
|
+
}
|
|
65
|
+
export { findAndAddAll3Prongs };
|
|
66
|
+
//# sourceMappingURL=find-and-add-all-3-prongs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-and-add-all-3-prongs.js","sourceRoot":"","sources":["../../src/find-3-prong.ts/find-and-add-all-3-prongs.ts"],"names":[],"mappings":"AAKA,OAAO,EAAU,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,gBAAgB,EAA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gB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3B,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAE3B,SAAS,gBAAgB,CAAC,GAAW,EAAE,GAAW;QAC9C,IAAI,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,CAAC,OAAO,EAAE;YACV,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;YAC5B,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;SAClC;QACD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;AACL,CAAC;AAGD,gBAAgB;AAChB,SAAS,gBAAgB,CACjB,YAAsC,EACtC,GAAW,EACX,GAAW;IAEf,IAAI,GAA4B,CAAC;IAEjC,GAAG,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,MAAM,YAAY,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAEzC,GAAG,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,MAAM,cAAc,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAE3C,OAAO,YAAY,IAAI,cAAc,CAAC;AAC1C,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BezierPiece } from '
|
|
1
|
+
import { BezierPiece } from '../mat/bezier-piece.js';
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @internal
|
|
4
4
|
* @param x
|
|
5
5
|
* @param bezierPiece3s
|
|
6
6
|
* @param extreme
|
|
7
7
|
*/
|
|
8
|
-
declare function getClosestPoints(x: number[], bezierPiece3s: BezierPiece[][]): import("
|
|
8
|
+
declare function getClosestPoints(x: number[], bezierPiece3s: BezierPiece[][]): import("../point-on-shape/point-on-shape.js").PointOnShape[];
|
|
9
9
|
export { getClosestPoints };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getCloseBoundaryPointsCertified } from '../closest-boundary-point/get-close-boundary-points-certified.js';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
* @param x
|
|
5
|
+
* @param bezierPiece3s
|
|
6
|
+
* @param extreme
|
|
7
|
+
*/
|
|
8
|
+
function getClosestPoints(x, bezierPiece3s) {
|
|
9
|
+
return bezierPiece3s.map(bezierPieces => {
|
|
10
|
+
return getCloseBoundaryPointsCertified(bezierPieces, x)[0];
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
export { getClosestPoints };
|
|
14
|
+
//# sourceMappingURL=get-closest-points.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-closest-points.js","sourceRoot":"","sources":["../../src/find-3-prong.ts/get-closest-points.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,kEAAkE,CAAC;AAInH;;;;;GAKG;AACH,SAAS,gBAAgB,CACjB,CAAW,EACX,aAA8B;IAElC,OAAO,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;QACpC,OAAO,+BAA+B,CAClC,YAAY,EAAE,CAAC,CAClB,CAAC,CAAC,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;AACP,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Loop } from '
|
|
2
|
-
import { Mat } from '
|
|
3
|
-
/** @
|
|
1
|
+
import { Loop } from 'flo-boolean';
|
|
2
|
+
import { Mat } from '../mat/mat.js';
|
|
3
|
+
/** @internal */
|
|
4
4
|
declare function addDebugInfo1(loops: Loop[]): void;
|
|
5
|
-
/** @
|
|
5
|
+
/** @internal */
|
|
6
6
|
declare function addDebugInfo2(): void;
|
|
7
7
|
declare function addDebugInfo3(): void;
|
|
8
8
|
declare function addDebugInfo4(mat: Mat): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getBoundingHull, getBoundingBoxTight } from 'flo-bezier3';
|
|
2
|
-
import { getCornerAtEnd } from '
|
|
3
|
-
import { getBoundingBox_ } from '
|
|
2
|
+
import { getCornerAtEnd } from '../curve/curve.js';
|
|
3
|
+
import { getBoundingBox_ } from '../geometry/get-bounding-box-.js';
|
|
4
4
|
let timingStart;
|
|
5
|
-
/** @
|
|
5
|
+
/** @internal */
|
|
6
6
|
function addDebugInfo1(loops) {
|
|
7
7
|
if (typeof _debug_ === 'undefined') {
|
|
8
8
|
return;
|
|
@@ -25,17 +25,17 @@ function addDebugInfo1(loops) {
|
|
|
25
25
|
const tightBoundingBox = getBoundingBoxTight(ps);
|
|
26
26
|
generated.elems.tightBoundingBox.push(tightBoundingBox);
|
|
27
27
|
const corner = getCornerAtEnd(curve);
|
|
28
|
-
if (corner.
|
|
28
|
+
if (corner.isQuiteSharp) {
|
|
29
29
|
generated.elems.sharpCorner.push(curve);
|
|
30
30
|
}
|
|
31
|
-
else if (corner.
|
|
31
|
+
else if (corner.isQuiteDull) {
|
|
32
32
|
generated.elems.dullCorner.push(curve);
|
|
33
33
|
}
|
|
34
34
|
i++;
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
/** @
|
|
38
|
+
/** @internal */
|
|
39
39
|
function addDebugInfo2() {
|
|
40
40
|
if (typeof _debug_ === 'undefined') {
|
|
41
41
|
return;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-debug-info.js","sourceRoot":"","sources":["../../src/find-mat/add-debug-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGnE,OAAO,EAAS,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAOnE,IAAI,WAAmB,CA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
4
|
-
import {
|
|
2
|
+
import { Loop } from 'flo-boolean';
|
|
3
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
4
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
5
5
|
/**
|
|
6
|
-
* @
|
|
6
|
+
* @internal
|
|
7
7
|
* Creates the initial ContactPoint loops from the given sharp corners.
|
|
8
8
|
* @param shape
|
|
9
9
|
* @param sharpCornerss
|
|
10
10
|
*/
|
|
11
|
-
declare function createInitialCpGraph(loops: Loop[], cpTrees: Map<Loop, LlRbTree<CpNode>>, sharpCornerss:
|
|
11
|
+
declare function createInitialCpGraph(loops: Loop[], cpTrees: Map<Loop, LlRbTree<CpNode>>, sharpCornerss: PointOnShape[][]): CpNode | undefined;
|
|
12
12
|
export { createInitialCpGraph };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
-
import {
|
|
2
|
+
import { cpNodeComparator, insertCpNode } from '../cp-node/cp-node.js';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @internal
|
|
5
5
|
* Creates the initial ContactPoint loops from the given sharp corners.
|
|
6
6
|
* @param shape
|
|
7
7
|
* @param sharpCornerss
|
|
@@ -11,8 +11,7 @@ xMap: Map<number[][],{ ps: number[][] }>*/) {
|
|
|
11
11
|
let cpNode;
|
|
12
12
|
for (let k = 0; k < sharpCornerss.length; k++) {
|
|
13
13
|
const sharpCorners = sharpCornerss[k];
|
|
14
|
-
|
|
15
|
-
const cpTree = new LlRbTree(CpNode.comparator, false);
|
|
14
|
+
const cpTree = new LlRbTree(cpNodeComparator, false);
|
|
16
15
|
let cpNode1 = undefined;
|
|
17
16
|
let cpNode2 = undefined;
|
|
18
17
|
for (const pos of sharpCorners) {
|
|
@@ -22,8 +21,8 @@ xMap: Map<number[][],{ ps: number[][] }>*/) {
|
|
|
22
21
|
const circle = { center: pos.p, radius: 0 };
|
|
23
22
|
const cp1 = { pointOnShape: pos, circle, order: -1, order2: 0 };
|
|
24
23
|
const cp2 = { pointOnShape: pos, circle, order: +1, order2: 0 };
|
|
25
|
-
cpNode1 =
|
|
26
|
-
cpNode2 =
|
|
24
|
+
cpNode1 = insertCpNode(false, /*isIntersection*/ false, cpTree, cp1, cpNode2);
|
|
25
|
+
cpNode2 = insertCpNode(false, /*isIntersection*/ false, cpTree, cp2, cpNode1);
|
|
27
26
|
cpNode1.prevOnCircle = cpNode2;
|
|
28
27
|
cpNode2.prevOnCircle = cpNode1;
|
|
29
28
|
cpNode1.nextOnCircle = cpNode2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-initial-cp-graph.js","sourceRoot":"","sources":["../../src/find-mat/create-initial-cp-graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAU,gBAAgB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAK/E;;;;;GAKG;AACH,SAAS,oBAAoB,CACrB,KAAa,EACb,OAAoC,EACpC,aAA+B,CAAA;0CACW;IAE9C,IAAI,MAAM,CAAC;IAEX,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,MAAM,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;QAEtC,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;QAErD,IAAI,OAAO,GAAW,SAAU,CAAC;QACjC,IAAI,OAAO,GAAW,SAAU,CAAC;QACjC,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE;YAC5B,MAAM,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7B,yBAAyB;YACzB,6BAA6B;YAE7B,MAAM,MAAM,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;YAE5C,MAAM,GAAG,GAAiB,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;YAC9E,MAAM,GAAG,GAAiB,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;YAE9E,OAAO,GAAG,YAAY,CAAC,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAQ,CAAC,CAAC;YAC/E,OAAO,GAAG,YAAY,CAAC,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;YAE9E,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;YAC/B,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;YAE/B,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;YAC/B,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC;SAClC;QAED,IAAI,CAAC,MAAM,EAAE;YAAE,MAAM,GAAG,OAAO,CAAC;SAAE;QAElC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAC7B;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAGD,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Loop } from 'flo-boolean';
|
|
2
|
+
import { Mat } from '../mat/mat.js';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* Find the MAT of the given loops.
|
|
6
|
+
* @param loops The loops (that as a precondition must be ordered from highest
|
|
7
|
+
* (i.e. smallest y-value) topmost point loops to lowest)
|
|
8
|
+
*/
|
|
9
|
+
declare function findMat(loops: Loop[], minBezLength: number, maxCurviness: number, maxLength: number, maxCoordinate: number): Mat;
|
|
10
|
+
export { findMat };
|