flo-mat 2.0.4 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.quokka +4 -0
- package/browser/index.js +18434 -14538
- package/browser/index.min.js +1 -1
- package/node/closest-boundary-point/cull-bezier-pieces.d.ts +9 -0
- package/node/closest-boundary-point/cull-bezier-pieces.js +17 -0
- package/node/closest-boundary-point/cull-bezier-pieces.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.js +2 -2
- package/node/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.js +1 -1
- package/node/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.d.ts +25 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.js +68 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.js.map +1 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.d.ts +10 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.js +2 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.js +2 -3
- package/node/closest-boundary-point/get-best-distance-squared.js.map +1 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.d.ts +15 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.js +40 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.d.ts +15 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.js +42 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.js.map +1 -0
- package/node/closest-boundary-point/get-p-from-box.d.ts +3 -0
- package/node/closest-boundary-point/get-p-from-box.js +11 -0
- package/node/closest-boundary-point/get-p-from-box.js.map +1 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.d.ts +12 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js +93 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js.map +1 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.d.ts +13 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js +58 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js.map +1 -0
- package/node/{contact-point.d.ts → contact-point/contact-point.d.ts} +3 -3
- package/node/{contact-point.js → contact-point/contact-point.js} +1 -5
- package/node/contact-point/contact-point.js.map +1 -0
- package/node/{compare-curvatures-at-interface.js → corner/compare-curvatures-at-interface.js} +2 -2
- package/node/corner/compare-curvatures-at-interface.js.map +1 -0
- package/node/{mat → corner}/corner.d.ts +1 -1
- package/node/{mat → corner}/corner.js.map +1 -1
- package/node/corner/get-corner.d.ts +15 -0
- package/node/{curve.js → corner/get-corner.js} +6 -17
- package/node/corner/get-corner.js.map +1 -0
- package/node/{get-interface-ccw.js → corner/get-interface-ccw.js} +18 -33
- package/node/corner/get-interface-ccw.js.map +1 -0
- package/node/cp-node/clone.d.ts +1 -1
- package/node/cp-node/clone.js +6 -4
- package/node/cp-node/clone.js.map +1 -1
- package/node/cp-node/cp-node.d.ts +196 -0
- package/node/cp-node/cp-node.js +249 -0
- package/node/cp-node/cp-node.js.map +1 -0
- package/node/cp-node/create-cp-node.d.ts +4 -0
- package/node/cp-node/create-cp-node.js +8 -0
- package/node/cp-node/create-cp-node.js.map +1 -0
- package/node/cp-node/enhance-cp-node.d.ts +24 -0
- package/node/cp-node/enhance-cp-node.js +20 -0
- package/node/cp-node/enhance-cp-node.js.map +1 -0
- package/node/{get-boundary-bezier-parts-to-next.js → cp-node/get-boundary-bezier-parts-to-next.js} +1 -1
- package/node/cp-node/get-boundary-bezier-parts-to-next.js.map +1 -0
- package/node/{get-boundary-beziers-to-next.d.ts → cp-node/get-boundary-beziers-to-next.d.ts} +1 -1
- package/node/{get-boundary-beziers-to-next.js → cp-node/get-boundary-beziers-to-next.js} +1 -1
- package/node/cp-node/get-boundary-beziers-to-next.js.map +1 -0
- package/node/cp-node/get-cp-node-ordering.d.ts +8 -0
- package/node/cp-node/get-cp-node-ordering.js +12 -0
- package/node/cp-node/get-cp-node-ordering.js.map +1 -0
- package/node/{get-curve-to-next.js → cp-node/get-curve-to-next.js} +1 -1
- package/node/cp-node/get-curve-to-next.js.map +1 -0
- package/node/cp-node/remove.d.ts +1 -1
- package/node/cp-node/traverse-cp.d.ts +12 -0
- package/node/cp-node/traverse-cp.js +26 -0
- package/node/cp-node/traverse-cp.js.map +1 -0
- package/node/{traverse-edges.js → cp-node/traverse-edges.js} +4 -3
- package/node/cp-node/traverse-edges.js.map +1 -0
- package/node/{traverse-vertices.js → cp-node/traverse-vertices.js} +4 -3
- package/node/cp-node/traverse-vertices.js.map +1 -0
- package/node/{curve.d.ts → curve/curve.d.ts} +4 -17
- package/node/curve/curve.js +14 -0
- package/node/curve/curve.js.map +1 -0
- package/node/debug/cp-node-for-debugging.d.ts +2 -2
- package/node/debug/debug-elem-types.d.ts +8 -8
- package/node/debug/debug.d.ts +6 -6
- package/node/debug/debug.js +2 -2
- package/node/debug/debug.js.map +1 -1
- package/node/debug/functions/draw-elem/bounding-hull.d.ts +2 -2
- package/node/debug/functions/draw-elem/bounding-hull.js +3 -3
- package/node/debug/functions/draw-elem/bounding-hull.js.map +1 -1
- package/node/debug/functions/draw-elem/branch.d.ts +2 -2
- package/node/debug/functions/draw-elem/branch.js +4 -3
- package/node/debug/functions/draw-elem/branch.js.map +1 -1
- package/node/debug/functions/draw-elem/culls.d.ts +2 -2
- package/node/debug/functions/draw-elem/culls.js +2 -2
- package/node/debug/functions/draw-elem/culls.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.js +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-elem.d.ts +3 -3
- package/node/debug/functions/draw-elem/draw-elem.js +3 -3
- package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
- package/node/debug/functions/draw-elem/dull-corner.d.ts +3 -3
- package/node/debug/functions/draw-elem/dull-corner.js +3 -4
- package/node/debug/functions/draw-elem/dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/leaves.d.ts +2 -2
- package/node/debug/functions/draw-elem/leaves.js +1 -1
- package/node/debug/functions/draw-elem/leaves.js.map +1 -1
- package/node/debug/functions/draw-elem/loop.d.ts +2 -2
- package/node/debug/functions/draw-elem/loop.js +1 -2
- package/node/debug/functions/draw-elem/loop.js.map +1 -1
- package/node/debug/functions/draw-elem/loops.d.ts +1 -1
- package/node/debug/functions/draw-elem/loops.js +0 -1
- package/node/debug/functions/draw-elem/loops.js.map +1 -1
- package/node/debug/functions/draw-elem/loose-bounding-box.d.ts +2 -2
- package/node/debug/functions/draw-elem/loose-bounding-box.js +3 -3
- package/node/debug/functions/draw-elem/loose-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/mat.d.ts +3 -3
- package/node/debug/functions/draw-elem/mat.js +9 -7
- package/node/debug/functions/draw-elem/mat.js.map +1 -1
- package/node/debug/functions/draw-elem/max-vertex.d.ts +2 -2
- package/node/debug/functions/draw-elem/max-vertex.js +1 -1
- package/node/debug/functions/draw-elem/max-vertex.js.map +1 -1
- package/node/debug/functions/draw-elem/min-y.d.ts +3 -3
- package/node/debug/functions/draw-elem/min-y.js +2 -6
- package/node/debug/functions/draw-elem/min-y.js.map +1 -1
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.d.ts +2 -2
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js +2 -2
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/one-prong.d.ts +2 -2
- package/node/debug/functions/draw-elem/one-prong.js +6 -11
- package/node/debug/functions/draw-elem/one-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/sharp-corner.d.ts +3 -3
- package/node/debug/functions/draw-elem/sharp-corner.js +3 -4
- package/node/debug/functions/draw-elem/sharp-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/three-prong.d.ts +2 -2
- package/node/debug/functions/draw-elem/three-prong.js +8 -10
- package/node/debug/functions/draw-elem/three-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/tight-bounding-box.d.ts +2 -2
- package/node/debug/functions/draw-elem/tight-bounding-box.js +3 -3
- package/node/debug/functions/draw-elem/tight-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/two-prong.d.ts +2 -2
- package/node/debug/functions/draw-elem/two-prong.js +7 -8
- package/node/debug/functions/draw-elem/two-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/vertex.d.ts +4 -3
- package/node/debug/functions/draw-elem/vertex.js +11 -9
- package/node/debug/functions/draw-elem/vertex.js.map +1 -1
- package/node/debug/functions/general.d.ts +8 -8
- package/node/debug/functions/general.js +8 -8
- package/node/debug/functions/general.js.map +1 -1
- package/node/debug/functions/three-prong.d.ts +2 -2
- package/node/debug/functions/three-prong.js +10 -13
- package/node/debug/functions/three-prong.js.map +1 -1
- package/node/debug/functions/two-prong.d.ts +16 -5
- package/node/debug/functions/two-prong.js +56 -58
- package/node/debug/functions/two-prong.js.map +1 -1
- package/node/debug/three-prong-for-debugging.d.ts +6 -6
- package/node/debug/three-prong-for-debugging.js +1 -1
- package/node/debug/three-prong-for-debugging.js.map +1 -1
- package/node/debug/two-prong-for-debugging.d.ts +7 -7
- package/node/error-analysis/gamma.d.ts +26 -0
- package/node/error-analysis/gamma.js +35 -0
- package/node/error-analysis/gamma.js.map +1 -0
- package/node/find-2-prong/add-1-prong.d.ts +12 -0
- package/node/{mat/find-mat → find-2-prong}/add-1-prong.js +11 -11
- package/node/find-2-prong/add-1-prong.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/add-2-prong.d.ts +6 -9
- package/node/{mat/find-mat → find-2-prong}/add-2-prong.js +26 -74
- package/node/find-2-prong/add-2-prong.js.map +1 -0
- package/node/find-2-prong/add-debug-info.d.ts +8 -0
- package/node/{mat/find-mat/find-2-prong → find-2-prong}/add-debug-info.js +5 -4
- package/node/find-2-prong/add-debug-info.js.map +1 -0
- package/node/find-2-prong/cull-bezier-pieces.d.ts +11 -0
- package/node/find-2-prong/cull-bezier-pieces.js +28 -0
- package/node/find-2-prong/cull-bezier-pieces.js.map +1 -0
- package/node/{mat/find-mat/find-2-prong → find-2-prong}/find-2-prong.d.ts +9 -13
- package/node/find-2-prong/find-2-prong.js +144 -0
- package/node/find-2-prong/find-2-prong.js.map +1 -0
- package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.d.ts +15 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-2-prongs-on-all-paths.js +5 -4
- package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-2-prongs.d.ts +5 -5
- package/node/find-2-prong/find-and-add-2-prongs.js +60 -0
- package/node/find-2-prong/find-and-add-2-prongs.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.d.ts +3 -3
- package/node/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.js +5 -5
- package/node/find-2-prong/find-and-add-hole-closing-2-prongs.js.map +1 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.d.ts +10 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.js +56 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.js.map +1 -0
- package/node/find-2-prong/get-initial-bezier-pieces.d.ts +15 -0
- package/node/find-2-prong/get-initial-bezier-pieces.js +40 -0
- package/node/find-2-prong/get-initial-bezier-pieces.js.map +1 -0
- package/node/find-2-prong/reduce-radius.d.ts +8 -0
- package/node/find-2-prong/reduce-radius.js +72 -0
- package/node/find-2-prong/reduce-radius.js.map +1 -0
- package/node/find-2-prong/squared-distance-between-dd.d.ts +2 -0
- package/node/find-2-prong/squared-distance-between-dd.js +17 -0
- package/node/find-2-prong/squared-distance-between-dd.js.map +1 -0
- package/node/find-2-prong/x-for-debugging.d.ts +9 -0
- package/node/find-2-prong/x-for-debugging.js.map +1 -0
- package/node/{mat/find-mat → find-3-prong.ts}/add-3-prong.d.ts +12 -7
- package/node/find-3-prong.ts/add-3-prong.js +82 -0
- package/node/find-3-prong.ts/add-3-prong.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.d.ts +4 -4
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.js +1 -1
- package/node/find-3-prong.ts/calc-better-x.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.d.ts +3 -3
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.js +5 -7
- package/node/find-3-prong.ts/calc-initial-3-prong-center.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.d.ts +6 -6
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.js +11 -12
- package/node/find-3-prong.ts/find-3-prong-for-delta3s.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong.d.ts +5 -5
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong.js +52 -39
- package/node/find-3-prong.ts/find-3-prong.js.map +1 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.d.ts +5 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.js +74 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.js.map +1 -0
- package/node/{mat/find-mat/find-and-add-3-prongs.d.ts → find-3-prong.ts/find-and-add-all-3-prongs.d.ts} +3 -3
- package/node/find-3-prong.ts/find-and-add-all-3-prongs.js +66 -0
- package/node/find-3-prong.ts/find-and-add-all-3-prongs.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/get-closest-points.d.ts +3 -3
- package/node/find-3-prong.ts/get-closest-points.js +14 -0
- package/node/find-3-prong.ts/get-closest-points.js.map +1 -0
- package/node/{mat/find-mat → find-mat}/add-debug-info.d.ts +4 -4
- package/node/{mat/find-mat → find-mat}/add-debug-info.js +6 -6
- package/node/find-mat/add-debug-info.js.map +1 -0
- package/node/{mat/find-mat → find-mat}/create-initial-cp-graph.d.ts +5 -5
- package/node/{mat/find-mat → find-mat}/create-initial-cp-graph.js +5 -6
- package/node/find-mat/create-initial-cp-graph.js.map +1 -0
- package/node/find-mat/find-mat.d.ts +10 -0
- package/node/find-mat/find-mat.js +57 -0
- package/node/find-mat/find-mat.js.map +1 -0
- package/node/{find-mats.d.ts → find-mat/find-mats.d.ts} +1 -1
- package/node/find-mat/find-mats.js +58 -0
- package/node/find-mat/find-mats.js.map +1 -0
- package/node/find-mat/fix-ordering.d.ts +8 -0
- package/node/find-mat/fix-ordering.js +59 -0
- package/node/find-mat/fix-ordering.js.map +1 -0
- package/node/find-mat/get-dull-corners.d.ts +5 -0
- package/node/find-mat/get-dull-corners.js +22 -0
- package/node/find-mat/get-dull-corners.js.map +1 -0
- package/node/find-mat/get-for-1-prongs-on-loop.d.ts +11 -0
- package/node/find-mat/get-for-1-prongs-on-loop.js +28 -0
- package/node/find-mat/get-for-1-prongs-on-loop.js.map +1 -0
- package/node/find-mat/get-for-2-prongs-on-loop.d.ts +11 -0
- package/node/find-mat/get-for-2-prongs-on-loop.js +30 -0
- package/node/find-mat/get-for-2-prongs-on-loop.js.map +1 -0
- package/node/find-mat/get-sharp-corners.d.ts +5 -0
- package/node/find-mat/get-sharp-corners.js +21 -0
- package/node/find-mat/get-sharp-corners.js.map +1 -0
- package/node/find-mat/get-size-params.d.ts +7 -0
- package/node/find-mat/get-size-params.js +33 -0
- package/node/find-mat/get-size-params.js.map +1 -0
- package/node/geometry/circle.js.map +1 -0
- package/node/geometry/get-bounding-box-.js.map +1 -0
- package/node/{mat/geometry → geometry}/get-closest-square-distance-to-rect.d.ts +1 -1
- package/node/{mat/geometry → geometry}/get-closest-square-distance-to-rect.js +1 -1
- package/node/geometry/get-closest-square-distance-to-rect.js.map +1 -0
- package/node/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.d.ts +1 -1
- package/node/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.js +1 -1
- package/node/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -0
- package/node/get-curve/get-curve-between.d.ts +1 -1
- package/node/get-curve/get-curve-between.js +2 -2
- package/node/get-curve/get-curve-between.js.map +1 -1
- package/node/get-curve/get-edge-direction.d.ts +2 -2
- package/node/get-curve/get-edge-direction.js +2 -4
- package/node/get-curve/get-edge-direction.js.map +1 -1
- package/node/index.d.ts +24 -20
- package/node/index.js +21 -16
- package/node/index.js.map +1 -1
- package/node/loop/get-max-coordinate.d.ts +1 -1
- package/node/loop/get-max-coordinate.js +1 -1
- package/node/mat/add-to-cp-graph.d.ts +8 -7
- package/node/mat/add-to-cp-graph.js +6 -4
- package/node/mat/add-to-cp-graph.js.map +1 -1
- package/node/mat/bezier-piece.d.ts +2 -2
- package/node/mat/create-new-cp-tree.d.ts +3 -3
- package/node/mat/create-new-cp-tree.js +5 -7
- package/node/mat/create-new-cp-tree.js.map +1 -1
- package/node/mat/elem-type-two-prong.d.ts +1 -1
- package/node/mat/get-boundary-piece-beziers.d.ts +2 -2
- package/node/mat/get-boundary-piece-beziers.js +4 -4
- package/node/mat/get-boundary-piece-beziers.js.map +1 -1
- package/node/{get-branches.d.ts → mat/get-branches.d.ts} +1 -1
- package/node/{get-branches.js → mat/get-branches.js} +7 -6
- package/node/mat/get-branches.js.map +1 -0
- package/node/mat/get-largest-vertex.d.ts +2 -2
- package/node/mat/get-largest-vertex.js +1 -1
- package/node/mat/get-largest-vertex.js.map +1 -1
- package/node/mat/get-neighboring-cps.d.ts +6 -4
- package/node/mat/get-neighboring-cps.js +5 -3
- package/node/mat/get-neighboring-cps.js.map +1 -1
- package/node/mat/get-two-prong-type.d.ts +1 -1
- package/node/mat/get-two-prong-type.js +1 -1
- package/node/mat/get-two-prong-type.js.map +1 -1
- package/node/mat/is-another-cp-closeby.d.ts +9 -8
- package/node/mat/is-another-cp-closeby.js +21 -29
- package/node/mat/is-another-cp-closeby.js.map +1 -1
- package/node/{mat.d.ts → mat/mat.d.ts} +2 -2
- package/node/mat/mat.js.map +1 -0
- package/node/mat/simplify-mat-map-only.d.ts +1 -1
- package/node/mat/simplify-mat-map-only.js +4 -3
- package/node/mat/simplify-mat-map-only.js.map +1 -1
- package/node/{simplify-mat.d.ts → mat/simplify-mat.d.ts} +3 -5
- package/node/{simplify-mat.js → mat/simplify-mat.js} +11 -13
- package/node/mat/simplify-mat.js.map +1 -0
- package/node/mat/trim-mat.d.ts +1 -1
- package/node/mat/trim-mat.js +1 -1
- package/node/mat/trim-mat.js.map +1 -1
- package/node/point-on-shape/calc-pos-order.d.ts +13 -0
- package/node/point-on-shape/calc-pos-order.js +27 -0
- package/node/point-on-shape/calc-pos-order.js.map +1 -0
- package/node/point-on-shape/compare-poss.d.ts +10 -0
- package/node/point-on-shape/compare-poss.js +18 -0
- package/node/point-on-shape/compare-poss.js.map +1 -0
- package/node/point-on-shape/create-pos.d.ts +4 -0
- package/node/point-on-shape/create-pos.js +12 -0
- package/node/point-on-shape/create-pos.js.map +1 -0
- package/node/point-on-shape/get-osculating-circle.d.ts +10 -0
- package/node/point-on-shape/get-osculating-circle.js +25 -0
- package/node/point-on-shape/get-osculating-circle.js.map +1 -0
- package/node/point-on-shape/get-pos-corner.d.ts +7 -0
- package/node/point-on-shape/get-pos-corner.js +9 -0
- package/node/point-on-shape/get-pos-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-corner.js +8 -0
- package/node/point-on-shape/is-pos-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-dull-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-dull-corner.js +14 -0
- package/node/point-on-shape/is-pos-dull-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.js +14 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-sharp-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-sharp-corner.js +14 -0
- package/node/point-on-shape/is-pos-sharp-corner.js.map +1 -0
- package/node/point-on-shape/point-on-shape.d.ts +11 -0
- package/node/point-on-shape/point-on-shape.js +2 -0
- package/node/point-on-shape/point-on-shape.js.map +1 -0
- package/node/point-on-shape/pos-to-human-string.d.ts +8 -0
- package/node/point-on-shape/pos-to-human-string.js +12 -0
- package/node/point-on-shape/pos-to-human-string.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/add-debug-info.d.ts +2 -2
- package/node/{mat/to-scale-axis → sat}/add-debug-info.js +1 -1
- package/node/sat/add-debug-info.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/cull-non-cycles.d.ts +3 -3
- package/node/{mat/to-scale-axis → sat}/cull-non-cycles.js +6 -6
- package/node/sat/cull-non-cycles.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/cull.d.ts +3 -3
- package/node/{mat/to-scale-axis → sat}/cull.js +4 -4
- package/node/sat/cull.js.map +1 -0
- package/node/{mat → sat}/get-leaves.d.ts +2 -2
- package/node/sat/get-leaves.js +14 -0
- package/node/sat/get-leaves.js.map +1 -0
- package/node/{to-scale-axis.d.ts → sat/to-scale-axis.d.ts} +2 -2
- package/node/{to-scale-axis.js → sat/to-scale-axis.js} +11 -10
- package/node/sat/to-scale-axis.js.map +1 -0
- package/node/svg/get-loop-bounds.d.ts +7 -7
- package/node/svg/get-loop-bounds.js +11 -7
- package/node/svg/get-loop-bounds.js.map +1 -1
- package/node/svg/get-min-y-pos.d.ts +4 -4
- package/node/svg/get-min-y-pos.js +1 -1
- package/node/svg/get-shape-bounds.d.ts +6 -5
- package/node/svg/get-shape-bounds.js +6 -2
- package/node/svg/get-shape-bounds.js.map +1 -1
- package/node/sweep-line/sweep-line.d.ts +1 -1
- package/node/sweep-line/sweep-line.js +4 -4
- package/node/sweep-line/sweep-line.js.map +1 -1
- package/package.json +10 -10
- package/src/closest-boundary-point/closest-points-on-curve-precise.ts +75 -0
- package/src/closest-boundary-point/closest-points-on-curve.ts +72 -0
- package/src/closest-boundary-point/cull-bezier-pieces.ts +35 -0
- package/src/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.ts +4 -3
- package/src/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.ts +2 -2
- package/src/closest-boundary-point/dd-deflate-with-running-error.ts +88 -0
- package/src/closest-boundary-point/foot-and-endpoint-info.ts +16 -0
- package/src/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.ts +3 -4
- package/src/closest-boundary-point/get-close-boundary-points-certified.ts +69 -0
- package/src/closest-boundary-point/get-closest-boundary-point-certified.ts +70 -0
- package/src/closest-boundary-point/get-p-from-box.ts +14 -0
- package/src/closest-boundary-point/get-potential-closest-points-on-curve-certified.ts +122 -0
- package/src/closest-boundary-point/root-interval-to-distance-squared-interval.ts +75 -0
- package/src/{contact-point.ts → contact-point/contact-point.ts} +4 -6
- package/src/{compare-curvatures-at-interface.ts → corner/compare-curvatures-at-interface.ts} +2 -2
- package/src/{mat → corner}/corner.ts +1 -1
- package/src/{curve.ts → corner/get-corner.ts} +10 -49
- package/src/{get-interface-ccw.ts → corner/get-interface-ccw.ts} +28 -35
- package/src/cp-node/clone.ts +17 -6
- package/src/cp-node/cp-node.ts +422 -0
- package/src/cp-node/create-cp-node.ts +21 -0
- package/src/cp-node/enhance-cp-node.ts +27 -0
- package/src/{get-boundary-bezier-parts-to-next.ts → cp-node/get-boundary-bezier-parts-to-next.ts} +3 -3
- package/src/{get-boundary-beziers-to-next.ts → cp-node/get-boundary-beziers-to-next.ts} +2 -2
- package/src/cp-node/get-cp-node-ordering.ts +17 -0
- package/src/{get-curve-to-next.ts → cp-node/get-curve-to-next.ts} +1 -1
- package/src/cp-node/remove.ts +1 -1
- package/src/cp-node/traverse-cp.ts +35 -0
- package/src/{traverse-edges.ts → cp-node/traverse-edges.ts} +5 -5
- package/src/{traverse-vertices.ts → cp-node/traverse-vertices.ts} +5 -5
- package/src/curve/curve.ts +46 -0
- package/src/debug/cp-node-for-debugging.ts +2 -2
- package/src/debug/debug-elem-types.ts +8 -8
- package/src/debug/debug.ts +11 -11
- package/src/debug/functions/draw-elem/bounding-hull.ts +5 -3
- package/src/debug/functions/draw-elem/branch.ts +4 -4
- package/src/debug/functions/draw-elem/culls.ts +3 -3
- package/src/debug/functions/draw-elem/draw-circle-percent.ts +1 -1
- package/src/debug/functions/draw-elem/draw-elem.ts +10 -6
- package/src/debug/functions/draw-elem/dull-corner.ts +10 -6
- package/src/debug/functions/draw-elem/leaves.ts +2 -2
- package/src/debug/functions/draw-elem/loop.ts +4 -3
- package/src/debug/functions/draw-elem/loops.ts +1 -2
- package/src/debug/functions/draw-elem/loose-bounding-box.ts +8 -3
- package/src/debug/functions/draw-elem/mat.ts +16 -8
- package/src/debug/functions/draw-elem/max-vertex.ts +2 -2
- package/src/debug/functions/draw-elem/min-y.ts +4 -9
- package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +10 -2
- package/src/debug/functions/draw-elem/one-prong.ts +12 -15
- package/src/debug/functions/draw-elem/sharp-corner.ts +10 -6
- package/src/debug/functions/draw-elem/three-prong.ts +13 -11
- package/src/debug/functions/draw-elem/tight-bounding-box.ts +9 -3
- package/src/debug/functions/draw-elem/two-prong.ts +12 -8
- package/src/debug/functions/draw-elem/vertex.ts +12 -11
- package/src/debug/functions/general.ts +10 -10
- package/src/debug/functions/three-prong.ts +16 -20
- package/src/debug/functions/two-prong.ts +89 -77
- package/src/debug/three-prong-for-debugging.ts +17 -16
- package/src/debug/two-prong-for-debugging.ts +7 -7
- package/src/error-analysis/gamma.ts +41 -0
- package/src/{mat/find-mat → find-2-prong}/add-1-prong.ts +19 -16
- package/src/{mat/find-mat → find-2-prong}/add-2-prong.ts +45 -91
- package/src/find-2-prong/add-debug-info.ts +49 -0
- package/src/{mat/find-mat/find-2-prong → find-2-prong}/cull-bezier-pieces.ts +9 -11
- package/src/find-2-prong/find-2-prong.ts +191 -0
- package/src/{mat/find-mat → find-2-prong}/find-and-add-2-prongs-on-all-paths.ts +12 -9
- package/src/find-2-prong/find-and-add-2-prongs.ts +88 -0
- package/src/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.ts +7 -7
- package/src/find-2-prong/find-equidistant-point-on-line-dd.ts +77 -0
- package/src/{mat/find-mat/find-2-prong → find-2-prong}/find-equidistant-point-on-line.ts +1 -1
- package/src/find-2-prong/get-initial-bezier-pieces.ts +61 -0
- package/src/find-2-prong/pyth-trips.ts +146 -0
- package/src/find-2-prong/reduce-radius.ts +98 -0
- package/src/find-2-prong/squared-distance-between-dd.ts +25 -0
- package/src/find-2-prong/x-for-debugging.ts +13 -0
- package/src/find-3-prong.ts/add-3-prong.ts +110 -0
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.ts +5 -5
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.ts +11 -12
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.ts +28 -28
- package/src/find-3-prong.ts/find-3-prong.ts +148 -0
- package/src/find-3-prong.ts/find-and-add-3-prongs.ts +111 -0
- package/src/find-3-prong.ts/find-and-add-all-3-prongs.ts +109 -0
- package/src/find-3-prong.ts/get-closest-points.ts +24 -0
- package/src/{mat/find-mat → find-mat}/add-debug-info.ts +10 -10
- package/src/{mat/find-mat → find-mat}/create-initial-cp-graph.ts +11 -12
- package/src/find-mat/find-mat.ts +89 -0
- package/src/find-mat/find-mats.ts +83 -0
- package/src/find-mat/fix-ordering.ts +69 -0
- package/src/find-mat/get-dull-corners.ts +34 -0
- package/src/find-mat/get-for-1-prongs-on-loop.ts +40 -0
- package/src/find-mat/get-for-2-prongs-on-loop.ts +44 -0
- package/src/find-mat/get-sharp-corners.ts +33 -0
- package/src/find-mat/get-size-params.ts +34 -0
- package/src/{mat/find-mat → find-mat}/get-total-by.ts +4 -4
- package/src/{mat/geometry → geometry}/get-closest-square-distance-to-rect.ts +1 -1
- package/src/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.ts +2 -2
- package/src/get-curve/get-curve-between.ts +7 -7
- package/src/get-curve/get-edge-direction.ts +11 -11
- package/src/index.ts +64 -21
- package/src/loop/get-max-coordinate.ts +1 -1
- package/src/mat/add-to-cp-graph.ts +15 -12
- package/src/mat/bezier-piece.ts +2 -2
- package/src/mat/cmp-cp-on-delta.ts +6 -3
- package/src/mat/create-new-cp-tree.ts +6 -9
- package/src/mat/elem-type-two-prong.ts +1 -1
- package/src/mat/get-boundary-piece-beziers.ts +7 -7
- package/src/{get-branches.ts → mat/get-branches.ts} +8 -8
- package/src/mat/get-edges-as-array.ts +2 -2
- package/src/mat/get-largest-three-prong.ts +3 -3
- package/src/mat/get-largest-vertex.ts +2 -2
- package/src/mat/get-neighboring-cps.ts +9 -6
- package/src/mat/get-two-prong-type.ts +1 -1
- package/src/mat/is-another-cp-closeby.ts +29 -44
- package/src/{mat.ts → mat/mat.ts} +2 -2
- package/src/mat/simplify-mat-map-only.ts +5 -5
- package/src/{simplify-mat.ts → mat/simplify-mat.ts} +12 -14
- package/src/mat/trim-mat.ts +3 -3
- package/src/point-on-shape/calc-pos-order.ts +35 -0
- package/src/point-on-shape/compare-poss.ts +26 -0
- package/src/point-on-shape/create-pos.ts +21 -0
- package/src/point-on-shape/get-osculating-circle.ts +39 -0
- package/src/point-on-shape/get-pos-corner.ts +16 -0
- package/src/point-on-shape/is-pos-corner.ts +12 -0
- package/src/point-on-shape/is-pos-dull-corner.ts +16 -0
- package/src/point-on-shape/is-pos-quite-dull-corner.ts +17 -0
- package/src/point-on-shape/is-pos-quite-sharp-corner.ts +17 -0
- package/src/point-on-shape/is-pos-sharp-corner.ts +17 -0
- package/src/point-on-shape/point-on-shape.ts +15 -0
- package/src/point-on-shape/pos-to-human-string.ts +16 -0
- package/src/{mat/to-scale-axis → sat}/add-debug-info.ts +3 -3
- package/src/{mat/to-scale-axis → sat}/cull-non-cycles.ts +7 -7
- package/src/{mat/to-scale-axis → sat}/cull.ts +6 -6
- package/src/{mat → sat}/get-leaves.ts +4 -4
- package/src/{mat/to-scale-axis → sat}/t-tree.ts +2 -2
- package/src/{to-scale-axis.ts → sat/to-scale-axis.ts} +16 -16
- package/src/{mat/to-scale-axis → sat}/traverse-spacial-tree.ts +5 -5
- package/src/svg/get-loop-bounds.ts +22 -17
- package/src/svg/get-min-y-pos.ts +3 -3
- package/src/svg/get-shape-bounds.ts +12 -9
- package/src/sweep-line/are-boxes-intersecting.ts +1 -1
- package/src/sweep-line/sweep-line.ts +7 -7
- package/tsconfig.json +3 -7
- package/wallaby.mjs +32 -0
- package/node/circle.js.map +0 -1
- package/node/compare-curvatures-at-interface.js.map +0 -1
- package/node/contact-point.js.map +0 -1
- package/node/cp-node.d.ts +0 -202
- package/node/cp-node.js +0 -321
- package/node/cp-node.js.map +0 -1
- package/node/curve.js.map +0 -1
- package/node/find-mats.js +0 -123
- package/node/find-mats.js.map +0 -1
- package/node/get-boundary-bezier-parts-to-next.js.map +0 -1
- package/node/get-boundary-beziers-to-next.js.map +0 -1
- package/node/get-bounding-box-.js.map +0 -1
- package/node/get-branches.js.map +0 -1
- package/node/get-curve-to-next.js.map +0 -1
- package/node/get-interface-ccw.js.map +0 -1
- package/node/loop.d.ts +0 -16
- package/node/loop.js +0 -35
- package/node/loop.js.map +0 -1
- package/node/mat/closest-boundary-point/closest-points-on-curve.d.ts +0 -14
- package/node/mat/closest-boundary-point/closest-points-on-curve.js +0 -73
- package/node/mat/closest-boundary-point/closest-points-on-curve.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-bezier-pieces.d.ts +0 -9
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js +0 -20
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js.map +0 -1
- package/node/mat/closest-boundary-point/get-best-distance-squared.js.map +0 -1
- package/node/mat/closest-boundary-point/get-close-boundary-points.d.ts +0 -17
- package/node/mat/closest-boundary-point/get-close-boundary-points.js +0 -81
- package/node/mat/closest-boundary-point/get-close-boundary-points.js.map +0 -1
- package/node/mat/closest-boundary-point/get-closest-boundary-point.d.ts +0 -18
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js +0 -41
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js.map +0 -1
- package/node/mat/find-mat/add-1-prong.d.ts +0 -12
- package/node/mat/find-mat/add-1-prong.js.map +0 -1
- package/node/mat/find-mat/add-2-prong.js.map +0 -1
- package/node/mat/find-mat/add-3-prong.js +0 -55
- package/node/mat/find-mat/add-3-prong.js.map +0 -1
- package/node/mat/find-mat/add-debug-info.js.map +0 -1
- package/node/mat/find-mat/create-get-interesting-points-on-loop.d.ts +0 -11
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js +0 -52
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js.map +0 -1
- package/node/mat/find-mat/create-initial-cp-graph.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/add-debug-info.d.ts +0 -8
- package/node/mat/find-mat/find-2-prong/add-debug-info.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.d.ts +0 -11
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js +0 -30
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/find-2-prong.js +0 -233
- package/node/mat/find-mat/find-2-prong/find-2-prong.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.d.ts +0 -9
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js +0 -40
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.d.ts +0 -11
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js +0 -38
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/x-for-debugging.d.ts +0 -9
- package/node/mat/find-mat/find-2-prong/x-for-debugging.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/calc-better-x.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/get-closest-points.js +0 -17
- package/node/mat/find-mat/find-3-prong/get-closest-points.js.map +0 -1
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.d.ts +0 -15
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js.map +0 -1
- package/node/mat/find-mat/find-and-add-2-prongs.js +0 -74
- package/node/mat/find-mat/find-and-add-2-prongs.js.map +0 -1
- package/node/mat/find-mat/find-and-add-3-prongs.js +0 -147
- package/node/mat/find-mat/find-and-add-3-prongs.js.map +0 -1
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js.map +0 -1
- package/node/mat/find-mat/get-potential-2-prongs.d.ts +0 -4
- package/node/mat/find-mat/get-potential-2-prongs.js +0 -17
- package/node/mat/find-mat/get-potential-2-prongs.js.map +0 -1
- package/node/mat/find-mat/get-sharp-corners.d.ts +0 -4
- package/node/mat/find-mat/get-sharp-corners.js +0 -18
- package/node/mat/find-mat/get-sharp-corners.js.map +0 -1
- package/node/mat/geometry/get-closest-square-distance-to-rect.js.map +0 -1
- package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js.map +0 -1
- package/node/mat/get-contact-circles-at-interface.d.ts +0 -8
- package/node/mat/get-contact-circles-at-interface.js +0 -21
- package/node/mat/get-contact-circles-at-interface.js.map +0 -1
- package/node/mat/get-leaves.js +0 -13
- package/node/mat/get-leaves.js.map +0 -1
- package/node/mat/to-scale-axis/add-debug-info.js.map +0 -1
- package/node/mat/to-scale-axis/cull-non-cycles.js.map +0 -1
- package/node/mat/to-scale-axis/cull.js.map +0 -1
- package/node/mat.js.map +0 -1
- package/node/point-on-shape.d.ts +0 -73
- package/node/point-on-shape.js +0 -168
- package/node/point-on-shape.js.map +0 -1
- package/node/simplify-mat.js.map +0 -1
- package/node/to-scale-axis.js.map +0 -1
- package/node/traverse-edges.js.map +0 -1
- package/node/traverse-vertices.js.map +0 -1
- package/src/cp-node.ts +0 -388
- package/src/find-mats.ts +0 -171
- package/src/loop.ts +0 -56
- package/src/mat/closest-boundary-point/closest-point-on-curve-old.ts_ +0 -88
- package/src/mat/closest-boundary-point/closest-point-on-curve.ts_ +0 -95
- package/src/mat/closest-boundary-point/closest-points-on-curve.ts +0 -84
- package/src/mat/closest-boundary-point/cull-bezier-pieces.ts +0 -38
- package/src/mat/closest-boundary-point/get-close-boundary-points.ts +0 -107
- package/src/mat/closest-boundary-point/get-closest-boundary-point.ts +0 -64
- package/src/mat/find-mat/add-3-prong.ts +0 -75
- package/src/mat/find-mat/create-get-interesting-points-on-loop.ts +0 -73
- package/src/mat/find-mat/find-2-prong/add-debug-info.ts +0 -46
- package/src/mat/find-mat/find-2-prong/find-2-prong.ts +0 -316
- package/src/mat/find-mat/find-2-prong/get-initial-bezier-pieces.ts +0 -52
- package/src/mat/find-mat/find-2-prong/x-for-debugging.ts +0 -13
- package/src/mat/find-mat/find-3-prong/find-3-prong.ts +0 -106
- package/src/mat/find-mat/find-3-prong/get-closest-points.ts +0 -28
- package/src/mat/find-mat/find-and-add-2-prongs.ts +0 -108
- package/src/mat/find-mat/find-and-add-3-prongs.ts +0 -218
- package/src/mat/find-mat/get-potential-2-prongs.ts +0 -24
- package/src/mat/find-mat/get-sharp-corners.ts +0 -25
- package/src/mat/find-mat/get-total-abs-curvature.ts +0 -17
- package/src/mat/get-contact-circles-at-interface.ts +0 -26
- package/src/mat/to-scale-axis/add-to-tree.ts +0 -66
- package/src/mat/to-scale-axis/calc-groups.ts +0 -82
- package/src/mat/to-scale-axis/create-spacial-tree.ts +0 -41
- package/src/mat/to-scale-axis/get-engulfed-vertices.ts +0 -135
- package/src/point-on-shape.ts +0 -231
- package/src/svg/get-curvature-at-interface.ts +0 -55
- /package/node/{compare-curvatures-at-interface.d.ts → corner/compare-curvatures-at-interface.d.ts} +0 -0
- /package/node/{mat → corner}/corner.js +0 -0
- /package/node/{get-interface-ccw.d.ts → corner/get-interface-ccw.d.ts} +0 -0
- /package/node/{get-boundary-bezier-parts-to-next.d.ts → cp-node/get-boundary-bezier-parts-to-next.d.ts} +0 -0
- /package/node/{get-curve-to-next.d.ts → cp-node/get-curve-to-next.d.ts} +0 -0
- /package/node/{traverse-edges.d.ts → cp-node/traverse-edges.d.ts} +0 -0
- /package/node/{traverse-vertices.d.ts → cp-node/traverse-vertices.d.ts} +0 -0
- /package/node/{mat/find-mat/find-2-prong → find-2-prong}/x-for-debugging.js +0 -0
- /package/node/{circle.d.ts → geometry/circle.d.ts} +0 -0
- /package/node/{circle.js → geometry/circle.js} +0 -0
- /package/node/{get-bounding-box-.d.ts → geometry/get-bounding-box-.d.ts} +0 -0
- /package/node/{get-bounding-box-.js → geometry/get-bounding-box-.js} +0 -0
- /package/node/{mat.js → mat/mat.js} +0 -0
- /package/src/{circle.ts → geometry/circle.ts} +0 -0
- /package/src/{get-bounding-box-.ts → geometry/get-bounding-box-.ts} +0 -0
package/node/index.js
CHANGED
|
@@ -1,33 +1,38 @@
|
|
|
1
1
|
import { beziersToSvgPathStr, getPathsFromStr } from 'flo-boolean';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { matCurveToNextVertex, getChildren, vertexChildren, getAllOnLoop, insertCpNode, getCpNodesOnCircle, isOnSameCircle, isTerminating, isFullyTerminating, getFirstExit, isSharp, getProngCount, getRealProngCount, cpNodeComparator, removeCpNode } from './cp-node/cp-node.js';
|
|
3
|
+
import { createCpNode } from './cp-node/create-cp-node.js';
|
|
4
|
+
import { enhanceCpNode } from './cp-node/enhance-cp-node.js';
|
|
5
|
+
import { traverseCp } from './cp-node/traverse-cp.js';
|
|
6
|
+
import { createPos } from './point-on-shape/create-pos.js';
|
|
7
|
+
import { findMats } from './find-mat/find-mats.js';
|
|
5
8
|
import { trimMat } from './mat/trim-mat.js';
|
|
6
|
-
import { toScaleAxis } from './to-scale-axis.js';
|
|
7
|
-
import { traverseEdges } from './traverse-edges.js';
|
|
8
|
-
import { getBranches } from './get-branches.js';
|
|
9
|
-
import { traverseVertices } from './traverse-vertices.js';
|
|
9
|
+
import { toScaleAxis } from './sat/to-scale-axis.js';
|
|
10
|
+
import { traverseEdges } from './cp-node/traverse-edges.js';
|
|
11
|
+
import { getBranches } from './mat/get-branches.js';
|
|
12
|
+
import { traverseVertices } from './cp-node/traverse-vertices.js';
|
|
10
13
|
import { enableDebugForMat } from './debug/debug.js';
|
|
11
14
|
import { drawBranch } from './debug/functions/draw-elem/branch.js';
|
|
12
15
|
import { drawMat } from './debug/functions/draw-elem/mat.js';
|
|
13
|
-
import {
|
|
16
|
+
import { getClosestBoundaryPointCertified } from './closest-boundary-point/get-closest-boundary-point-certified.js';
|
|
14
17
|
import { getShapeBounds } from './svg/get-shape-bounds.js';
|
|
15
|
-
import { getBoundaryBeziersToNext } from './get-boundary-beziers-to-next.js';
|
|
16
|
-
import { getBoundaryBezierPartsToNext } from './get-boundary-bezier-parts-to-next.js';
|
|
18
|
+
import { getBoundaryBeziersToNext } from './cp-node/get-boundary-beziers-to-next.js';
|
|
19
|
+
import { getBoundaryBezierPartsToNext } from './cp-node/get-boundary-bezier-parts-to-next.js';
|
|
17
20
|
import { getBoundaryPieceBeziers } from './mat/get-boundary-piece-beziers.js';
|
|
18
|
-
import { simplifyMat } from './simplify-mat.js';
|
|
21
|
+
import { simplifyMat } from './mat/simplify-mat.js';
|
|
19
22
|
import { simplifyMatMapOnly } from './mat/simplify-mat-map-only.js';
|
|
20
23
|
import { drawElemFunctions } from './debug/functions/draw-elem/draw-elem.js';
|
|
21
|
-
import { getCurveToNext } from './get-curve-to-next.js';
|
|
24
|
+
import { getCurveToNext } from './cp-node/get-curve-to-next.js';
|
|
22
25
|
import { getCurveBetween } from './get-curve/get-curve-between.js';
|
|
23
26
|
import { sweepLine } from './sweep-line/sweep-line.js';
|
|
24
|
-
import { getClosestSquareDistanceToRect } from './
|
|
25
|
-
import { loopFromBeziers } from '
|
|
26
|
-
export {
|
|
27
|
+
import { getClosestSquareDistanceToRect } from './geometry/get-closest-square-distance-to-rect.js';
|
|
28
|
+
import { loopFromBeziers } from 'flo-boolean';
|
|
29
|
+
export {
|
|
27
30
|
// Main functions
|
|
28
31
|
findMats, toScaleAxis, trimMat, traverseVertices, traverseEdges, getBranches, getBoundaryBeziersToNext, getBoundaryBezierPartsToNext, simplifyMat, simplifyMatMapOnly,
|
|
32
|
+
// CpNode
|
|
33
|
+
createCpNode, matCurveToNextVertex, getChildren, vertexChildren, getAllOnLoop, insertCpNode, getCpNodesOnCircle, isOnSameCircle, isTerminating, isFullyTerminating, getFirstExit, isSharp, getProngCount, getRealProngCount, cpNodeComparator, removeCpNode, enhanceCpNode, traverseCp,
|
|
29
34
|
// SVG functions
|
|
30
35
|
beziersToSvgPathStr, getPathsFromStr, getShapeBounds, drawBranch, drawMat,
|
|
31
36
|
// Other functions
|
|
32
|
-
|
|
37
|
+
getClosestBoundaryPointCertified, getCurveToNext, getCurveBetween, createPos, getBoundaryPieceBeziers, drawElemFunctions, sweepLine, getClosestSquareDistanceToRect, loopFromBeziers, enableDebugForMat };
|
|
33
38
|
//# sourceMappingURL=index.js.map
|
package/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAKnE,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAKnE,OAAO,EAEN,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACP,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAI3D,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;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B,EAChB,YAAY,EACZ,aAAa,EACb,UAAU;AAGV,gBAAgB;AAChB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,EACV,OAAO;AAEP,kBAAkB;AAClB,gCAAgC,EAChC,cAAc,EAAE,eAAe,EAC/B,SAAS,EAST,uBAAuB,EAEvB,iBAAiB,EAEjB,SAAS,EAET,8BAA8B,EAE9B,eAAe,EACf,iBAAiB,EACjB,CAAA"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
-
import { Loop } from '
|
|
3
|
-
import { Circle } from '../circle.js';
|
|
4
|
-
import {
|
|
5
|
-
import { CpNode } from '../cp-node.js';
|
|
2
|
+
import { Loop } from 'flo-boolean';
|
|
3
|
+
import { Circle } from '../geometry/circle.js';
|
|
4
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
5
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
6
6
|
/**
|
|
7
|
-
* @
|
|
7
|
+
* @internal
|
|
8
|
+
*
|
|
8
9
|
* @param circle
|
|
9
10
|
* @param orders
|
|
10
11
|
* @param cpTrees
|
|
11
12
|
* @param poss
|
|
12
13
|
* @param neighbors
|
|
13
|
-
* @
|
|
14
|
+
* @internal
|
|
14
15
|
*/
|
|
15
|
-
declare function addToCpGraph(circle: Circle, orders: number[], cpTrees: Map<Loop, LlRbTree<CpNode>>, poss:
|
|
16
|
+
declare function addToCpGraph(circle: Circle, orders: number[], cpTrees: Map<Loop, LlRbTree<CpNode>>, poss: PointOnShape[], neighbors?: CpNode[][]): CpNode[];
|
|
16
17
|
export { addToCpGraph };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { insertCpNode } from '../cp-node/cp-node.js';
|
|
2
2
|
import { getNeighbouringPoints } from './get-neighboring-cps.js';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @internal
|
|
5
|
+
*
|
|
5
6
|
* @param circle
|
|
6
7
|
* @param orders
|
|
7
8
|
* @param cpTrees
|
|
8
9
|
* @param poss
|
|
9
10
|
* @param neighbors
|
|
10
|
-
* @
|
|
11
|
+
* @internal
|
|
11
12
|
*/
|
|
12
13
|
function addToCpGraph(circle, orders, cpTrees, poss, neighbors) {
|
|
13
14
|
const newCps = poss.map((pos, i) => {
|
|
@@ -16,7 +17,7 @@ function addToCpGraph(circle, orders, cpTrees, poss, neighbors) {
|
|
|
16
17
|
const neighboringCp = neighbors
|
|
17
18
|
? neighbors[i]
|
|
18
19
|
: getNeighbouringPoints(cpTree, pos, orders[i], 0);
|
|
19
|
-
const newCp =
|
|
20
|
+
const newCp = insertCpNode(false, false, cpTree, newCp_, neighboringCp[0]);
|
|
20
21
|
return newCp;
|
|
21
22
|
});
|
|
22
23
|
const len = poss.length;
|
|
@@ -26,6 +27,7 @@ function addToCpGraph(circle, orders, cpTrees, poss, neighbors) {
|
|
|
26
27
|
newCps[i].prevOnCircle = newCps[indxPrev];
|
|
27
28
|
newCps[i].nextOnCircle = newCps[indxNext];
|
|
28
29
|
}
|
|
30
|
+
return newCps;
|
|
29
31
|
}
|
|
30
32
|
export { addToCpGraph };
|
|
31
33
|
//# sourceMappingURL=add-to-cp-graph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-to-cp-graph.js","sourceRoot":"","sources":["../../src/mat/add-to-cp-graph.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"add-to-cp-graph.js","sourceRoot":"","sources":["../../src/mat/add-to-cp-graph.ts"],"names":[],"mappings":"AAKA,OAAO,EAAU,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGjE;;;;;;;;;GASG;AACH,SAAS,YAAY,CACb,MAAgB,EAChB,MAAkB,EAClB,OAAoC,EACpC,IAAwB,EACxB,SAAuB;IAE3B,MAAM,MAAM,GAA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E,YAAY,EAAE,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
-
import { CpNode } from '../cp-node.js';
|
|
3
|
-
import { Loop } from '
|
|
2
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
3
|
+
import { Loop } from 'flo-boolean';
|
|
4
4
|
/**
|
|
5
|
-
* @
|
|
5
|
+
* @internal
|
|
6
6
|
* @param cpNode
|
|
7
7
|
*/
|
|
8
8
|
declare function createNewCpTree(cpNode: CpNode): Map<Loop, LlRbTree<CpNode>>;
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
-
import {
|
|
2
|
+
import { cpNodeComparator, getAllOnLoop } from '../cp-node/cp-node.js';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @internal
|
|
5
5
|
* @param cpNode
|
|
6
6
|
*/
|
|
7
7
|
function createNewCpTree(cpNode) {
|
|
8
8
|
const newCpTrees = new Map();
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function f(cpNode) {
|
|
9
|
+
getAllOnLoop(cpNode).forEach(createNewCpTree_);
|
|
10
|
+
function createNewCpTree_(cpNode) {
|
|
12
11
|
const loop = cpNode.cp.pointOnShape.curve.loop;
|
|
13
12
|
let cpTree = newCpTrees.get(loop);
|
|
14
13
|
if (!cpTree) {
|
|
15
|
-
|
|
16
|
-
cpTree = new LlRbTree(CpNode.comparator, false);
|
|
14
|
+
cpTree = new LlRbTree(cpNodeComparator, false);
|
|
17
15
|
newCpTrees.set(loop, cpTree);
|
|
18
16
|
}
|
|
19
17
|
cpTree.insert(cpNode);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-new-cp-tree.js","sourceRoot":"","sources":["../../src/mat/create-new-cp-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create-new-cp-tree.js","sourceRoot":"","sources":["../../src/mat/create-new-cp-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAU,gBAAgB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI/E;;;GAGG;AACH,SAAS,eAAe,CAAC,MAAc;IACtC,MAAM,UAAU,GAA+B,IAAI,GAAG,EAAE,CAAC;IAEzD,YAAY,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE/C,SAAS,gBAAgB,CAAC,MAAc;QACvC,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC;QAC/C,IAAI,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,MAAM,EAAE;YACZ,MAAM,GAAG,IAAI,QAAQ,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;YAC/C,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SAC7B;QACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CpNode } from '../cp-node.js';
|
|
1
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
2
2
|
import { BezierPiece } from './bezier-piece.js';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @internal
|
|
5
5
|
* Returns the ordered cubic bezier pieces (i.e a bezier with a t range)
|
|
6
6
|
* from the given boundary piece.
|
|
7
7
|
* @param cpNodes - An ordered pair that represents the start and end points of
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isPosQuiteSharpCorner } from '../point-on-shape.js';
|
|
2
|
-
import { compareCps } from '../contact-point.js';
|
|
1
|
+
import { isPosQuiteSharpCorner } from '../point-on-shape/is-pos-quite-sharp-corner.js';
|
|
2
|
+
import { compareCps } from '../contact-point/contact-point.js';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @internal
|
|
5
5
|
* Returns the ordered cubic bezier pieces (i.e a bezier with a t range)
|
|
6
6
|
* from the given boundary piece.
|
|
7
7
|
* @param cpNodes - An ordered pair that represents the start and end points of
|
|
@@ -44,7 +44,7 @@ function getBoundaryPieceBeziers(cpNodes) {
|
|
|
44
44
|
return bezierPieces;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* @
|
|
47
|
+
* @internal
|
|
48
48
|
* Adds pieces of skipped beziers
|
|
49
49
|
*/
|
|
50
50
|
function addSkippedBeziers(bezierPieces, curveStart, curveEnd, t1) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-boundary-piece-beziers.js","sourceRoot":"","sources":["../../src/mat/get-boundary-piece-beziers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"get-boundary-piece-beziers.js","sourceRoot":"","sources":["../../src/mat/get-boundary-piece-beziers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAG/D;;;;;;GAMG;AACH,SAAS,uBAAuB,CAAC,OAAiB;IAC9C,IAAI,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACxB,MAAM,KAAK,GAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAE1B,MAAM,YAAY,GAAkB,EAAE,CAAC;IAEvC,iEAAiE;IACjE,IAAI,UAAU,GAAG,IAAI,CAAC;IACtB,GAAG;QACC,IAAI,CAAC,UAAU,EAAE;YACb,UAAU,GAA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AAE;IAG3B,OAAO,YAAY,CAAC;AACxB,CAAC;AAGD;;;GAGG;AACH,SAAS,iBAAiB,CAClB,YAA4B,EAC5B,UAAoB,EACpB,QAAoB,EACpB,EAAqB;IAEzB,IAAI,SAAS,GAAG,UAAU,CAAC;IAC3B,GAAG;QACC,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;QAC3B,MAAM,IAAI,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7C,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;KAC1D,QAAQ,SAAS,KAAK,QAAQ,EAAE;AACrC,CAAC;AAGD,OAAO,EAAE,uBAAuB,EAAE,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { tangent } from 'flo-bezier3';
|
|
2
2
|
import { cross, toUnitVector } from 'flo-vector2d';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { getChildren, isFullyTerminating, isTerminating } from '../cp-node/cp-node.js';
|
|
4
|
+
import { getCurveToNext } from '../cp-node/get-curve-to-next.js';
|
|
5
|
+
/** @internal */
|
|
5
6
|
const defaultTolerance = 1; // 1 degree
|
|
6
7
|
/**
|
|
7
8
|
* Traverses all edges (depth first) of the given MAT tree starting at the given
|
|
@@ -14,7 +15,7 @@ const defaultTolerance = 1; // 1 degree
|
|
|
14
15
|
*/
|
|
15
16
|
function getBranches(cpNode, tolerance = defaultTolerance) {
|
|
16
17
|
// Start from a leaf
|
|
17
|
-
while (!
|
|
18
|
+
while (!isFullyTerminating(cpNode)) {
|
|
18
19
|
cpNode = cpNode.next;
|
|
19
20
|
}
|
|
20
21
|
const branches = [];
|
|
@@ -25,8 +26,8 @@ function getBranches(cpNode, tolerance = defaultTolerance) {
|
|
|
25
26
|
while (cps.length) {
|
|
26
27
|
const cp = cps.pop();
|
|
27
28
|
branchCpNodes.push(cp);
|
|
28
|
-
let children =
|
|
29
|
-
if (
|
|
29
|
+
let children = getChildren(cp);
|
|
30
|
+
if (isFullyTerminating(cp)) {
|
|
30
31
|
if (branchCpNodes.length > 1) {
|
|
31
32
|
branches.push(branchCpNodes);
|
|
32
33
|
}
|
|
@@ -37,7 +38,7 @@ function getBranches(cpNode, tolerance = defaultTolerance) {
|
|
|
37
38
|
cps.push(children[0]);
|
|
38
39
|
continue;
|
|
39
40
|
}
|
|
40
|
-
children = children.filter(cpNode => !
|
|
41
|
+
children = children.filter(cpNode => !isTerminating(cpNode));
|
|
41
42
|
if (children.length === 0) {
|
|
42
43
|
branches.push(branchCpNodes);
|
|
43
44
|
branchCpNodes = [];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-branches.js","sourceRoot":"","sources":["../../src/mat/get-branches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAU,WAAW,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,gBAAgB;AAChB,MAAM,gBAAgB,GAAG,CAAC,CAAC,CAAC,WAAW;AAGvC;;;;;;;;GAQG;AACH,SAAS,WAAW,CAClB,MAAc,EACd,YAAoB,gBAAgB;IAErC,oBAAoB;IACpB,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE;QACnC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;KACrB;IAED,MAAM,QAAQ,GAAe,EAAE,CAAC;IAEhC,wEAAwE;IACxE,gBAAgB;IAChB,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAElC,IAAI,aAAa,GAAa,EAAE,CAAC;IACjC,OAAO,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,CAAC;QAEH,MAAM,MAAM,GAAG,KAAK,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC;QAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAE,MAAM,CAAE,GAAG,CAAC,GAAG,GAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAE5D,IAAI,KAAK,GAAG,SAAS,EAAE;YACtB,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC7B,aAAa,GAAG,EAAE,CAAC;SACnB;QAED,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KACtB;IAED,IAAI,aAAa,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;KAAE;IAE3D,OAAO,QAAQ,CAAC;AACjB,CAAC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-largest-vertex.js","sourceRoot":"","sources":["../../src/mat/get-largest-vertex.ts"],"names":[],"mappings":"AAGA,
|
|
1
|
+
{"version":3,"file":"get-largest-vertex.js","sourceRoot":"","sources":["../../src/mat/get-largest-vertex.ts"],"names":[],"mappings":"AAGA,gBAAgB;AAChB,SAAS,gBAAgB,CAAC,OAAiB;IAC1C,OAAO,OAAO,CAAC,MAAM,CAAC,UAAS,SAAiB,EAAE,MAAc;QAC/D,OAAO,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM;YAC3D,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,MAAM,CAAA;IACV,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAChB,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
-
import {
|
|
3
|
-
import { CpNode } from '../cp-node.js';
|
|
2
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
3
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
4
4
|
/**
|
|
5
|
-
* @
|
|
5
|
+
* @internal
|
|
6
|
+
*
|
|
6
7
|
* Returns the boundary piece that starts at the immediate previous point on the
|
|
7
8
|
* shape and ends at the immediate next point.
|
|
9
|
+
*
|
|
8
10
|
* @param cpTree
|
|
9
11
|
* @param pos
|
|
10
12
|
* @param order
|
|
11
13
|
* @param order2
|
|
12
14
|
*/
|
|
13
|
-
declare function getNeighbouringPoints(cpTree: LlRbTree<CpNode>, pos:
|
|
15
|
+
declare function getNeighbouringPoints(cpTree: LlRbTree<CpNode>, pos: PointOnShape, order: number, order2: number): CpNode[];
|
|
14
16
|
export { getNeighbouringPoints };
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createCpNode } from '../cp-node/create-cp-node.js';
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @internal
|
|
4
|
+
*
|
|
4
5
|
* Returns the boundary piece that starts at the immediate previous point on the
|
|
5
6
|
* shape and ends at the immediate next point.
|
|
7
|
+
*
|
|
6
8
|
* @param cpTree
|
|
7
9
|
* @param pos
|
|
8
10
|
* @param order
|
|
9
11
|
* @param order2
|
|
10
12
|
*/
|
|
11
13
|
function getNeighbouringPoints(cpTree, pos, order, order2) {
|
|
12
|
-
const cps = cpTree.findBounds(
|
|
14
|
+
const cps = cpTree.findBounds(createCpNode({ pointOnShape: pos, circle: undefined, order, order2 }, false, false));
|
|
13
15
|
if (!cps[0] && !cps[1]) {
|
|
14
16
|
// The tree is still empty
|
|
15
17
|
return [undefined, undefined];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-neighboring-cps.js","sourceRoot":"","sources":["../../src/mat/get-neighboring-cps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-neighboring-cps.js","sourceRoot":"","sources":["../../src/mat/get-neighboring-cps.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAG5D;;;;;;;;;;GAUG;AACH,SAAS,qBAAqB,CACtB,MAAwB,EACxB,GAAiB,EACjB,KAAa,EACb,MAAc;IAElB,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CACzB,YAAY,CAAC,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,SAAU,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CACvF,CAAC;IAEF,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QACpB,0BAA0B;QAC1B,OAAO,CAAC,SAAU,EAAE,SAAU,CAAa,CAAC;KAC/C;IAED,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QACpB,sDAAsD;QACtD,mDAAmD;QACnD,OAAO;YACH,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;YACvB,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;SACd,CAAC;KACjB;IAED,OAAO;QACH,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK;QACZ,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK;KACH,CAAC;AAClB,CAAC;AAGD,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TwoProngForDebugging } from '../debug/two-prong-for-debugging.js';
|
|
2
2
|
import { ElemType_TwoProng } from './elem-type-two-prong.js';
|
|
3
|
-
/** @
|
|
3
|
+
/** @internal */
|
|
4
4
|
declare function getTwoProngType(e: TwoProngForDebugging): ElemType_TwoProng;
|
|
5
5
|
export { getTwoProngType };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-two-prong-type.js","sourceRoot":"","sources":["../../src/mat/get-two-prong-type.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"get-two-prong-type.js","sourceRoot":"","sources":["../../src/mat/get-two-prong-type.ts"],"names":[],"mappings":"AAIA,gBAAgB;AAChB,SAAS,eAAe,CAAC,CAAuB;IAC/C,IAAI,CAAC,CAAC,WAAW,EAAE;QAAE,OAAO,sBAAsB,CAAA;KAAE;IAEpD,OAAO,kBAAkB,CAAC;AAC3B,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
-
import { Loop } from '
|
|
3
|
-
import { CpNode } from '../cp-node.js';
|
|
4
|
-
import {
|
|
5
|
-
import { Circle } from '../circle.js';
|
|
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
|
+
import { Circle } from '../geometry/circle.js';
|
|
6
6
|
/**
|
|
7
|
-
* @
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* @internal
|
|
8
|
+
* If another `CpNode` is close by (to the given implied (via `pos`, `order` and
|
|
9
|
+
* `order2`) then return it, else return `undefined`.
|
|
10
|
+
*
|
|
10
11
|
* @param cpTrees
|
|
11
12
|
* @param pos
|
|
12
13
|
* @param circle
|
|
@@ -16,5 +17,5 @@ import { Circle } from '../circle.js';
|
|
|
16
17
|
* tolerances.
|
|
17
18
|
* @param color Used for debugging only
|
|
18
19
|
*/
|
|
19
|
-
declare function isAnotherCpCloseby(cpTrees: Map<Loop, LlRbTree<CpNode>>, pos:
|
|
20
|
+
declare function isAnotherCpCloseby(cpTrees: Map<Loop, LlRbTree<CpNode>>, pos: PointOnShape, circle: Circle, order: number, order2: number, extreme: number): CpNode | undefined;
|
|
20
21
|
export { isAnotherCpCloseby };
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { distanceBetween, toUnitVector, fromTo, dot } from 'flo-vector2d';
|
|
2
2
|
import { getNeighbouringPoints } from './get-neighboring-cps.js';
|
|
3
|
-
/** @
|
|
4
|
-
|
|
5
|
-
const ANGLE_THRESHOLD =
|
|
6
|
-
//const ANGLE_THRESHOLD = 0.9848077530122080; // === Math.cos(10 degrees)
|
|
7
|
-
//const ANGLE_THRESHOLD = 0.9998476951563913; // === Math.cos(1 degrees)
|
|
8
|
-
//const ANGLE_THRESHOLD = 0.9999984769132877; // === Math.cos(0.1 degrees)
|
|
9
|
-
//const ANGLE_THRESHOLD = 0.9999999847691291 // === Math.cos(0.01 degrees)
|
|
3
|
+
/** @internal */
|
|
4
|
+
const DEGREES = 3;
|
|
5
|
+
const ANGLE_THRESHOLD = Math.cos(DEGREES * (Math.PI / 180));
|
|
10
6
|
/**
|
|
11
|
-
* @
|
|
12
|
-
*
|
|
13
|
-
*
|
|
7
|
+
* @internal
|
|
8
|
+
* If another `CpNode` is close by (to the given implied (via `pos`, `order` and
|
|
9
|
+
* `order2`) then return it, else return `undefined`.
|
|
10
|
+
*
|
|
14
11
|
* @param cpTrees
|
|
15
12
|
* @param pos
|
|
16
13
|
* @param circle
|
|
@@ -20,37 +17,32 @@ const ANGLE_THRESHOLD = 0.9986295347545738; // === Math.cos(3 degrees)
|
|
|
20
17
|
* tolerances.
|
|
21
18
|
* @param color Used for debugging only
|
|
22
19
|
*/
|
|
23
|
-
function isAnotherCpCloseby(cpTrees, pos, circle, order, order2, extreme
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
//const DISTANCE_THRESHOLD = extreme * 1e-1;
|
|
27
|
-
const DISTANCE_THRESHOLD = extreme * 1e-4;
|
|
28
|
-
//const DISTANCE_THRESHOLD = extreme * 1e-4; - was this
|
|
29
|
-
//const DISTANCE_THRESHOLD = extreme * 1e-6;
|
|
30
|
-
//const DISTANCE_THRESHOLD = extreme * 1e-12;
|
|
31
|
-
// It seems this can be zero else the ordering should be correct
|
|
32
|
-
//const DISTANCE_THRESHOLD = 0;
|
|
20
|
+
function isAnotherCpCloseby(cpTrees, pos, circle, order, order2, extreme) {
|
|
21
|
+
const DISTANCE_THRESHOLD = extreme * 2e-14;
|
|
22
|
+
const DISTANCE_THRESHOLD_2 = DISTANCE_THRESHOLD * 2e-2;
|
|
33
23
|
const cpTree = cpTrees.get(pos.curve.loop);
|
|
34
24
|
const cpNodes = getNeighbouringPoints(cpTree, pos, order, order2);
|
|
35
25
|
if (!cpNodes[0]) {
|
|
36
|
-
return
|
|
26
|
+
return undefined;
|
|
37
27
|
}
|
|
28
|
+
const { p, t } = pos;
|
|
38
29
|
for (const cpNode of cpNodes) {
|
|
39
30
|
const pos2 = cpNode.cp.pointOnShape;
|
|
40
|
-
const p1 = pos.p;
|
|
41
31
|
const p2 = pos2.p;
|
|
42
|
-
|
|
32
|
+
const d = distanceBetween(p, p2);
|
|
33
|
+
if (d > DISTANCE_THRESHOLD) {
|
|
43
34
|
continue;
|
|
44
35
|
}
|
|
45
|
-
const v1 = toUnitVector(fromTo(
|
|
46
|
-
const v2 = toUnitVector(fromTo(
|
|
36
|
+
const v1 = toUnitVector(fromTo(p2, cpNode.cp.circle.center));
|
|
37
|
+
const v2 = toUnitVector(fromTo(p, circle.center));
|
|
47
38
|
const cosTheta = dot(v1, v2);
|
|
48
|
-
if (cosTheta > ANGLE_THRESHOLD
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
if (cosTheta > ANGLE_THRESHOLD ||
|
|
40
|
+
(d < DISTANCE_THRESHOLD_2 && t !== 0 && t !== 1)) {
|
|
41
|
+
// console.log(d, DISTANCE_THRESHOLD2)
|
|
42
|
+
return cpNode;
|
|
51
43
|
}
|
|
52
44
|
}
|
|
53
|
-
return
|
|
45
|
+
return undefined;
|
|
54
46
|
}
|
|
55
47
|
export { isAnotherCpCloseby };
|
|
56
48
|
//# sourceMappingURL=is-another-cp-closeby.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-another-cp-closeby.js","sourceRoot":"","sources":["../../src/mat/is-another-cp-closeby.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAK1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,
|
|
1
|
+
{"version":3,"file":"is-another-cp-closeby.js","sourceRoot":"","sources":["../../src/mat/is-another-cp-closeby.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAK1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,gBAAgB;AAChB,MAAM,OAAO,GAAG,CAAC,CAAC;AAClB,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;AAG5D;;;;;;;;;;;;;GAaG;AACH,SAAS,kBAAkB,CACnB,OAAmC,EACnC,GAAiB,EACjB,MAAc,EACd,KAAa,EACb,MAAc,EACd,OAAe;IAEnB,MAAM,kBAAkB,GAAG,OAAO,GAAG,KAAK,CAAC;IAC3C,MAAM,oBAAoB,GAAG,kBAAkB,GAAG,IAAI,CAAC;IAEvD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAE,CAAC;IAC5C,MAAM,OAAO,GAAG,qBAAqB,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAClE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QAAE,OAAO,SAAS,CAAC;KAAE;IAEtC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,GAAG,CAAC;IACrB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC1B,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC;QACpC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;QAClB,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,EAAC,EAAE,CAAC,CAAC;QAChC,IAAI,CAAC,GAAG,kBAAkB,EAAE;YACxB,SAAS;SACZ;QAED,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7D,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAClD,MAAM,QAAQ,GAAG,GAAG,CAAC,EAAE,EAAC,EAAE,CAAC,CAAC;QAE5B,IAAI,QAAQ,GAAG,eAAe;YAC1B,CAAC,CAAC,GAAG,oBAAoB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;YAElD,sCAAsC;YACtC,OAAO,MAAM,CAAC;SACjB;KACJ;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAGD,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
-
import { CpNode } from '
|
|
3
|
-
import { Loop } from '
|
|
2
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
3
|
+
import { Loop } from 'flo-boolean';
|
|
4
4
|
/**
|
|
5
5
|
* Represents a complete Medial Axis Transform (MAT).
|
|
6
6
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mat.js","sourceRoot":"","sources":["../../src/mat/mat.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { closestPointOnBezier, hausdorffDistance, toCubic } from 'flo-bezier3';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { isTerminating } from '../cp-node/cp-node.js';
|
|
3
|
+
import { getBranches } from './get-branches.js';
|
|
4
|
+
import { getCurveToNext } from '../cp-node/get-curve-to-next.js';
|
|
4
5
|
import { getCurveBetween } from '../get-curve/get-curve-between.js';
|
|
5
6
|
/**
|
|
6
7
|
* Simplifies the given MAT by replacing the piecewise quad beziers composing
|
|
@@ -19,7 +20,7 @@ import { getCurveBetween } from '../get-curve/get-curve-between.js';
|
|
|
19
20
|
function simplifyMatMapOnly(cpNode, anlgeTolerance = 15, hausdorffTolerance = 1e-1, hausdorffSpacing = 1e0) {
|
|
20
21
|
const simpleMap = new Map();
|
|
21
22
|
// Start from a leaf
|
|
22
|
-
while (!
|
|
23
|
+
while (!isTerminating(cpNode)) {
|
|
23
24
|
cpNode = cpNode.next;
|
|
24
25
|
}
|
|
25
26
|
const branches = getBranches(cpNode, anlgeTolerance);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simplify-mat-map-only.js","sourceRoot":"","sources":["../../src/mat/simplify-mat-map-only.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"simplify-mat-map-only.js","sourceRoot":"","sources":["../../src/mat/simplify-mat-map-only.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAU,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAGpE;;;;;;;;;;;;;GAaG;AACH,SAAS,kBAAkB,CACnB,MAA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AGD,SAAS,yBAAyB,CAC1B,CAAS,EACT,CAAS,EACT,MAAgB,EAChB,gBAAwB;IAE5B,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,MAAM,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC7D,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,CAAC,GAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACtB,GAAG,CAAC,IAAI,CAAC,iBAAiB,CACtB,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EACzB,SAAS,EACT,gBAAgB,CACnB,CAAC,CAAC;KACN;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;AAC5B,CAAC;AAGD,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -6,11 +6,9 @@ import { Mat } from './mat.js';
|
|
|
6
6
|
* @param anlgeTolerance Tolerance given as the degrees difference of the unit
|
|
7
7
|
* direction vectors at the interface between curves. A tolerance of zero means
|
|
8
8
|
* perfect smoothness is required - defaults to 15.
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
* defaults to
|
|
12
|
-
* @param maxIterations The spacing on the curves used to calculate the Hausdorff
|
|
13
|
-
* Distance - defaults to 1
|
|
9
|
+
* @param hausdorffTolerance The approximate maximum Hausdorff Distance tolerance -
|
|
10
|
+
* defaults to `2**-3`
|
|
11
|
+
* @param maxIterations The max iterations, defaults to `50`
|
|
14
12
|
*/
|
|
15
13
|
declare function simplifyMat(mat: Mat, anlgeTolerance?: number, hausdorffTolerance?: number, maxIterations?: number): Mat;
|
|
16
14
|
export { simplifyMat };
|