flo-mat 2.0.4 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.quokka +4 -0
- package/browser/index.js +18434 -14538
- package/browser/index.min.js +1 -1
- package/node/closest-boundary-point/cull-bezier-pieces.d.ts +9 -0
- package/node/closest-boundary-point/cull-bezier-pieces.js +17 -0
- package/node/closest-boundary-point/cull-bezier-pieces.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.js +2 -2
- package/node/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.js +1 -1
- package/node/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.d.ts +25 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.js +68 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.js.map +1 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.d.ts +10 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.js +2 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.js +2 -3
- package/node/closest-boundary-point/get-best-distance-squared.js.map +1 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.d.ts +15 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.js +40 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.d.ts +15 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.js +42 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.js.map +1 -0
- package/node/closest-boundary-point/get-p-from-box.d.ts +3 -0
- package/node/closest-boundary-point/get-p-from-box.js +11 -0
- package/node/closest-boundary-point/get-p-from-box.js.map +1 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.d.ts +12 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js +93 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js.map +1 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.d.ts +13 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js +58 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js.map +1 -0
- package/node/{contact-point.d.ts → contact-point/contact-point.d.ts} +3 -3
- package/node/{contact-point.js → contact-point/contact-point.js} +1 -5
- package/node/contact-point/contact-point.js.map +1 -0
- package/node/{compare-curvatures-at-interface.js → corner/compare-curvatures-at-interface.js} +2 -2
- package/node/corner/compare-curvatures-at-interface.js.map +1 -0
- package/node/{mat → corner}/corner.d.ts +1 -1
- package/node/{mat → corner}/corner.js.map +1 -1
- package/node/corner/get-corner.d.ts +15 -0
- package/node/{curve.js → corner/get-corner.js} +6 -17
- package/node/corner/get-corner.js.map +1 -0
- package/node/{get-interface-ccw.js → corner/get-interface-ccw.js} +18 -33
- package/node/corner/get-interface-ccw.js.map +1 -0
- package/node/cp-node/clone.d.ts +1 -1
- package/node/cp-node/clone.js +6 -4
- package/node/cp-node/clone.js.map +1 -1
- package/node/cp-node/cp-node.d.ts +196 -0
- package/node/cp-node/cp-node.js +249 -0
- package/node/cp-node/cp-node.js.map +1 -0
- package/node/cp-node/create-cp-node.d.ts +4 -0
- package/node/cp-node/create-cp-node.js +8 -0
- package/node/cp-node/create-cp-node.js.map +1 -0
- package/node/cp-node/enhance-cp-node.d.ts +24 -0
- package/node/cp-node/enhance-cp-node.js +20 -0
- package/node/cp-node/enhance-cp-node.js.map +1 -0
- package/node/{get-boundary-bezier-parts-to-next.js → cp-node/get-boundary-bezier-parts-to-next.js} +1 -1
- package/node/cp-node/get-boundary-bezier-parts-to-next.js.map +1 -0
- package/node/{get-boundary-beziers-to-next.d.ts → cp-node/get-boundary-beziers-to-next.d.ts} +1 -1
- package/node/{get-boundary-beziers-to-next.js → cp-node/get-boundary-beziers-to-next.js} +1 -1
- package/node/cp-node/get-boundary-beziers-to-next.js.map +1 -0
- package/node/cp-node/get-cp-node-ordering.d.ts +8 -0
- package/node/cp-node/get-cp-node-ordering.js +12 -0
- package/node/cp-node/get-cp-node-ordering.js.map +1 -0
- package/node/{get-curve-to-next.js → cp-node/get-curve-to-next.js} +1 -1
- package/node/cp-node/get-curve-to-next.js.map +1 -0
- package/node/cp-node/remove.d.ts +1 -1
- package/node/cp-node/traverse-cp.d.ts +12 -0
- package/node/cp-node/traverse-cp.js +26 -0
- package/node/cp-node/traverse-cp.js.map +1 -0
- package/node/{traverse-edges.js → cp-node/traverse-edges.js} +4 -3
- package/node/cp-node/traverse-edges.js.map +1 -0
- package/node/{traverse-vertices.js → cp-node/traverse-vertices.js} +4 -3
- package/node/cp-node/traverse-vertices.js.map +1 -0
- package/node/{curve.d.ts → curve/curve.d.ts} +4 -17
- package/node/curve/curve.js +14 -0
- package/node/curve/curve.js.map +1 -0
- package/node/debug/cp-node-for-debugging.d.ts +2 -2
- package/node/debug/debug-elem-types.d.ts +8 -8
- package/node/debug/debug.d.ts +6 -6
- package/node/debug/debug.js +2 -2
- package/node/debug/debug.js.map +1 -1
- package/node/debug/functions/draw-elem/bounding-hull.d.ts +2 -2
- package/node/debug/functions/draw-elem/bounding-hull.js +3 -3
- package/node/debug/functions/draw-elem/bounding-hull.js.map +1 -1
- package/node/debug/functions/draw-elem/branch.d.ts +2 -2
- package/node/debug/functions/draw-elem/branch.js +4 -3
- package/node/debug/functions/draw-elem/branch.js.map +1 -1
- package/node/debug/functions/draw-elem/culls.d.ts +2 -2
- package/node/debug/functions/draw-elem/culls.js +2 -2
- package/node/debug/functions/draw-elem/culls.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.js +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-elem.d.ts +3 -3
- package/node/debug/functions/draw-elem/draw-elem.js +3 -3
- package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
- package/node/debug/functions/draw-elem/dull-corner.d.ts +3 -3
- package/node/debug/functions/draw-elem/dull-corner.js +3 -4
- package/node/debug/functions/draw-elem/dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/leaves.d.ts +2 -2
- package/node/debug/functions/draw-elem/leaves.js +1 -1
- package/node/debug/functions/draw-elem/leaves.js.map +1 -1
- package/node/debug/functions/draw-elem/loop.d.ts +2 -2
- package/node/debug/functions/draw-elem/loop.js +1 -2
- package/node/debug/functions/draw-elem/loop.js.map +1 -1
- package/node/debug/functions/draw-elem/loops.d.ts +1 -1
- package/node/debug/functions/draw-elem/loops.js +0 -1
- package/node/debug/functions/draw-elem/loops.js.map +1 -1
- package/node/debug/functions/draw-elem/loose-bounding-box.d.ts +2 -2
- package/node/debug/functions/draw-elem/loose-bounding-box.js +3 -3
- package/node/debug/functions/draw-elem/loose-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/mat.d.ts +3 -3
- package/node/debug/functions/draw-elem/mat.js +9 -7
- package/node/debug/functions/draw-elem/mat.js.map +1 -1
- package/node/debug/functions/draw-elem/max-vertex.d.ts +2 -2
- package/node/debug/functions/draw-elem/max-vertex.js +1 -1
- package/node/debug/functions/draw-elem/max-vertex.js.map +1 -1
- package/node/debug/functions/draw-elem/min-y.d.ts +3 -3
- package/node/debug/functions/draw-elem/min-y.js +2 -6
- package/node/debug/functions/draw-elem/min-y.js.map +1 -1
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.d.ts +2 -2
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js +2 -2
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/one-prong.d.ts +2 -2
- package/node/debug/functions/draw-elem/one-prong.js +6 -11
- package/node/debug/functions/draw-elem/one-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/sharp-corner.d.ts +3 -3
- package/node/debug/functions/draw-elem/sharp-corner.js +3 -4
- package/node/debug/functions/draw-elem/sharp-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/three-prong.d.ts +2 -2
- package/node/debug/functions/draw-elem/three-prong.js +8 -10
- package/node/debug/functions/draw-elem/three-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/tight-bounding-box.d.ts +2 -2
- package/node/debug/functions/draw-elem/tight-bounding-box.js +3 -3
- package/node/debug/functions/draw-elem/tight-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/two-prong.d.ts +2 -2
- package/node/debug/functions/draw-elem/two-prong.js +7 -8
- package/node/debug/functions/draw-elem/two-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/vertex.d.ts +4 -3
- package/node/debug/functions/draw-elem/vertex.js +11 -9
- package/node/debug/functions/draw-elem/vertex.js.map +1 -1
- package/node/debug/functions/general.d.ts +8 -8
- package/node/debug/functions/general.js +8 -8
- package/node/debug/functions/general.js.map +1 -1
- package/node/debug/functions/three-prong.d.ts +2 -2
- package/node/debug/functions/three-prong.js +10 -13
- package/node/debug/functions/three-prong.js.map +1 -1
- package/node/debug/functions/two-prong.d.ts +16 -5
- package/node/debug/functions/two-prong.js +56 -58
- package/node/debug/functions/two-prong.js.map +1 -1
- package/node/debug/three-prong-for-debugging.d.ts +6 -6
- package/node/debug/three-prong-for-debugging.js +1 -1
- package/node/debug/three-prong-for-debugging.js.map +1 -1
- package/node/debug/two-prong-for-debugging.d.ts +7 -7
- package/node/error-analysis/gamma.d.ts +26 -0
- package/node/error-analysis/gamma.js +35 -0
- package/node/error-analysis/gamma.js.map +1 -0
- package/node/find-2-prong/add-1-prong.d.ts +12 -0
- package/node/{mat/find-mat → find-2-prong}/add-1-prong.js +11 -11
- package/node/find-2-prong/add-1-prong.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/add-2-prong.d.ts +6 -9
- package/node/{mat/find-mat → find-2-prong}/add-2-prong.js +26 -74
- package/node/find-2-prong/add-2-prong.js.map +1 -0
- package/node/find-2-prong/add-debug-info.d.ts +8 -0
- package/node/{mat/find-mat/find-2-prong → find-2-prong}/add-debug-info.js +5 -4
- package/node/find-2-prong/add-debug-info.js.map +1 -0
- package/node/find-2-prong/cull-bezier-pieces.d.ts +11 -0
- package/node/find-2-prong/cull-bezier-pieces.js +28 -0
- package/node/find-2-prong/cull-bezier-pieces.js.map +1 -0
- package/node/{mat/find-mat/find-2-prong → find-2-prong}/find-2-prong.d.ts +9 -13
- package/node/find-2-prong/find-2-prong.js +144 -0
- package/node/find-2-prong/find-2-prong.js.map +1 -0
- package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.d.ts +15 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-2-prongs-on-all-paths.js +5 -4
- package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-2-prongs.d.ts +5 -5
- package/node/find-2-prong/find-and-add-2-prongs.js +60 -0
- package/node/find-2-prong/find-and-add-2-prongs.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.d.ts +3 -3
- package/node/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.js +5 -5
- package/node/find-2-prong/find-and-add-hole-closing-2-prongs.js.map +1 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.d.ts +10 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.js +56 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.js.map +1 -0
- package/node/find-2-prong/get-initial-bezier-pieces.d.ts +15 -0
- package/node/find-2-prong/get-initial-bezier-pieces.js +40 -0
- package/node/find-2-prong/get-initial-bezier-pieces.js.map +1 -0
- package/node/find-2-prong/reduce-radius.d.ts +8 -0
- package/node/find-2-prong/reduce-radius.js +72 -0
- package/node/find-2-prong/reduce-radius.js.map +1 -0
- package/node/find-2-prong/squared-distance-between-dd.d.ts +2 -0
- package/node/find-2-prong/squared-distance-between-dd.js +17 -0
- package/node/find-2-prong/squared-distance-between-dd.js.map +1 -0
- package/node/find-2-prong/x-for-debugging.d.ts +9 -0
- package/node/find-2-prong/x-for-debugging.js.map +1 -0
- package/node/{mat/find-mat → find-3-prong.ts}/add-3-prong.d.ts +12 -7
- package/node/find-3-prong.ts/add-3-prong.js +82 -0
- package/node/find-3-prong.ts/add-3-prong.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.d.ts +4 -4
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.js +1 -1
- package/node/find-3-prong.ts/calc-better-x.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.d.ts +3 -3
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.js +5 -7
- package/node/find-3-prong.ts/calc-initial-3-prong-center.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.d.ts +6 -6
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.js +11 -12
- package/node/find-3-prong.ts/find-3-prong-for-delta3s.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong.d.ts +5 -5
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong.js +52 -39
- package/node/find-3-prong.ts/find-3-prong.js.map +1 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.d.ts +5 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.js +74 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.js.map +1 -0
- package/node/{mat/find-mat/find-and-add-3-prongs.d.ts → find-3-prong.ts/find-and-add-all-3-prongs.d.ts} +3 -3
- package/node/find-3-prong.ts/find-and-add-all-3-prongs.js +66 -0
- package/node/find-3-prong.ts/find-and-add-all-3-prongs.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/get-closest-points.d.ts +3 -3
- package/node/find-3-prong.ts/get-closest-points.js +14 -0
- package/node/find-3-prong.ts/get-closest-points.js.map +1 -0
- package/node/{mat/find-mat → find-mat}/add-debug-info.d.ts +4 -4
- package/node/{mat/find-mat → find-mat}/add-debug-info.js +6 -6
- package/node/find-mat/add-debug-info.js.map +1 -0
- package/node/{mat/find-mat → find-mat}/create-initial-cp-graph.d.ts +5 -5
- package/node/{mat/find-mat → find-mat}/create-initial-cp-graph.js +5 -6
- package/node/find-mat/create-initial-cp-graph.js.map +1 -0
- package/node/find-mat/find-mat.d.ts +10 -0
- package/node/find-mat/find-mat.js +57 -0
- package/node/find-mat/find-mat.js.map +1 -0
- package/node/{find-mats.d.ts → find-mat/find-mats.d.ts} +1 -1
- package/node/find-mat/find-mats.js +58 -0
- package/node/find-mat/find-mats.js.map +1 -0
- package/node/find-mat/fix-ordering.d.ts +8 -0
- package/node/find-mat/fix-ordering.js +59 -0
- package/node/find-mat/fix-ordering.js.map +1 -0
- package/node/find-mat/get-dull-corners.d.ts +5 -0
- package/node/find-mat/get-dull-corners.js +22 -0
- package/node/find-mat/get-dull-corners.js.map +1 -0
- package/node/find-mat/get-for-1-prongs-on-loop.d.ts +11 -0
- package/node/find-mat/get-for-1-prongs-on-loop.js +28 -0
- package/node/find-mat/get-for-1-prongs-on-loop.js.map +1 -0
- package/node/find-mat/get-for-2-prongs-on-loop.d.ts +11 -0
- package/node/find-mat/get-for-2-prongs-on-loop.js +30 -0
- package/node/find-mat/get-for-2-prongs-on-loop.js.map +1 -0
- package/node/find-mat/get-sharp-corners.d.ts +5 -0
- package/node/find-mat/get-sharp-corners.js +21 -0
- package/node/find-mat/get-sharp-corners.js.map +1 -0
- package/node/find-mat/get-size-params.d.ts +7 -0
- package/node/find-mat/get-size-params.js +33 -0
- package/node/find-mat/get-size-params.js.map +1 -0
- package/node/geometry/circle.js.map +1 -0
- package/node/geometry/get-bounding-box-.js.map +1 -0
- package/node/{mat/geometry → geometry}/get-closest-square-distance-to-rect.d.ts +1 -1
- package/node/{mat/geometry → geometry}/get-closest-square-distance-to-rect.js +1 -1
- package/node/geometry/get-closest-square-distance-to-rect.js.map +1 -0
- package/node/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.d.ts +1 -1
- package/node/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.js +1 -1
- package/node/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -0
- package/node/get-curve/get-curve-between.d.ts +1 -1
- package/node/get-curve/get-curve-between.js +2 -2
- package/node/get-curve/get-curve-between.js.map +1 -1
- package/node/get-curve/get-edge-direction.d.ts +2 -2
- package/node/get-curve/get-edge-direction.js +2 -4
- package/node/get-curve/get-edge-direction.js.map +1 -1
- package/node/index.d.ts +24 -20
- package/node/index.js +21 -16
- package/node/index.js.map +1 -1
- package/node/loop/get-max-coordinate.d.ts +1 -1
- package/node/loop/get-max-coordinate.js +1 -1
- package/node/mat/add-to-cp-graph.d.ts +8 -7
- package/node/mat/add-to-cp-graph.js +6 -4
- package/node/mat/add-to-cp-graph.js.map +1 -1
- package/node/mat/bezier-piece.d.ts +2 -2
- package/node/mat/create-new-cp-tree.d.ts +3 -3
- package/node/mat/create-new-cp-tree.js +5 -7
- package/node/mat/create-new-cp-tree.js.map +1 -1
- package/node/mat/elem-type-two-prong.d.ts +1 -1
- package/node/mat/get-boundary-piece-beziers.d.ts +2 -2
- package/node/mat/get-boundary-piece-beziers.js +4 -4
- package/node/mat/get-boundary-piece-beziers.js.map +1 -1
- package/node/{get-branches.d.ts → mat/get-branches.d.ts} +1 -1
- package/node/{get-branches.js → mat/get-branches.js} +7 -6
- package/node/mat/get-branches.js.map +1 -0
- package/node/mat/get-largest-vertex.d.ts +2 -2
- package/node/mat/get-largest-vertex.js +1 -1
- package/node/mat/get-largest-vertex.js.map +1 -1
- package/node/mat/get-neighboring-cps.d.ts +6 -4
- package/node/mat/get-neighboring-cps.js +5 -3
- package/node/mat/get-neighboring-cps.js.map +1 -1
- package/node/mat/get-two-prong-type.d.ts +1 -1
- package/node/mat/get-two-prong-type.js +1 -1
- package/node/mat/get-two-prong-type.js.map +1 -1
- package/node/mat/is-another-cp-closeby.d.ts +9 -8
- package/node/mat/is-another-cp-closeby.js +21 -29
- package/node/mat/is-another-cp-closeby.js.map +1 -1
- package/node/{mat.d.ts → mat/mat.d.ts} +2 -2
- package/node/mat/mat.js.map +1 -0
- package/node/mat/simplify-mat-map-only.d.ts +1 -1
- package/node/mat/simplify-mat-map-only.js +4 -3
- package/node/mat/simplify-mat-map-only.js.map +1 -1
- package/node/{simplify-mat.d.ts → mat/simplify-mat.d.ts} +3 -5
- package/node/{simplify-mat.js → mat/simplify-mat.js} +11 -13
- package/node/mat/simplify-mat.js.map +1 -0
- package/node/mat/trim-mat.d.ts +1 -1
- package/node/mat/trim-mat.js +1 -1
- package/node/mat/trim-mat.js.map +1 -1
- package/node/point-on-shape/calc-pos-order.d.ts +13 -0
- package/node/point-on-shape/calc-pos-order.js +27 -0
- package/node/point-on-shape/calc-pos-order.js.map +1 -0
- package/node/point-on-shape/compare-poss.d.ts +10 -0
- package/node/point-on-shape/compare-poss.js +18 -0
- package/node/point-on-shape/compare-poss.js.map +1 -0
- package/node/point-on-shape/create-pos.d.ts +4 -0
- package/node/point-on-shape/create-pos.js +12 -0
- package/node/point-on-shape/create-pos.js.map +1 -0
- package/node/point-on-shape/get-osculating-circle.d.ts +10 -0
- package/node/point-on-shape/get-osculating-circle.js +25 -0
- package/node/point-on-shape/get-osculating-circle.js.map +1 -0
- package/node/point-on-shape/get-pos-corner.d.ts +7 -0
- package/node/point-on-shape/get-pos-corner.js +9 -0
- package/node/point-on-shape/get-pos-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-corner.js +8 -0
- package/node/point-on-shape/is-pos-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-dull-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-dull-corner.js +14 -0
- package/node/point-on-shape/is-pos-dull-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.js +14 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-sharp-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-sharp-corner.js +14 -0
- package/node/point-on-shape/is-pos-sharp-corner.js.map +1 -0
- package/node/point-on-shape/point-on-shape.d.ts +11 -0
- package/node/point-on-shape/point-on-shape.js +2 -0
- package/node/point-on-shape/point-on-shape.js.map +1 -0
- package/node/point-on-shape/pos-to-human-string.d.ts +8 -0
- package/node/point-on-shape/pos-to-human-string.js +12 -0
- package/node/point-on-shape/pos-to-human-string.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/add-debug-info.d.ts +2 -2
- package/node/{mat/to-scale-axis → sat}/add-debug-info.js +1 -1
- package/node/sat/add-debug-info.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/cull-non-cycles.d.ts +3 -3
- package/node/{mat/to-scale-axis → sat}/cull-non-cycles.js +6 -6
- package/node/sat/cull-non-cycles.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/cull.d.ts +3 -3
- package/node/{mat/to-scale-axis → sat}/cull.js +4 -4
- package/node/sat/cull.js.map +1 -0
- package/node/{mat → sat}/get-leaves.d.ts +2 -2
- package/node/sat/get-leaves.js +14 -0
- package/node/sat/get-leaves.js.map +1 -0
- package/node/{to-scale-axis.d.ts → sat/to-scale-axis.d.ts} +2 -2
- package/node/{to-scale-axis.js → sat/to-scale-axis.js} +11 -10
- package/node/sat/to-scale-axis.js.map +1 -0
- package/node/svg/get-loop-bounds.d.ts +7 -7
- package/node/svg/get-loop-bounds.js +11 -7
- package/node/svg/get-loop-bounds.js.map +1 -1
- package/node/svg/get-min-y-pos.d.ts +4 -4
- package/node/svg/get-min-y-pos.js +1 -1
- package/node/svg/get-shape-bounds.d.ts +6 -5
- package/node/svg/get-shape-bounds.js +6 -2
- package/node/svg/get-shape-bounds.js.map +1 -1
- package/node/sweep-line/sweep-line.d.ts +1 -1
- package/node/sweep-line/sweep-line.js +4 -4
- package/node/sweep-line/sweep-line.js.map +1 -1
- package/package.json +10 -10
- package/src/closest-boundary-point/closest-points-on-curve-precise.ts +75 -0
- package/src/closest-boundary-point/closest-points-on-curve.ts +72 -0
- package/src/closest-boundary-point/cull-bezier-pieces.ts +35 -0
- package/src/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.ts +4 -3
- package/src/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.ts +2 -2
- package/src/closest-boundary-point/dd-deflate-with-running-error.ts +88 -0
- package/src/closest-boundary-point/foot-and-endpoint-info.ts +16 -0
- package/src/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.ts +3 -4
- package/src/closest-boundary-point/get-close-boundary-points-certified.ts +69 -0
- package/src/closest-boundary-point/get-closest-boundary-point-certified.ts +70 -0
- package/src/closest-boundary-point/get-p-from-box.ts +14 -0
- package/src/closest-boundary-point/get-potential-closest-points-on-curve-certified.ts +122 -0
- package/src/closest-boundary-point/root-interval-to-distance-squared-interval.ts +75 -0
- package/src/{contact-point.ts → contact-point/contact-point.ts} +4 -6
- package/src/{compare-curvatures-at-interface.ts → corner/compare-curvatures-at-interface.ts} +2 -2
- package/src/{mat → corner}/corner.ts +1 -1
- package/src/{curve.ts → corner/get-corner.ts} +10 -49
- package/src/{get-interface-ccw.ts → corner/get-interface-ccw.ts} +28 -35
- package/src/cp-node/clone.ts +17 -6
- package/src/cp-node/cp-node.ts +422 -0
- package/src/cp-node/create-cp-node.ts +21 -0
- package/src/cp-node/enhance-cp-node.ts +27 -0
- package/src/{get-boundary-bezier-parts-to-next.ts → cp-node/get-boundary-bezier-parts-to-next.ts} +3 -3
- package/src/{get-boundary-beziers-to-next.ts → cp-node/get-boundary-beziers-to-next.ts} +2 -2
- package/src/cp-node/get-cp-node-ordering.ts +17 -0
- package/src/{get-curve-to-next.ts → cp-node/get-curve-to-next.ts} +1 -1
- package/src/cp-node/remove.ts +1 -1
- package/src/cp-node/traverse-cp.ts +35 -0
- package/src/{traverse-edges.ts → cp-node/traverse-edges.ts} +5 -5
- package/src/{traverse-vertices.ts → cp-node/traverse-vertices.ts} +5 -5
- package/src/curve/curve.ts +46 -0
- package/src/debug/cp-node-for-debugging.ts +2 -2
- package/src/debug/debug-elem-types.ts +8 -8
- package/src/debug/debug.ts +11 -11
- package/src/debug/functions/draw-elem/bounding-hull.ts +5 -3
- package/src/debug/functions/draw-elem/branch.ts +4 -4
- package/src/debug/functions/draw-elem/culls.ts +3 -3
- package/src/debug/functions/draw-elem/draw-circle-percent.ts +1 -1
- package/src/debug/functions/draw-elem/draw-elem.ts +10 -6
- package/src/debug/functions/draw-elem/dull-corner.ts +10 -6
- package/src/debug/functions/draw-elem/leaves.ts +2 -2
- package/src/debug/functions/draw-elem/loop.ts +4 -3
- package/src/debug/functions/draw-elem/loops.ts +1 -2
- package/src/debug/functions/draw-elem/loose-bounding-box.ts +8 -3
- package/src/debug/functions/draw-elem/mat.ts +16 -8
- package/src/debug/functions/draw-elem/max-vertex.ts +2 -2
- package/src/debug/functions/draw-elem/min-y.ts +4 -9
- package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +10 -2
- package/src/debug/functions/draw-elem/one-prong.ts +12 -15
- package/src/debug/functions/draw-elem/sharp-corner.ts +10 -6
- package/src/debug/functions/draw-elem/three-prong.ts +13 -11
- package/src/debug/functions/draw-elem/tight-bounding-box.ts +9 -3
- package/src/debug/functions/draw-elem/two-prong.ts +12 -8
- package/src/debug/functions/draw-elem/vertex.ts +12 -11
- package/src/debug/functions/general.ts +10 -10
- package/src/debug/functions/three-prong.ts +16 -20
- package/src/debug/functions/two-prong.ts +89 -77
- package/src/debug/three-prong-for-debugging.ts +17 -16
- package/src/debug/two-prong-for-debugging.ts +7 -7
- package/src/error-analysis/gamma.ts +41 -0
- package/src/{mat/find-mat → find-2-prong}/add-1-prong.ts +19 -16
- package/src/{mat/find-mat → find-2-prong}/add-2-prong.ts +45 -91
- package/src/find-2-prong/add-debug-info.ts +49 -0
- package/src/{mat/find-mat/find-2-prong → find-2-prong}/cull-bezier-pieces.ts +9 -11
- package/src/find-2-prong/find-2-prong.ts +191 -0
- package/src/{mat/find-mat → find-2-prong}/find-and-add-2-prongs-on-all-paths.ts +12 -9
- package/src/find-2-prong/find-and-add-2-prongs.ts +88 -0
- package/src/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.ts +7 -7
- package/src/find-2-prong/find-equidistant-point-on-line-dd.ts +77 -0
- package/src/{mat/find-mat/find-2-prong → find-2-prong}/find-equidistant-point-on-line.ts +1 -1
- package/src/find-2-prong/get-initial-bezier-pieces.ts +61 -0
- package/src/find-2-prong/pyth-trips.ts +146 -0
- package/src/find-2-prong/reduce-radius.ts +98 -0
- package/src/find-2-prong/squared-distance-between-dd.ts +25 -0
- package/src/find-2-prong/x-for-debugging.ts +13 -0
- package/src/find-3-prong.ts/add-3-prong.ts +110 -0
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.ts +5 -5
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.ts +11 -12
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.ts +28 -28
- package/src/find-3-prong.ts/find-3-prong.ts +148 -0
- package/src/find-3-prong.ts/find-and-add-3-prongs.ts +111 -0
- package/src/find-3-prong.ts/find-and-add-all-3-prongs.ts +109 -0
- package/src/find-3-prong.ts/get-closest-points.ts +24 -0
- package/src/{mat/find-mat → find-mat}/add-debug-info.ts +10 -10
- package/src/{mat/find-mat → find-mat}/create-initial-cp-graph.ts +11 -12
- package/src/find-mat/find-mat.ts +89 -0
- package/src/find-mat/find-mats.ts +83 -0
- package/src/find-mat/fix-ordering.ts +69 -0
- package/src/find-mat/get-dull-corners.ts +34 -0
- package/src/find-mat/get-for-1-prongs-on-loop.ts +40 -0
- package/src/find-mat/get-for-2-prongs-on-loop.ts +44 -0
- package/src/find-mat/get-sharp-corners.ts +33 -0
- package/src/find-mat/get-size-params.ts +34 -0
- package/src/{mat/find-mat → find-mat}/get-total-by.ts +4 -4
- package/src/{mat/geometry → geometry}/get-closest-square-distance-to-rect.ts +1 -1
- package/src/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.ts +2 -2
- package/src/get-curve/get-curve-between.ts +7 -7
- package/src/get-curve/get-edge-direction.ts +11 -11
- package/src/index.ts +64 -21
- package/src/loop/get-max-coordinate.ts +1 -1
- package/src/mat/add-to-cp-graph.ts +15 -12
- package/src/mat/bezier-piece.ts +2 -2
- package/src/mat/cmp-cp-on-delta.ts +6 -3
- package/src/mat/create-new-cp-tree.ts +6 -9
- package/src/mat/elem-type-two-prong.ts +1 -1
- package/src/mat/get-boundary-piece-beziers.ts +7 -7
- package/src/{get-branches.ts → mat/get-branches.ts} +8 -8
- package/src/mat/get-edges-as-array.ts +2 -2
- package/src/mat/get-largest-three-prong.ts +3 -3
- package/src/mat/get-largest-vertex.ts +2 -2
- package/src/mat/get-neighboring-cps.ts +9 -6
- package/src/mat/get-two-prong-type.ts +1 -1
- package/src/mat/is-another-cp-closeby.ts +29 -44
- package/src/{mat.ts → mat/mat.ts} +2 -2
- package/src/mat/simplify-mat-map-only.ts +5 -5
- package/src/{simplify-mat.ts → mat/simplify-mat.ts} +12 -14
- package/src/mat/trim-mat.ts +3 -3
- package/src/point-on-shape/calc-pos-order.ts +35 -0
- package/src/point-on-shape/compare-poss.ts +26 -0
- package/src/point-on-shape/create-pos.ts +21 -0
- package/src/point-on-shape/get-osculating-circle.ts +39 -0
- package/src/point-on-shape/get-pos-corner.ts +16 -0
- package/src/point-on-shape/is-pos-corner.ts +12 -0
- package/src/point-on-shape/is-pos-dull-corner.ts +16 -0
- package/src/point-on-shape/is-pos-quite-dull-corner.ts +17 -0
- package/src/point-on-shape/is-pos-quite-sharp-corner.ts +17 -0
- package/src/point-on-shape/is-pos-sharp-corner.ts +17 -0
- package/src/point-on-shape/point-on-shape.ts +15 -0
- package/src/point-on-shape/pos-to-human-string.ts +16 -0
- package/src/{mat/to-scale-axis → sat}/add-debug-info.ts +3 -3
- package/src/{mat/to-scale-axis → sat}/cull-non-cycles.ts +7 -7
- package/src/{mat/to-scale-axis → sat}/cull.ts +6 -6
- package/src/{mat → sat}/get-leaves.ts +4 -4
- package/src/{mat/to-scale-axis → sat}/t-tree.ts +2 -2
- package/src/{to-scale-axis.ts → sat/to-scale-axis.ts} +16 -16
- package/src/{mat/to-scale-axis → sat}/traverse-spacial-tree.ts +5 -5
- package/src/svg/get-loop-bounds.ts +22 -17
- package/src/svg/get-min-y-pos.ts +3 -3
- package/src/svg/get-shape-bounds.ts +12 -9
- package/src/sweep-line/are-boxes-intersecting.ts +1 -1
- package/src/sweep-line/sweep-line.ts +7 -7
- package/tsconfig.json +3 -7
- package/wallaby.mjs +32 -0
- package/node/circle.js.map +0 -1
- package/node/compare-curvatures-at-interface.js.map +0 -1
- package/node/contact-point.js.map +0 -1
- package/node/cp-node.d.ts +0 -202
- package/node/cp-node.js +0 -321
- package/node/cp-node.js.map +0 -1
- package/node/curve.js.map +0 -1
- package/node/find-mats.js +0 -123
- package/node/find-mats.js.map +0 -1
- package/node/get-boundary-bezier-parts-to-next.js.map +0 -1
- package/node/get-boundary-beziers-to-next.js.map +0 -1
- package/node/get-bounding-box-.js.map +0 -1
- package/node/get-branches.js.map +0 -1
- package/node/get-curve-to-next.js.map +0 -1
- package/node/get-interface-ccw.js.map +0 -1
- package/node/loop.d.ts +0 -16
- package/node/loop.js +0 -35
- package/node/loop.js.map +0 -1
- package/node/mat/closest-boundary-point/closest-points-on-curve.d.ts +0 -14
- package/node/mat/closest-boundary-point/closest-points-on-curve.js +0 -73
- package/node/mat/closest-boundary-point/closest-points-on-curve.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-bezier-pieces.d.ts +0 -9
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js +0 -20
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js.map +0 -1
- package/node/mat/closest-boundary-point/get-best-distance-squared.js.map +0 -1
- package/node/mat/closest-boundary-point/get-close-boundary-points.d.ts +0 -17
- package/node/mat/closest-boundary-point/get-close-boundary-points.js +0 -81
- package/node/mat/closest-boundary-point/get-close-boundary-points.js.map +0 -1
- package/node/mat/closest-boundary-point/get-closest-boundary-point.d.ts +0 -18
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js +0 -41
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js.map +0 -1
- package/node/mat/find-mat/add-1-prong.d.ts +0 -12
- package/node/mat/find-mat/add-1-prong.js.map +0 -1
- package/node/mat/find-mat/add-2-prong.js.map +0 -1
- package/node/mat/find-mat/add-3-prong.js +0 -55
- package/node/mat/find-mat/add-3-prong.js.map +0 -1
- package/node/mat/find-mat/add-debug-info.js.map +0 -1
- package/node/mat/find-mat/create-get-interesting-points-on-loop.d.ts +0 -11
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js +0 -52
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js.map +0 -1
- package/node/mat/find-mat/create-initial-cp-graph.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/add-debug-info.d.ts +0 -8
- package/node/mat/find-mat/find-2-prong/add-debug-info.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.d.ts +0 -11
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js +0 -30
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/find-2-prong.js +0 -233
- package/node/mat/find-mat/find-2-prong/find-2-prong.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.d.ts +0 -9
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js +0 -40
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.d.ts +0 -11
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js +0 -38
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/x-for-debugging.d.ts +0 -9
- package/node/mat/find-mat/find-2-prong/x-for-debugging.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/calc-better-x.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/get-closest-points.js +0 -17
- package/node/mat/find-mat/find-3-prong/get-closest-points.js.map +0 -1
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.d.ts +0 -15
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js.map +0 -1
- package/node/mat/find-mat/find-and-add-2-prongs.js +0 -74
- package/node/mat/find-mat/find-and-add-2-prongs.js.map +0 -1
- package/node/mat/find-mat/find-and-add-3-prongs.js +0 -147
- package/node/mat/find-mat/find-and-add-3-prongs.js.map +0 -1
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js.map +0 -1
- package/node/mat/find-mat/get-potential-2-prongs.d.ts +0 -4
- package/node/mat/find-mat/get-potential-2-prongs.js +0 -17
- package/node/mat/find-mat/get-potential-2-prongs.js.map +0 -1
- package/node/mat/find-mat/get-sharp-corners.d.ts +0 -4
- package/node/mat/find-mat/get-sharp-corners.js +0 -18
- package/node/mat/find-mat/get-sharp-corners.js.map +0 -1
- package/node/mat/geometry/get-closest-square-distance-to-rect.js.map +0 -1
- package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js.map +0 -1
- package/node/mat/get-contact-circles-at-interface.d.ts +0 -8
- package/node/mat/get-contact-circles-at-interface.js +0 -21
- package/node/mat/get-contact-circles-at-interface.js.map +0 -1
- package/node/mat/get-leaves.js +0 -13
- package/node/mat/get-leaves.js.map +0 -1
- package/node/mat/to-scale-axis/add-debug-info.js.map +0 -1
- package/node/mat/to-scale-axis/cull-non-cycles.js.map +0 -1
- package/node/mat/to-scale-axis/cull.js.map +0 -1
- package/node/mat.js.map +0 -1
- package/node/point-on-shape.d.ts +0 -73
- package/node/point-on-shape.js +0 -168
- package/node/point-on-shape.js.map +0 -1
- package/node/simplify-mat.js.map +0 -1
- package/node/to-scale-axis.js.map +0 -1
- package/node/traverse-edges.js.map +0 -1
- package/node/traverse-vertices.js.map +0 -1
- package/src/cp-node.ts +0 -388
- package/src/find-mats.ts +0 -171
- package/src/loop.ts +0 -56
- package/src/mat/closest-boundary-point/closest-point-on-curve-old.ts_ +0 -88
- package/src/mat/closest-boundary-point/closest-point-on-curve.ts_ +0 -95
- package/src/mat/closest-boundary-point/closest-points-on-curve.ts +0 -84
- package/src/mat/closest-boundary-point/cull-bezier-pieces.ts +0 -38
- package/src/mat/closest-boundary-point/get-close-boundary-points.ts +0 -107
- package/src/mat/closest-boundary-point/get-closest-boundary-point.ts +0 -64
- package/src/mat/find-mat/add-3-prong.ts +0 -75
- package/src/mat/find-mat/create-get-interesting-points-on-loop.ts +0 -73
- package/src/mat/find-mat/find-2-prong/add-debug-info.ts +0 -46
- package/src/mat/find-mat/find-2-prong/find-2-prong.ts +0 -316
- package/src/mat/find-mat/find-2-prong/get-initial-bezier-pieces.ts +0 -52
- package/src/mat/find-mat/find-2-prong/x-for-debugging.ts +0 -13
- package/src/mat/find-mat/find-3-prong/find-3-prong.ts +0 -106
- package/src/mat/find-mat/find-3-prong/get-closest-points.ts +0 -28
- package/src/mat/find-mat/find-and-add-2-prongs.ts +0 -108
- package/src/mat/find-mat/find-and-add-3-prongs.ts +0 -218
- package/src/mat/find-mat/get-potential-2-prongs.ts +0 -24
- package/src/mat/find-mat/get-sharp-corners.ts +0 -25
- package/src/mat/find-mat/get-total-abs-curvature.ts +0 -17
- package/src/mat/get-contact-circles-at-interface.ts +0 -26
- package/src/mat/to-scale-axis/add-to-tree.ts +0 -66
- package/src/mat/to-scale-axis/calc-groups.ts +0 -82
- package/src/mat/to-scale-axis/create-spacial-tree.ts +0 -41
- package/src/mat/to-scale-axis/get-engulfed-vertices.ts +0 -135
- package/src/point-on-shape.ts +0 -231
- package/src/svg/get-curvature-at-interface.ts +0 -55
- /package/node/{compare-curvatures-at-interface.d.ts → corner/compare-curvatures-at-interface.d.ts} +0 -0
- /package/node/{mat → corner}/corner.js +0 -0
- /package/node/{get-interface-ccw.d.ts → corner/get-interface-ccw.d.ts} +0 -0
- /package/node/{get-boundary-bezier-parts-to-next.d.ts → cp-node/get-boundary-bezier-parts-to-next.d.ts} +0 -0
- /package/node/{get-curve-to-next.d.ts → cp-node/get-curve-to-next.d.ts} +0 -0
- /package/node/{traverse-edges.d.ts → cp-node/traverse-edges.d.ts} +0 -0
- /package/node/{traverse-vertices.d.ts → cp-node/traverse-vertices.d.ts} +0 -0
- /package/node/{mat/find-mat/find-2-prong → find-2-prong}/x-for-debugging.js +0 -0
- /package/node/{circle.d.ts → geometry/circle.d.ts} +0 -0
- /package/node/{circle.js → geometry/circle.js} +0 -0
- /package/node/{get-bounding-box-.d.ts → geometry/get-bounding-box-.d.ts} +0 -0
- /package/node/{get-bounding-box-.js → geometry/get-bounding-box-.js} +0 -0
- /package/node/{mat.js → mat/mat.js} +0 -0
- /package/src/{circle.ts → geometry/circle.ts} +0 -0
- /package/src/{get-bounding-box-.ts → geometry/get-bounding-box-.ts} +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { findAndAddAll3Prongs } from '../find-3-prong.ts/find-and-add-all-3-prongs.js';
|
|
2
|
+
import { createInitialCpGraph } from './create-initial-cp-graph.js';
|
|
3
|
+
import { addDebugInfo1, addDebugInfo2, addDebugInfo3, addDebugInfo4 } from './add-debug-info.js';
|
|
4
|
+
import { getSharpCornersOnLoop } from './get-sharp-corners.js';
|
|
5
|
+
import { getDullCornersOnLoop } from './get-dull-corners.js';
|
|
6
|
+
import { findAndAdd2ProngsOnAllPaths } from '../find-2-prong/find-and-add-2-prongs-on-all-paths.js';
|
|
7
|
+
import { getFor2ProngsOnLoop } from './get-for-2-prongs-on-loop.js';
|
|
8
|
+
import { getFor1ProngsOnLoop } from './get-for-1-prongs-on-loop.js';
|
|
9
|
+
import { findAndAddHoleClosing2Prongs } from '../find-2-prong/find-and-add-hole-closing-2-prongs.js';
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
* Find the MAT of the given loops.
|
|
13
|
+
* @param loops The loops (that as a precondition must be ordered from highest
|
|
14
|
+
* (i.e. smallest y-value) topmost point loops to lowest)
|
|
15
|
+
*/
|
|
16
|
+
function findMat(loops, minBezLength, maxCurviness, maxLength, maxCoordinate) {
|
|
17
|
+
addDebugInfo1(loops);
|
|
18
|
+
const getSharpCornersOnLoop_ = getSharpCornersOnLoop(minBezLength);
|
|
19
|
+
const getDullCornersOnLoop_ = getDullCornersOnLoop(minBezLength);
|
|
20
|
+
const sharpCornersPerLoop = loops.map(getSharpCornersOnLoop_);
|
|
21
|
+
const dullCornersPerLoop = loops.map(getDullCornersOnLoop_);
|
|
22
|
+
const cpTrees = new Map();
|
|
23
|
+
createInitialCpGraph(loops, cpTrees, sharpCornersPerLoop);
|
|
24
|
+
findAndAddHoleClosing2Prongs(loops, cpTrees, maxCoordinate);
|
|
25
|
+
if (typeof _debug_ !== 'undefined') {
|
|
26
|
+
if (_debug_.directives.stopAfterHoleClosers) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
addDebugInfo2();
|
|
31
|
+
const for1ProngsPerLoop = loops.map(getFor1ProngsOnLoop(minBezLength));
|
|
32
|
+
const for2ProngsPerLoop = loops.map(getFor2ProngsOnLoop(minBezLength, maxCurviness, maxLength));
|
|
33
|
+
let cpNode;
|
|
34
|
+
cpNode = findAndAdd2ProngsOnAllPaths(cpNode, loops, cpTrees, dullCornersPerLoop, maxCoordinate, false);
|
|
35
|
+
cpNode = findAndAdd2ProngsOnAllPaths(cpNode, loops, cpTrees, for1ProngsPerLoop, maxCoordinate, true);
|
|
36
|
+
cpNode = findAndAdd2ProngsOnAllPaths(cpNode, loops, cpTrees, for2ProngsPerLoop, maxCoordinate, false);
|
|
37
|
+
addDebugInfo3();
|
|
38
|
+
if (typeof _debug_ !== 'undefined') {
|
|
39
|
+
if (_debug_.directives.stopAfterTwoProngs) {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (cpNode === undefined) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
findAndAddAll3Prongs(cpTrees, cpNode, maxCoordinate);
|
|
47
|
+
if (typeof _debug_ !== 'undefined') {
|
|
48
|
+
if (_debug_.directives.stopAfterThreeProngs) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const mat = { cpNode, cpTrees };
|
|
53
|
+
addDebugInfo4(mat);
|
|
54
|
+
return mat;
|
|
55
|
+
}
|
|
56
|
+
export { findMat };
|
|
57
|
+
//# sourceMappingURL=find-mat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-mat.js","sourceRoot":"","sources":["../../src/find-mat/find-mat.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iDAAi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
+
import { getSizeParams } from './get-size-params.js';
|
|
4
|
+
/**
|
|
5
|
+
* Finds and returns the Medial Axis Transforms (MATs) from the given array of
|
|
6
|
+
* bezier loops representing shape boundaries.
|
|
7
|
+
*
|
|
8
|
+
* @param bezierLoops An array of (possibly intersecting) loops with each loop
|
|
9
|
+
* representing one or more piecewise smooth closed curves (i.e. shapes). Each
|
|
10
|
+
* loop consists of an array of beziers represented by an array of control
|
|
11
|
+
* points with 2,3 or 4 elements corresponding to linear, quadratic and cubic
|
|
12
|
+
* beziers respectively. Each point is a two-element array (ordered pair), the
|
|
13
|
+
* first of which is the x-coordinate and the second the y-coordinate.
|
|
14
|
+
*
|
|
15
|
+
* @param maxCurviness The maximum value the 'curviness' of a curve can have
|
|
16
|
+
* before an additional MAT point is inserted in between. Defaults to 0.4.
|
|
17
|
+
* (Curviness is measured as the total angle in radians between the consecutive
|
|
18
|
+
* vectors formed by the ordered control points of th bezier curve). The value
|
|
19
|
+
* is clipped in the range `[0.05,3]`.
|
|
20
|
+
* @param maxLength The maximum length a curve can have before an additional MAT
|
|
21
|
+
* point is inserted. This value is scaled to a reference 1024 x 1024
|
|
22
|
+
* grid (e.g. if the shape fits in a 512 x 512 axis-aligned box the value will be
|
|
23
|
+
* halved, e.g. from 10 to 5). Together with maxCurviness it represents a
|
|
24
|
+
* tolerance for the accuracy of the MAT. Defaults to 4. The value is clipped
|
|
25
|
+
* in [1,100].
|
|
26
|
+
*/
|
|
27
|
+
function findMats(bezierLoops, maxCurviness = 0.4, maxLength = 4) {
|
|
28
|
+
// if (typeof _debug_ !== 'undefined') { var timingStart = performance.now(); }
|
|
29
|
+
let maxCoordinate;
|
|
30
|
+
let minBezLength;
|
|
31
|
+
({ maxCurviness, maxLength, maxCoordinate, minBezLength } =
|
|
32
|
+
getSizeParams(bezierLoops, maxCurviness, maxLength));
|
|
33
|
+
const loopss = simplifyPaths(bezierLoops);
|
|
34
|
+
// console.log(loopsToSvgPathStr(bezierLoops.map(v => v.map(v => v.map(v => v.map(v => v*2**4))))));
|
|
35
|
+
// console.log(loopsToSvgPathStr(loopss[0].map(loop => loop.beziers)));
|
|
36
|
+
const mats = [];
|
|
37
|
+
for (const loops of loopss) {
|
|
38
|
+
const mat = findMat(loops, minBezLength, maxCurviness, maxLength, maxCoordinate);
|
|
39
|
+
if (mat) {
|
|
40
|
+
mats.push(mat);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return mats;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Returns an SVG path string representation of the given bezier loops.
|
|
47
|
+
* @param loops An array of loops having an array of bezier curves each given as
|
|
48
|
+
* an array of control points.
|
|
49
|
+
*/
|
|
50
|
+
function loopsToSvgPathStr(loops) {
|
|
51
|
+
let str = '';
|
|
52
|
+
for (const loop of loops) {
|
|
53
|
+
str = str + beziersToSvgPathStr(loop) + '\n';
|
|
54
|
+
}
|
|
55
|
+
return str;
|
|
56
|
+
}
|
|
57
|
+
export { findMats };
|
|
58
|
+
//# sourceMappingURL=find-mats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-mats.js","sourceRoot":"","sources":["../../src/find-mat/find-mats.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjE,OAAO,EAAE,OAAO,EAAG,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAS,QAAQ,CACf,WAA2B,EAC3B,YAAY,GAAG,GAAG,EACZ,SAAS,GAAG,CAAC;IAEpB,+EAA+E;IAE/E,IAAI,aAAqB,CAAC;IAC1B,IAAI,YAAoB,CAAC;IACzB,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE;QACxD,aAAa,CAAC,WAAW,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC;IAEtD,MAAM,MAAM,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;IAC1C,oGAAoG;IACpG,uEAAuE;IAEvE,MAAM,IAAI,GAAU,EAAE,CAAC;IACvB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC3B,MAAM,GAAG,GAAG,OAAO,CAClB,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,aAAa,CACb,CAAC;QACF,IAAI,GAAG,EAAE;YAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAAE;KAC5B;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAGD;;;;GAIG;AACH,SAAS,iBAAiB,CACxB,KAAqB;IAEtB,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACzB,GAAG,GAAG,GAAG,GAAG,mBAAmB,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;KAC7C;IAED,OAAO,GAAG,CAAC;AACZ,CAAC;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*
|
|
4
|
+
* Use only for debugging. Check all nodes around the loop.
|
|
5
|
+
*/
|
|
6
|
+
function fixOrdering(cpNode) {
|
|
7
|
+
const cpStart = cpNode;
|
|
8
|
+
/* holeCloser order causes an issue here
|
|
9
|
+
{
|
|
10
|
+
const cpNodes = getAllOnLoop(cpStart);
|
|
11
|
+
|
|
12
|
+
cpNodes.sort(cpNodeComparator);
|
|
13
|
+
// console.log(cpNodes.map(cpn => enhanceCpNode(cpn).ordering))
|
|
14
|
+
|
|
15
|
+
const len = cpNodes.length;
|
|
16
|
+
for (let i=0; i<len; i++) {
|
|
17
|
+
const cpNode = cpNodes[i];
|
|
18
|
+
const prev = cpNodes[(i + len - 1)%len];
|
|
19
|
+
const next = cpNodes[(i + len + 1)%len];
|
|
20
|
+
if (cpNode.prev !== prev) {
|
|
21
|
+
// console.log(enhanceCpNode(cpNode));
|
|
22
|
+
}
|
|
23
|
+
if (cpNode.next !== next) {
|
|
24
|
+
// console.log(enhanceCpNode(cpNode));
|
|
25
|
+
}
|
|
26
|
+
// cpNode.prev = prev;
|
|
27
|
+
// cpNode.next = next;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
*/
|
|
31
|
+
/*
|
|
32
|
+
{
|
|
33
|
+
let cpNode2 = cpStart.next;
|
|
34
|
+
while (cpNode2 !== cpStart) {
|
|
35
|
+
const cpNode1 = cpNode2;
|
|
36
|
+
cpNode2 = cpNode2.next;
|
|
37
|
+
|
|
38
|
+
const c = cpNodeComparator(cpNode1, cpNode2)!;
|
|
39
|
+
const looplen = cpNode1.cp.pointOnShape.curve.loop.beziers.length;
|
|
40
|
+
if (c > 0 && !cpNode1.isHoleClosing && !cpNode2.isHoleClosing) {
|
|
41
|
+
const o1 = cpNode1.cp.pointOnShape.curve.idx;
|
|
42
|
+
const o2 = cpNode2.cp.pointOnShape.curve.idx;
|
|
43
|
+
if (if) {
|
|
44
|
+
1;
|
|
45
|
+
} else {
|
|
46
|
+
console.log('ORDER IS WRONG!', looplen, o1, o2)
|
|
47
|
+
console.log(c);
|
|
48
|
+
console.log(enhanceCpNode(cpNode1));
|
|
49
|
+
console.log(enhanceCpNode(cpNode2));
|
|
50
|
+
console.log('');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
*/
|
|
56
|
+
// return cpNodes;
|
|
57
|
+
}
|
|
58
|
+
export { fixOrdering };
|
|
59
|
+
//# sourceMappingURL=fix-ordering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-ordering.js","sourceRoot":"","sources":["../../src/find-mat/fix-ordering.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,SAAS,WAAW,CACZ,MAAc;IAElB,MAAM,OAAO,GAAG,MAAM,CAAC;IAEvB;;;;;;;;;;;;;;;;;;;;;;MAsBE;IAEF;;;;;;;;;;;;;;;;;;;;;;;;MAwBE;IAEL,kBAAkB;AACnB,CAAC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createPos } from '../point-on-shape/create-pos.js';
|
|
2
|
+
import { getCornerAtEnd } from '../curve/curve.js';
|
|
3
|
+
import { controlPointLinesLength } from 'flo-bezier3';
|
|
4
|
+
/** @internal */
|
|
5
|
+
function getDullCornersOnLoop(minBezLength) {
|
|
6
|
+
return (loop) => {
|
|
7
|
+
const dullCorners = [];
|
|
8
|
+
for (let i = 0; i < loop.curves.length; i++) {
|
|
9
|
+
const curve = loop.curves[i];
|
|
10
|
+
if (controlPointLinesLength(curve.ps) < minBezLength) {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
if (getCornerAtEnd(curve).isQuiteDull) {
|
|
14
|
+
dullCorners.push(createPos(curve, 1, true));
|
|
15
|
+
dullCorners.push(createPos(curve.next, 0, true));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return dullCorners;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export { getDullCornersOnLoop };
|
|
22
|
+
//# sourceMappingURL=get-dull-corners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-dull-corners.js","sourceRoot":"","sources":["../../src/find-mat/get-dull-corners.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAGtD,gBAAgB;AAChB,SAAS,oBAAoB,CACrB,YAAoB;IAExB,OAAO,CAAC,IAAU,EAAE,EAAE;QAClB,MAAM,WAAW,GAAmB,EAAE,CAAC;QAEvC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAE7B,IAAI,uBAAuB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE;gBAClD,SAAS;aACZ;YAED,IAAI,cAAc,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE;gBACnC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;gBAC5C,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;aACpD;SACJ;QAED,OAAO,WAAW,CAAC;IACvB,CAAC,CAAA;AACL,CAAC;AAID,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Loop } from 'flo-boolean';
|
|
2
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* Get useful points on the shape - these incude points of maximum curvature and
|
|
6
|
+
* points at the bezier-bezier interfaces.
|
|
7
|
+
* @param loop
|
|
8
|
+
* @param additionalPointCount
|
|
9
|
+
*/
|
|
10
|
+
declare function getFor1ProngsOnLoop(minBezLength: number): (loop: Loop) => PointOnShape[];
|
|
11
|
+
export { getFor1ProngsOnLoop };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { getCurvatureExtremaDd, controlPointLinesLength } from 'flo-bezier3';
|
|
2
|
+
import { createPos } from '../point-on-shape/create-pos.js';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* Get useful points on the shape - these incude points of maximum curvature and
|
|
6
|
+
* points at the bezier-bezier interfaces.
|
|
7
|
+
* @param loop
|
|
8
|
+
* @param additionalPointCount
|
|
9
|
+
*/
|
|
10
|
+
function getFor1ProngsOnLoop(minBezLength) {
|
|
11
|
+
return function (loop) {
|
|
12
|
+
const for1Prongs = [];
|
|
13
|
+
for (let i = 0; i < loop.curves.length; i++) {
|
|
14
|
+
const curve = loop.curves[i];
|
|
15
|
+
if (controlPointLinesLength(curve.ps) < minBezLength) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
// const { minima, maxima } = getCurvatureExtrema(curve.ps);
|
|
19
|
+
const { minima, maxima } = getCurvatureExtremaDd(curve.ps);
|
|
20
|
+
// const { minima, maxima } = getCurvatureExtremaE(curve.ps);
|
|
21
|
+
const maxAbsCurvatures = [...minima, ...maxima].map(t => createPos(curve, t, true));
|
|
22
|
+
for1Prongs.push(...maxAbsCurvatures);
|
|
23
|
+
}
|
|
24
|
+
return for1Prongs;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export { getFor1ProngsOnLoop };
|
|
28
|
+
//# sourceMappingURL=get-for-1-prongs-on-loop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-for-1-prongs-on-loop.js","sourceRoot":"","sources":["../../src/find-mat/get-for-1-prongs-on-loop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAwB,uBAAuB,EAAuB,MAAM,aAAa,CAAC;AAGxH,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAG5D;;;;;;GAMG;AACH,SAAS,mBAAmB,CACpB,YAAoB;IAExB,OAAO,UAAS,IAAU;QACtB,MAAM,UAAU,GAAmB,EAAE,CAAC;QAEtC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAE7B,IAAI,uBAAuB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE;gBAClD,SAAS;aACZ;YAED,4DAA4D;YAC5D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC3D,6DAA6D;YAC7D,MAAM,gBAAgB,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;YAEpF,UAAU,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAC;SACxC;QAED,OAAO,UAAU,CAAC;IACtB,CAAC,CAAA;AACL,CAAC;AAGD,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Loop } from 'flo-boolean';
|
|
2
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* Get useful points on the shape - these incude points of maximum curvature and
|
|
6
|
+
* points at the bezier-bezier interfaces.
|
|
7
|
+
* @param loop
|
|
8
|
+
* @param additionalPointCount
|
|
9
|
+
*/
|
|
10
|
+
declare function getFor2ProngsOnLoop(minBezLength: number, maxCurviness: number, maxLength: number): (loop: Loop) => PointOnShape[];
|
|
11
|
+
export { getFor2ProngsOnLoop };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { splitByCurvatureAndLength, controlPointLinesLength } from 'flo-bezier3';
|
|
2
|
+
import { createPos } from '../point-on-shape/create-pos.js';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* Get useful points on the shape - these incude points of maximum curvature and
|
|
6
|
+
* points at the bezier-bezier interfaces.
|
|
7
|
+
* @param loop
|
|
8
|
+
* @param additionalPointCount
|
|
9
|
+
*/
|
|
10
|
+
function getFor2ProngsOnLoop(minBezLength, maxCurviness, maxLength) {
|
|
11
|
+
return function (loop) {
|
|
12
|
+
const for2Prongs = [];
|
|
13
|
+
for (let i = 0; i < loop.curves.length; i++) {
|
|
14
|
+
const curve = loop.curves[i];
|
|
15
|
+
if (controlPointLinesLength(curve.ps) < minBezLength) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
let ts = splitByCurvatureAndLength(curve.ps, maxCurviness, maxLength);
|
|
19
|
+
// add at least one in the middle
|
|
20
|
+
if (ts.length === 2) {
|
|
21
|
+
ts = [0, 0.5, 1];
|
|
22
|
+
}
|
|
23
|
+
const byCurvatureAndLength = ts.slice(1, ts.length - 1).map(t => createPos(curve, t, true));
|
|
24
|
+
for2Prongs.push(...byCurvatureAndLength);
|
|
25
|
+
}
|
|
26
|
+
return for2Prongs;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export { getFor2ProngsOnLoop };
|
|
30
|
+
//# sourceMappingURL=get-for-2-prongs-on-loop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-for-2-prongs-on-loop.js","sourceRoot":"","sources":["../../src/find-mat/get-for-2-prongs-on-loop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAGjF,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAG5D;;;;;;GAMG;AACH,SAAS,mBAAmB,CACpB,YAAoB,EACpB,YAAoB,EACpB,SAAiB;IAErB,OAAO,UAAS,IAAU;QACtB,MAAM,UAAU,GAAmB,EAAE,CAAC;QAEtC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAE7B,IAAI,uBAAuB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE;gBAClD,SAAS;aACZ;YAED,IAAI,EAAE,GAAG,yBAAyB,CAAC,KAAK,CAAC,EAAE,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;YACtE,iCAAiC;YACjC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;gBAAE,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;aAAE;YAE1C,MAAM,oBAAoB,GACtB,EAAE,CAAC,KAAK,CAAC,CAAC,EAAC,EAAE,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;YAEhE,UAAU,CAAC,IAAI,CAAC,GAAG,oBAAoB,CAAC,CAAC;SAC5C;QAED,OAAO,UAAU,CAAC;IACtB,CAAC,CAAA;AACL,CAAC;AAGD,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createPos } from '../point-on-shape/create-pos.js';
|
|
2
|
+
import { getCornerAtEnd } from '../curve/curve.js';
|
|
3
|
+
import { controlPointLinesLength } from 'flo-bezier3';
|
|
4
|
+
/** @internal */
|
|
5
|
+
function getSharpCornersOnLoop(minBezLength) {
|
|
6
|
+
return (loop) => {
|
|
7
|
+
const sharpCorners = [];
|
|
8
|
+
for (let i = 0; i < loop.curves.length; i++) {
|
|
9
|
+
const curve = loop.curves[i];
|
|
10
|
+
if (controlPointLinesLength(curve.ps) < minBezLength) {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
if (getCornerAtEnd(curve).isQuiteSharp) {
|
|
14
|
+
sharpCorners.push(createPos(curve, 1, true));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return sharpCorners;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export { getSharpCornersOnLoop };
|
|
21
|
+
//# sourceMappingURL=get-sharp-corners.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-sharp-corners.js","sourceRoot":"","sources":["../../src/find-mat/get-sharp-corners.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAGtD,gBAAgB;AAChB,SAAS,qBAAqB,CACtB,YAAoB;IAExB,OAAO,CAAC,IAAU,EAAE,EAAE;QAClB,MAAM,YAAY,GAAmB,EAAE,CAAC;QAExC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAE7B,IAAI,uBAAuB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE;gBAClD,SAAS;aACZ;YAED,IAAI,cAAc,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE;gBACpC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;aAChD;SACJ;QAED,OAAO,YAAY,CAAC;IACxB,CAAC,CAAA;AACL,CAAC;AAID,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { getLoopsMetrics } from '../loop/get-max-coordinate.js';
|
|
2
|
+
function getSizeParams(bezierLoops, maxCurviness, maxLength) {
|
|
3
|
+
// Gather some shape metrics
|
|
4
|
+
const { maxCoordinate, maxRadius } = getLoopsMetrics(bezierLoops);
|
|
5
|
+
const expMax = Math.ceil(Math.log2(maxCoordinate));
|
|
6
|
+
const minBezLengthSigBits = 16;
|
|
7
|
+
/**
|
|
8
|
+
* If a curve is shorter than this value then no points on it will be
|
|
9
|
+
* selected for the purpose of finding the MAT.
|
|
10
|
+
*/
|
|
11
|
+
const minBezLength = 2 ** expMax * 2 ** (-minBezLengthSigBits);
|
|
12
|
+
// Limit the tolerance to a reasonable level
|
|
13
|
+
if (maxCurviness < 0.05) {
|
|
14
|
+
maxCurviness = 0.05;
|
|
15
|
+
}
|
|
16
|
+
if (maxCurviness > 3) {
|
|
17
|
+
maxCurviness = 3;
|
|
18
|
+
}
|
|
19
|
+
// Limit the tolerance to a reasonable level
|
|
20
|
+
if (maxLength < 0.1) {
|
|
21
|
+
maxLength = 0.1;
|
|
22
|
+
}
|
|
23
|
+
if (maxLength > 100) {
|
|
24
|
+
maxLength = 100;
|
|
25
|
+
}
|
|
26
|
+
// Adjust length tolerance according to a reference max coordinate
|
|
27
|
+
const expMaxRadius = Math.ceil(Math.log2(maxRadius));
|
|
28
|
+
const maxLengthSigBits = 10; // 1024 x 1024
|
|
29
|
+
maxLength = maxLength * (2 ** expMaxRadius * 2 ** (-maxLengthSigBits));
|
|
30
|
+
return { maxCurviness, maxLength, maxCoordinate, minBezLength };
|
|
31
|
+
}
|
|
32
|
+
export { getSizeParams };
|
|
33
|
+
//# sourceMappingURL=get-size-params.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-size-params.js","sourceRoot":"","sources":["../../src/find-mat/get-size-params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE,SAAS,aAAa,CACd,WAA2B,EAC3B,YAAoB,EACpB,SAAiB;IAErB,4BAA4B;IAC5B,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IACnD,MAAM,mBAAmB,GAAG,EAAE,CAAC;IAC/B;;;OAGG;IACH,MAAM,YAAY,GAAG,CAAC,IAAE,MAAM,GAAG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AC;KAChB;IAED,MAAM,CAAC,GAAG,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC;IACjC,MAAM,CAAC,GAAG,EAAE,GAAC,EAAE,CAAC;IAEhB,OAAO,CAAC,GAAG,CAAC,CAAC;AACjB,CAAC;AAGD;;;GAGG;AACH,SAAS,QAAQ,CAAC,MAAc;IAC5B,OAAO,KAAK,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC1D,CAAC;AAED,OAAO,EAAU,WAAW,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-bounding-box-.js","sourceRoot":"","sources":["../../src/geometry/get-bounding-box-.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAGhD,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-closest-square-distance-to-rect.js","sourceRoot":"","sources":["../../src/geometry/get-closest-square-distance-to-rect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,IAAI,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEjF,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAGvD;;GAEG;AACH,SAAS,8BAA8B,CACrC,GAAe,EAAE,CAAW;IAE7B,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAClB,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;IAClB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;IAC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AAC;KACT;AACF,CAAC;AAGD,OAAO,EAAE,8BAA8B,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { squaredDistanceBetweenPointAndLineSegment, squaredDistanceBetween } from 'flo-vector2d';
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @internal
|
|
4
4
|
*/
|
|
5
5
|
function getClosestSquaredDistanceToRotatedRect(ps, p) {
|
|
6
6
|
const ds = [0, 1, 2, 3].map(i => squaredDistanceBetweenPointAndLineSegment(p, [ps[i], ps[(i + 1) % 4]]));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-closest-squared-distance-to-rotated-rect.js","sourceRoot":"","sources":["../../src/geometry/get-closest-squared-distance-to-rotated-rect.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,yCAAyC,EAAE,sBAAsB,EACjE,MAAM,cAAc,CAAC;AAGtB;;GAEG;AACH,SAAS,sCAAsC,CAAC,EAAc,EAAE,CAAW;IAC1E,MAAM,EAAE,GAAG,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,yCAAyC,CACrE,CAAC,EACD,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CACxB,CACD,CAAC;IAEF,MAAM,KAAK,GAAI,sBAAsB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,sBAAsB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpD,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM;QACrC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAK,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE;QAEnC,OAAO,CAAC,CAAC,CAAC,sBAAsB;KAChC;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;AACxB,CAAC;AAGD,OAAO,EAAE,sCAAsC,EAAE,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { fromTo, dot, cross, rotate90Degrees, interpolate, translate, lineLineIntersection } from 'flo-vector2d';
|
|
2
2
|
import { getEdgeDirection } from './get-edge-direction.js';
|
|
3
|
-
/** @
|
|
3
|
+
/** @internal */
|
|
4
4
|
const TOLERANCE_ADD_2PRONG = 0.01;
|
|
5
|
-
/** @
|
|
5
|
+
/** @internal */
|
|
6
6
|
const TOLERANCE_USE_LINE = 0.0001; // else cubic
|
|
7
7
|
/**
|
|
8
8
|
* Returns the bezier curve from the maximal disk of one [[CpNode]] to another
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-curve-between.js","sourceRoot":"","sources":["../../src/get-curve/get-curve-between.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAC3D,oBAAoB,EACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,
|
|
1
|
+
{"version":3,"file":"get-curve-between.js","sourceRoot":"","sources":["../../src/get-curve/get-curve-between.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,SAAS,EAC3D,oBAAoB,EACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,gBAAgB;AAChB,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAClC,gBAAgB;AAChB,MAAM,kBAAkB,GAAG,MAAM,CA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,eAAe,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CpNode } from '../cp-node.js';
|
|
1
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @internal
|
|
4
4
|
* Returns a line segment of unit length starting in the given Vertex center and
|
|
5
5
|
* pointing in the direction of the medial axis (viewed as a rooted tree).
|
|
6
6
|
* @param cpNode
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { toUnitVector, fromTo, rotate, translate, rotate90Degrees, reverse, dot } from 'flo-vector2d';
|
|
2
2
|
import { tangent } from 'flo-bezier3';
|
|
3
|
-
import { isPosSharpCorner } from '../point-on-shape.js';
|
|
3
|
+
import { isPosSharpCorner } from '../point-on-shape/is-pos-sharp-corner.js';
|
|
4
4
|
/**
|
|
5
|
-
* @
|
|
5
|
+
* @internal
|
|
6
6
|
* Returns a line segment of unit length starting in the given Vertex center and
|
|
7
7
|
* pointing in the direction of the medial axis (viewed as a rooted tree).
|
|
8
8
|
* @param cpNode
|
|
@@ -16,7 +16,6 @@ function getEdgeDirection(cpNode) {
|
|
|
16
16
|
const p1 = pos1.p;
|
|
17
17
|
const p2 = pos2.p;
|
|
18
18
|
let vDir;
|
|
19
|
-
//if (!PointOnShape.isSharpCorner(pos1)) {
|
|
20
19
|
if (!isPosSharpCorner(pos1)) {
|
|
21
20
|
if (p1[0] === p2[0] && p1[1] === p2[1]) {
|
|
22
21
|
vDir = fromTo(p1, circleCenter); // A 1-prong
|
|
@@ -28,7 +27,6 @@ function getEdgeDirection(cpNode) {
|
|
|
28
27
|
else {
|
|
29
28
|
let curve1;
|
|
30
29
|
let curve2;
|
|
31
|
-
// TODO - test if pos1.t can ever be 0 - it is terminating
|
|
32
30
|
if (pos1.t === 0) {
|
|
33
31
|
curve1 = pos1.curve;
|
|
34
32
|
curve2 = pos1.curve.prev;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-edge-direction.js","sourceRoot":"","sources":["../../src/get-curve/get-edge-direction.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EACzE,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"get-edge-direction.js","sourceRoot":"","sources":["../../src/get-curve/get-edge-direction.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EACzE,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAI5E;;;;;GAKG;AACH,SAAS,gBAAgB,CAAC,MAAc;IACpC,MAAM,YAAY,GAAG,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;IAE7C,MAAM,GAAG,GAAG,MAAM,CAAC;IACnB,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC;IAEhC,MAAM,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC,YAAY,CAAC;IACjC,MAAM,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC,YAAY,CAAC;IAEjC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IAClB,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IAElB,IAAI,IAAI,CAAC;IAET,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE;QACzB,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE;YACpC,IAAI,GAAG,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Y,EAAE,CAAC,CAAC,CAAC;AAC7B,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
package/node/index.d.ts
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { beziersToSvgPathStr, getPathsFromStr } from 'flo-boolean';
|
|
2
|
-
import { Mat } from './mat.js';
|
|
3
|
-
import { Loop } from '
|
|
4
|
-
import { Curve } from './curve.js';
|
|
5
|
-
import { CpNode } from './cp-node.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { Mat } from './mat/mat.js';
|
|
3
|
+
import { Loop } from 'flo-boolean';
|
|
4
|
+
import { Curve } from './curve/curve.js';
|
|
5
|
+
import { CpNode, matCurveToNextVertex, getChildren, vertexChildren, getAllOnLoop, insertCpNode, getCpNodesOnCircle, isOnSameCircle, isTerminating, isFullyTerminating, getFirstExit, isSharp, getProngCount, getRealProngCount, cpNodeComparator, removeCpNode } from './cp-node/cp-node.js';
|
|
6
|
+
import { createCpNode } from './cp-node/create-cp-node.js';
|
|
7
|
+
import { enhanceCpNode } from './cp-node/enhance-cp-node.js';
|
|
8
|
+
import { traverseCp } from './cp-node/traverse-cp.js';
|
|
9
|
+
import { PointOnShape } from './point-on-shape/point-on-shape.js';
|
|
10
|
+
import { createPos } from './point-on-shape/create-pos.js';
|
|
11
|
+
import { Circle } from './geometry/circle.js';
|
|
12
|
+
import { ContactPoint } from './contact-point/contact-point.js';
|
|
9
13
|
import { BezierPiece } from './mat/bezier-piece.js';
|
|
10
|
-
import { findMats } from './find-mats.js';
|
|
14
|
+
import { findMats } from './find-mat/find-mats.js';
|
|
11
15
|
import { trimMat } from './mat/trim-mat.js';
|
|
12
|
-
import { toScaleAxis } from './to-scale-axis.js';
|
|
13
|
-
import { traverseEdges } from './traverse-edges.js';
|
|
14
|
-
import { getBranches } from './get-branches.js';
|
|
15
|
-
import { traverseVertices } from './traverse-vertices.js';
|
|
16
|
+
import { toScaleAxis } from './sat/to-scale-axis.js';
|
|
17
|
+
import { traverseEdges } from './cp-node/traverse-edges.js';
|
|
18
|
+
import { getBranches } from './mat/get-branches.js';
|
|
19
|
+
import { traverseVertices } from './cp-node/traverse-vertices.js';
|
|
16
20
|
import { Debug, enableDebugForMat } from './debug/debug.js';
|
|
17
21
|
import { drawBranch } from './debug/functions/draw-elem/branch.js';
|
|
18
22
|
import { drawMat } from './debug/functions/draw-elem/mat.js';
|
|
@@ -20,17 +24,17 @@ import { IDebugElems } from './debug/debug-elem-types.js';
|
|
|
20
24
|
import { TDrawElemFunctions } from './debug/functions/draw-elem/draw-elem.js';
|
|
21
25
|
import { ICpNodeForDebugging } from './debug/cp-node-for-debugging.js';
|
|
22
26
|
import { ITiming } from './debug/debug.js';
|
|
23
|
-
import {
|
|
27
|
+
import { getClosestBoundaryPointCertified } from './closest-boundary-point/get-closest-boundary-point-certified.js';
|
|
24
28
|
import { getShapeBounds } from './svg/get-shape-bounds.js';
|
|
25
|
-
import { getBoundaryBeziersToNext } from './get-boundary-beziers-to-next.js';
|
|
26
|
-
import { getBoundaryBezierPartsToNext } from './get-boundary-bezier-parts-to-next.js';
|
|
29
|
+
import { getBoundaryBeziersToNext } from './cp-node/get-boundary-beziers-to-next.js';
|
|
30
|
+
import { getBoundaryBezierPartsToNext } from './cp-node/get-boundary-bezier-parts-to-next.js';
|
|
27
31
|
import { getBoundaryPieceBeziers } from './mat/get-boundary-piece-beziers.js';
|
|
28
|
-
import { simplifyMat } from './simplify-mat.js';
|
|
32
|
+
import { simplifyMat } from './mat/simplify-mat.js';
|
|
29
33
|
import { simplifyMatMapOnly } from './mat/simplify-mat-map-only.js';
|
|
30
34
|
import { drawElemFunctions } from './debug/functions/draw-elem/draw-elem.js';
|
|
31
|
-
import { getCurveToNext } from './get-curve-to-next.js';
|
|
35
|
+
import { getCurveToNext } from './cp-node/get-curve-to-next.js';
|
|
32
36
|
import { getCurveBetween } from './get-curve/get-curve-between.js';
|
|
33
37
|
import { sweepLine } from './sweep-line/sweep-line.js';
|
|
34
|
-
import { getClosestSquareDistanceToRect } from './
|
|
35
|
-
import { loopFromBeziers } from '
|
|
36
|
-
export { Mat, PointOnShape,
|
|
38
|
+
import { getClosestSquareDistanceToRect } from './geometry/get-closest-square-distance-to-rect.js';
|
|
39
|
+
import { loopFromBeziers } from 'flo-boolean';
|
|
40
|
+
export { Mat, PointOnShape, Curve, Loop, CpNode, Circle, ContactPoint, BezierPiece, findMats, toScaleAxis, trimMat, traverseVertices, traverseEdges, getBranches, getBoundaryBeziersToNext, getBoundaryBezierPartsToNext, simplifyMat, simplifyMatMapOnly, createCpNode, matCurveToNextVertex, getChildren, vertexChildren, getAllOnLoop, insertCpNode, getCpNodesOnCircle, isOnSameCircle, isTerminating, isFullyTerminating, getFirstExit, isSharp, getProngCount, getRealProngCount, cpNodeComparator, removeCpNode, enhanceCpNode, traverseCp, beziersToSvgPathStr, getPathsFromStr, getShapeBounds, drawBranch, drawMat, getClosestBoundaryPointCertified, getCurveToNext, getCurveBetween, createPos, Debug, IDebugElems, TDrawElemFunctions, ICpNodeForDebugging, ITiming, getBoundaryPieceBeziers, drawElemFunctions, sweepLine, getClosestSquareDistanceToRect, loopFromBeziers, enableDebugForMat };
|