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/find-mats.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { simplifyPaths } from 'flo-boolean';
|
|
2
|
-
import { findAndAddAll3Prongs } from './mat/find-mat/find-and-add-3-prongs.js';
|
|
3
|
-
import { createInitialCpGraph } from './mat/find-mat/create-initial-cp-graph.js';
|
|
4
|
-
import { addDebugInfo1, addDebugInfo2, addDebugInfo3, addDebugInfo4 } from './mat/find-mat/add-debug-info.js';
|
|
5
|
-
import { getPotential2Prongs } from './mat/find-mat/get-potential-2-prongs.js';
|
|
6
|
-
import { getSharpCorners } from './mat/find-mat/get-sharp-corners.js';
|
|
7
|
-
import { findAndAdd2ProngsOnAllPaths } from './mat/find-mat/find-and-add-2-prongs-on-all-paths.js';
|
|
8
|
-
import { getInterestingPointsOnLoop } from './mat/find-mat/create-get-interesting-points-on-loop.js';
|
|
9
|
-
import { findAndAddHoleClosing2Prongs } from './mat/find-mat/find-and-add-hole-closing-2-prongs.js';
|
|
10
|
-
import { getLoopsMetrics } from './loop/get-max-coordinate.js';
|
|
11
|
-
/**
|
|
12
|
-
* Finds and returns the Medial Axis Transforms (MATs) from the given array of
|
|
13
|
-
* bezier loops representing shape boundaries.
|
|
14
|
-
*
|
|
15
|
-
* @param bezierLoops An array of (possibly intersecting) loops with each loop
|
|
16
|
-
* representing one or more piecewise smooth closed curves (i.e. shapes). Each
|
|
17
|
-
* loop consists of an array of beziers represented by an array of control
|
|
18
|
-
* points with 2,3 or 4 elements corresponding to linear, quadratic and cubic
|
|
19
|
-
* beziers respectively. Each point is a two-element array (ordered pair), the
|
|
20
|
-
* first of which is the x-coordinate and the second the y-coordinate.
|
|
21
|
-
*
|
|
22
|
-
* @param maxCurviness The maximum value the 'curviness' of a curve can have
|
|
23
|
-
* before an additional MAT point is inserted in between. Defaults to 0.4.
|
|
24
|
-
* (Curviness is measured as the total angle in radians between the consecutive
|
|
25
|
-
* vectors formed by the ordered control points of th bezier curve). The value
|
|
26
|
-
* is clipped in the range `[0.05,3]`.
|
|
27
|
-
* @param maxLength The maximum length a curve can have before an additional MAT
|
|
28
|
-
* point is inserted. This value is scaled to a reference 1024 x 1024
|
|
29
|
-
* grid (e.g. if the shape fits in a 512 x 512 axis-aligned box the value will be
|
|
30
|
-
* halved, e.g. from 10 to 5). Together with maxCurviness it represents a
|
|
31
|
-
* tolerance for the accuracy of the MAT. Defaults to 4. The value is clipped
|
|
32
|
-
* in [1,100].
|
|
33
|
-
*/
|
|
34
|
-
function findMats(bezierLoops, maxCurviness = 0.4, maxLength = 4) {
|
|
35
|
-
// if (typeof _debug_ !== 'undefined') { var timingStart = performance.now(); }
|
|
36
|
-
let maxCoordinate;
|
|
37
|
-
let minBezLength;
|
|
38
|
-
({ maxCurviness, maxLength, maxCoordinate, minBezLength } =
|
|
39
|
-
getSizeParams(bezierLoops, maxCurviness, maxLength));
|
|
40
|
-
const loopss = simplifyPaths(bezierLoops, maxCoordinate);
|
|
41
|
-
const mats = [];
|
|
42
|
-
for (const loops of loopss) {
|
|
43
|
-
const mat = findMat(loops, minBezLength, maxCurviness, maxLength, maxCoordinate);
|
|
44
|
-
if (mat) {
|
|
45
|
-
mats.push(mat);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return mats;
|
|
49
|
-
}
|
|
50
|
-
function getSizeParams(bezierLoops, maxCurviness, maxLength) {
|
|
51
|
-
// Gather some shape metrics
|
|
52
|
-
const { maxCoordinate, maxRadius } = getLoopsMetrics(bezierLoops);
|
|
53
|
-
const expMax = Math.ceil(Math.log2(maxCoordinate));
|
|
54
|
-
const minBezLengthSigBits = 14;
|
|
55
|
-
/**
|
|
56
|
-
* If a curve is shorter than this value then no points on it will be
|
|
57
|
-
* selected for the purpose of finding the MAT.
|
|
58
|
-
*/
|
|
59
|
-
const minBezLength = 2 ** expMax * 2 ** (-minBezLengthSigBits);
|
|
60
|
-
// Limit the tolerance to a reasonable level
|
|
61
|
-
if (maxCurviness < 0.05) {
|
|
62
|
-
maxCurviness = 0.05;
|
|
63
|
-
}
|
|
64
|
-
if (maxCurviness > 3) {
|
|
65
|
-
maxCurviness = 3;
|
|
66
|
-
}
|
|
67
|
-
// Limit the tolerance to a reasonable level
|
|
68
|
-
if (maxLength < 0.1) {
|
|
69
|
-
maxLength = 0.1;
|
|
70
|
-
}
|
|
71
|
-
if (maxLength > 100) {
|
|
72
|
-
maxLength = 100;
|
|
73
|
-
}
|
|
74
|
-
// Adjust length tolerance according to a reference max coordinate
|
|
75
|
-
const expMaxRadius = Math.ceil(Math.log2(maxRadius));
|
|
76
|
-
const maxLengthSigBits = 10; // 1024 x 1024
|
|
77
|
-
maxLength = maxLength * (2 ** expMaxRadius * 2 ** (-maxLengthSigBits));
|
|
78
|
-
return { maxCurviness, maxLength, maxCoordinate, minBezLength };
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* @hidden
|
|
82
|
-
* Find the MAT of the given loops.
|
|
83
|
-
* @param loops The loops (that as a precondition must be ordered from highest
|
|
84
|
-
* (i.e. smallest y-value) topmost point loops to lowest)
|
|
85
|
-
*/
|
|
86
|
-
function findMat(loops, minBezLength, maxCurviness, maxLength, maxCoordinate) {
|
|
87
|
-
addDebugInfo1(loops);
|
|
88
|
-
// Gets interesting points on the shape, i.e. those that makes sense to use
|
|
89
|
-
// for the 2-prong procedure.
|
|
90
|
-
const pointsPerLoop = loops.map(getInterestingPointsOnLoop(minBezLength, maxCurviness, maxLength));
|
|
91
|
-
const for2ProngsPerLoop = getPotential2Prongs(pointsPerLoop);
|
|
92
|
-
const sharpCornersPerLoop = getSharpCorners(pointsPerLoop);
|
|
93
|
-
const cpTrees = new Map();
|
|
94
|
-
let cpNode = createInitialCpGraph(loops, cpTrees, sharpCornersPerLoop);
|
|
95
|
-
findAndAddHoleClosing2Prongs(loops, cpTrees, maxCoordinate);
|
|
96
|
-
if (typeof _debug_ !== 'undefined') {
|
|
97
|
-
if (_debug_.directives.stopAfterHoleClosers) {
|
|
98
|
-
return undefined;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
addDebugInfo2();
|
|
102
|
-
cpNode = findAndAdd2ProngsOnAllPaths(loops, cpTrees, for2ProngsPerLoop, maxCoordinate);
|
|
103
|
-
addDebugInfo3();
|
|
104
|
-
if (typeof _debug_ !== 'undefined') {
|
|
105
|
-
if (_debug_.directives.stopAfterTwoProngs) {
|
|
106
|
-
return undefined;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
if (cpNode === undefined) {
|
|
110
|
-
return undefined;
|
|
111
|
-
}
|
|
112
|
-
findAndAddAll3Prongs(cpTrees, cpNode, maxCoordinate);
|
|
113
|
-
if (typeof _debug_ !== 'undefined') {
|
|
114
|
-
if (_debug_.directives.stopAfterThreeProngs) {
|
|
115
|
-
return undefined;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
const mat = { cpNode, cpTrees };
|
|
119
|
-
addDebugInfo4(mat);
|
|
120
|
-
return mat;
|
|
121
|
-
}
|
|
122
|
-
export { findMats };
|
|
123
|
-
//# sourceMappingURL=find-mats.js.map
|
package/node/find-mats.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find-mats.js","sourceRoot":"","sources":["../src/find-mats.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAK5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAC9G,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,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AAO,CAAC,CAAC,CAChB,CAAC;KACL;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAGD;;;GAGG;AACH,SAAS,iBAAiB,CAClB,OAAyB,EACzB,UAAkB,EAClB,QAAkB,EAClB,EAAmB;IAEvB,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,OAAO,CAAC,IAAI;QACR,oCAAoC;QACpC,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAChC,CAAC;KACL,QAAQ,SAAS,KAAK,QAAQ,EAAE;AACrC,CAAC;AAGD,OAAO,EAAE,wBAAwB,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-bounding-box-.js","sourceRoot":"","sources":["../src/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"}
|
package/node/get-branches.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-branches.js","sourceRoot":"","sources":["../src/get-branches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,cAAc;AACd,MAAM,gBAAgB,GAAG,CAAC,CAAC,CAAC,WAAW;AAGvC;;;;;;;;GAQG;AACH,SAAS,W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EAAC,EAAE,CAAC,CAAC;IAE5B,2DAA2D;IAC3D,wDAAwD;IACxD,2CAA2C;IAC3C,0DAA0D;IAE1D,0DAA0D;IAC1D,MAAM,aAAa,GAAG,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAE9C,IAAI,aAAa,KAAK,CAAC,EAAE;QACxB,OAAO,aAAa,CAAC;KAClB;IAED,yDAAyD;IACzD,wDAAwD;IACxD,2CAA2C;IAC3C,MAAM,WAAW,GAAG,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;IACtD,IAAI,WAAW,GAAG,CAAC,EAAE;QACjB,+DAA+D;QAC/D,kBAAkB;QAClB,uEAAuE;QACvE,0CAA0C;QAC1C,OAAO,CAAC,CAAC;KACZ;IAED,4EAA4E;IAC5E,qEAAqE;IACrE,sEAAsE;IAEtE,oBAAoB;IACpB,OAAO,4BAA4B,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC;AACpE,CAAC;AAGD,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
package/node/loop.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Curve } from './curve.js';
|
|
2
|
-
/**
|
|
3
|
-
* Represents a two-way linked loop of [[ICurve]]s - mostly used internally to
|
|
4
|
-
* conveniently represent shape boundaries.
|
|
5
|
-
*/
|
|
6
|
-
interface Loop {
|
|
7
|
-
/** The curves that represent the shape boundary as an array. */
|
|
8
|
-
curves: Curve[];
|
|
9
|
-
/** A pre-ordered array of bezier curves to add initially.*/
|
|
10
|
-
beziers: number[][][];
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* @param beziers A pre-ordered array of bezier curves to add initially.
|
|
14
|
-
*/
|
|
15
|
-
declare function loopFromBeziers(beziers?: number[][][]): Loop;
|
|
16
|
-
export { Loop, loopFromBeziers };
|
package/node/loop.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param beziers A pre-ordered array of bezier curves to add initially.
|
|
3
|
-
*/
|
|
4
|
-
function loopFromBeziers(beziers = []) {
|
|
5
|
-
const curves = [];
|
|
6
|
-
const loop = {
|
|
7
|
-
beziers,
|
|
8
|
-
curves
|
|
9
|
-
};
|
|
10
|
-
if (!beziers.length) {
|
|
11
|
-
return loop;
|
|
12
|
-
}
|
|
13
|
-
let prev;
|
|
14
|
-
for (let i = 0; i < beziers.length; i++) {
|
|
15
|
-
const curve = {
|
|
16
|
-
loop,
|
|
17
|
-
ps: beziers[i],
|
|
18
|
-
prev,
|
|
19
|
-
next: undefined,
|
|
20
|
-
idx: i
|
|
21
|
-
};
|
|
22
|
-
if (prev) {
|
|
23
|
-
prev.next = curve;
|
|
24
|
-
}
|
|
25
|
-
prev = curve;
|
|
26
|
-
curves.push(curve);
|
|
27
|
-
}
|
|
28
|
-
// close loop
|
|
29
|
-
const lastCurve = curves[curves.length - 1];
|
|
30
|
-
curves[0].prev = lastCurve;
|
|
31
|
-
lastCurve.next = curves[0];
|
|
32
|
-
return loop;
|
|
33
|
-
}
|
|
34
|
-
export { loopFromBeziers };
|
|
35
|
-
//# sourceMappingURL=loop.js.map
|
package/node/loop.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loop.js","sourceRoot":"","sources":["../src/loop.ts"],"names":[],"mappings":"AAeA;;GAEG;AACH,SAAS,eAAe,CAAC,UAAwB,EAAE;IAC/C,MAAM,MAAM,GAAY,EAAE,CAAC;IAE3B,MAAM,IAAI,GAAS;QACf,OAAO;QACP,MAAM;KACT,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QAAE,OAAO,IAAI,CAAC;KAAE;IAErC,IAAI,IAAW,CAAC;IAEhB,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAEjC,MAAM,KAAK,GAAU;YACjB,IAAI;YACJ,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;YACd,IAAI;YACJ,IAAI,EAAE,SAAS;YACf,GAAG,EAAE,CAAC;SACT,CAAC;QAEF,IAAI,IAAI,EAAE;YAAE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;SAAE;QAChC,IAAI,GAAG,KAAK,CAAC;QAEb,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACtB;IAED,aAAa;IACb,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC;IAC3B,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAE3B,OAAO,IAAI,CAAC;AAChB,CAAC;AAGD,OAAO,EAAQ,eAAe,EAAE,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Curve } from "../../curve.js";
|
|
2
|
-
/**
|
|
3
|
-
* @hidden
|
|
4
|
-
* @param curve The curve
|
|
5
|
-
* @param p The point from which to check
|
|
6
|
-
* @param tRange The allowed t range
|
|
7
|
-
* @param touchedCurve The bezier on which p is located
|
|
8
|
-
* @param t The t value of the bezier that locates p
|
|
9
|
-
*/
|
|
10
|
-
declare function closestPointsOnCurve(curve: Curve, p: number[], [tS, tE]: number[], touchedCurve: Curve, t: number): {
|
|
11
|
-
p: number[];
|
|
12
|
-
t: number;
|
|
13
|
-
}[];
|
|
14
|
-
export { closestPointsOnCurve };
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// qqq import { deflateQuad, allRootsMultiWithErrBounds, RootInterval } from 'flo-poly';
|
|
2
|
-
// qqq import { getTangentPolyFromPointExact, evalDeCasteljau, evaluate, getFootpointPolyExact } from 'flo-bezier3';
|
|
3
|
-
import { ddDeflate, allRootsCertified } from 'flo-poly';
|
|
4
|
-
import { evaluate, getFootpointPolyDd } from 'flo-bezier3';
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
* @param curve The curve
|
|
8
|
-
* @param p The point from which to check
|
|
9
|
-
* @param tRange The allowed t range
|
|
10
|
-
* @param touchedCurve The bezier on which p is located
|
|
11
|
-
* @param t The t value of the bezier that locates p
|
|
12
|
-
*/
|
|
13
|
-
function closestPointsOnCurve(curve, p, [tS, tE] = [0, 1], touchedCurve, t) {
|
|
14
|
-
// qqq let poly = getTangentPolyFromPointExact(curve.ps, p);
|
|
15
|
-
const _poly = getFootpointPolyDd(curve.ps, p);
|
|
16
|
-
// qqq poly = deflateQuad(poly, t);
|
|
17
|
-
const poly = curve === touchedCurve
|
|
18
|
-
? ddDeflate(_poly, t)
|
|
19
|
-
: _poly;
|
|
20
|
-
// let roots: Omit<RootInterval,'multiplicity'>[] = allRootsMultiWithErrBounds(
|
|
21
|
-
const roots = allRootsCertified(poly, tS, tE);
|
|
22
|
-
// Also test the endpoints
|
|
23
|
-
let push0 = true;
|
|
24
|
-
let push1 = true;
|
|
25
|
-
if ((t === 1 && curve === touchedCurve.next) ||
|
|
26
|
-
(t === 0 && curve === touchedCurve)) {
|
|
27
|
-
push0 = false;
|
|
28
|
-
}
|
|
29
|
-
if ((t === 0 && curve === touchedCurve.prev) ||
|
|
30
|
-
(t === 1 && curve === touchedCurve)) {
|
|
31
|
-
push1 = false;
|
|
32
|
-
}
|
|
33
|
-
if (tS === 0) {
|
|
34
|
-
if (push0) {
|
|
35
|
-
roots.push({ tS: 0, tE: 0 });
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
else if (tS === 1) {
|
|
39
|
-
if (push1) {
|
|
40
|
-
roots.push({ tS: 1, tE: 1 });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
roots.push({ tS: tS, tE: tS });
|
|
45
|
-
}
|
|
46
|
-
if (tE === 0) {
|
|
47
|
-
if (push0) {
|
|
48
|
-
roots.push({ tS: 0, tE: 0 });
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
else if (tE === 1) {
|
|
52
|
-
if (push1) {
|
|
53
|
-
roots.push({ tS: 1, tE: 1 });
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
roots.push({ tS: tE, tE: tE });
|
|
58
|
-
}
|
|
59
|
-
const ps = roots.map(root => {
|
|
60
|
-
const tS = root.tS;
|
|
61
|
-
const tE = root.tE;
|
|
62
|
-
// TODO - tS, tE should always stay within [0,1] - modify findRootsMulti
|
|
63
|
-
const t = tS < 0
|
|
64
|
-
? 0
|
|
65
|
-
: tE > 1 ? 1 : (tS + tE) / 2;
|
|
66
|
-
// TODO - why does evalDeCasteljau not work here?
|
|
67
|
-
return { p: evaluate(curve.ps, t), t };
|
|
68
|
-
//return { p: evalDeCasteljau(curve.ps,t), t }
|
|
69
|
-
});
|
|
70
|
-
return ps;
|
|
71
|
-
}
|
|
72
|
-
export { closestPointsOnCurve };
|
|
73
|
-
//# sourceMappingURL=closest-points-on-curve.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"closest-points-on-curve.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/closest-points-on-curve.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,oHAAoH;AACpH,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAgB,MAAM,UAAU,CAAC;AACtE,OAAO,EAAmB,QAAQ,EAAE,kBAAkB,EAAyB,MAAM,aAAa,CAAC;AAKnG;;;;;;;GAOG;AACH,SAAS,oBAAoB,CACrB,KAAY,EACZ,CAAW,EACX,CAAC,EAAE,EAAC,EAAE,IAAc,CAAC,CAAC,EAAC,CAAC,CAAC,EACzB,YAAmB,EACnB,CAAS;IAKb,4DAA4D;IAC5D,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAE9C,mCAAmC;IACnC,MAAM,IAAI,GAAG,KAAK,K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AC,CAAC;SAAE;KAC/C;SAAM,IAAI,EAAE,KAAK,CAAC,EAAE;QACjB,IAAI,KAAK,EAAE;YAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;SAAE;KAC/C;SAAM;QACH,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;KAClC;IAED,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,CAChB,IAAI,CAAC,EAAE;QACH,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACnB,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACnB,wEAAwE;QACxE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;YACZ,CAAC,CAAC,CAAC;YACH,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAC,CAAC,CAAC;QAC/B,iDAAiD;QACjD,OAAO,EAAE,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;QACrC,8CAA8C;IAClD,CAAC,CACJ,CAAC;IAEF,OAAO,EAAE,CAAC;AACd,CAAC;AAGD,OAAO,EAAE,oBAAoB,EAAE,CAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { getBestDistanceSquared } from './get-best-distance-squared.js';
|
|
2
|
-
import { cullByLooseBoundingBox } from './cull-by-loose-bounding-box.js';
|
|
3
|
-
import { cullByTightBoundingBox } from './cull-by-tight-boundary-box.js';
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
* @param bezierPieces
|
|
7
|
-
* @param p
|
|
8
|
-
* @param extreme
|
|
9
|
-
*/
|
|
10
|
-
function cullBezierPieces(bezierPieces, p) {
|
|
11
|
-
const CULL_THRESHOLD = 0;
|
|
12
|
-
if (bezierPieces.length > CULL_THRESHOLD) {
|
|
13
|
-
const bestSquaredDistance = getBestDistanceSquared(bezierPieces, p);
|
|
14
|
-
bezierPieces = cullByLooseBoundingBox(bezierPieces, p, bestSquaredDistance);
|
|
15
|
-
bezierPieces = cullByTightBoundingBox(bezierPieces, p, bestSquaredDistance);
|
|
16
|
-
}
|
|
17
|
-
return bezierPieces;
|
|
18
|
-
}
|
|
19
|
-
export { cullBezierPieces };
|
|
20
|
-
//# sourceMappingURL=cull-bezier-pieces.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cull-bezier-pieces.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/cull-bezier-pieces.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAGzE;;;;;GAKG;AACH,SAAS,gBAAgB,CACjB,YAA2B,EAC3B,CAAW;IAEf,MAAM,cAAc,GAAG,CAAC,CAAC;IAEzB,IAAI,YAAY,CAAC,MAAM,GAAG,cAAc,EAAE;QACtC,MAAM,mBAAmB,GAAG,sBAAsB,CAC9C,YAAY,EAAE,CAAC,CAClB,CAAC;QACF,YAAY,GAAG,sBAAsB,CACjC,YAAY,EAAE,CAAC,EACf,mBAAmB,CACtB,CAAC;QAEF,YAAY,GAAG,sBAAsB,CACjC,YAAY,EAAE,CAAC,EACf,mBAAmB,CACtB,CAAC;KACL;IAED,OAAO,YAAY,CAAC;AACxB,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cull-by-loose-bounding-box.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/cull-by-loose-bounding-box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AAGpG;;;;;;;GAOG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW,EACX,QAAgB;IAEpB,MAAM,qBAAqB,GAAG,EAAE,CAAC;IAEjC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAEhC,MAAM,WAAW,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;QAExC,MAAM,CAAC,GAAG,8BAA8B,CACpC,WAAW,EACX,CAAC,CACJ,CAAC;QACF,IAAI,CAAC,IAAI,QAAQ,EAAE;YACf,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC3C;KACJ;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cull-by-tight-boundary-box.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/cull-by-tight-boundary-box.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,sCAAsC,EAAE,MAAM,6DAA6D,CAAC;AAGrH,MAAM,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAG1D;;;;;;;GAOG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW,EACX,mBAA2B;IAE/B,MAAM,qBAAqB,GAAG,EAAE,CAAC;IAEjC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAEhC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,EAAE,CAAC,CAAC;QAClD,MAAM,CAAC,GAAG,sCAAsC,CACxC,gBAAgB,EAChB,CAAC,CACR,CAAC;QACF,IAAI,CAAC,IAAI,mBAAmB,EAAE;YAC1B,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAC3C;KACJ;IAED,OAAO,qBAAqB,CAAC;AACjC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-best-distance-squared.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-best-distance-squared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAItD;;;;GAIG;AACH,SAAS,sBAAsB,CACvB,YAA2B,EAC3B,CAAW;IAEf,IAAI,mBAAmB,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACnD,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAEpC,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;QAEhC,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAClD,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAElD,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CACd,sBAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,EAC7B,sBAAsB,CAAC,CAAC,EAAE,EAAE,CAAC,CAChC,CAAC;QAEF,IAAI,CAAC,GAAG,mBAAmB,EAAE;YACzB,mBAAmB,GAAG,CAAC,CAAC;SAC3B;KACJ;IAED,mEAAmE;IACnE,6CAA6C;IAC7C,OAAO,mBAAmB,GAAG,IAAI,CAAC;AACtC,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IPointOnShape } from '../../point-on-shape.js';
|
|
2
|
-
import { BezierPiece } from '../bezier-piece.js';
|
|
3
|
-
/**
|
|
4
|
-
* @hidden
|
|
5
|
-
* Returns the closest boundary point to the given point, limited to the given
|
|
6
|
-
* bezier pieces, including the beziers actually checked after culling.
|
|
7
|
-
* @param bezierPieces
|
|
8
|
-
* @param point
|
|
9
|
-
* @param touchedCurve
|
|
10
|
-
* @param t
|
|
11
|
-
* @param extreme
|
|
12
|
-
*/
|
|
13
|
-
declare function getCloseBoundaryPoints(bezierPieces: BezierPiece[], point: number[], y: IPointOnShape, distance: number): {
|
|
14
|
-
pos: IPointOnShape;
|
|
15
|
-
d: number;
|
|
16
|
-
}[];
|
|
17
|
-
export { getCloseBoundaryPoints };
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { distanceBetween } from 'flo-vector2d';
|
|
2
|
-
import { PointOnShape } from '../../point-on-shape.js';
|
|
3
|
-
import { cullBezierPieces } from './cull-bezier-pieces.js';
|
|
4
|
-
import { closestPointsOnCurve } from './closest-points-on-curve.js';
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
* Returns the closest boundary point to the given point, limited to the given
|
|
8
|
-
* bezier pieces, including the beziers actually checked after culling.
|
|
9
|
-
* @param bezierPieces
|
|
10
|
-
* @param point
|
|
11
|
-
* @param touchedCurve
|
|
12
|
-
* @param t
|
|
13
|
-
* @param extreme
|
|
14
|
-
*/
|
|
15
|
-
function getCloseBoundaryPoints(bezierPieces, point, y, distance) {
|
|
16
|
-
const touchedCurve = y.curve;
|
|
17
|
-
const t = y.t;
|
|
18
|
-
const p_ = y.p;
|
|
19
|
-
bezierPieces = cullBezierPieces(bezierPieces, point);
|
|
20
|
-
// TODO - integrate with is-another-cp-closeby - we MUST check angle too!
|
|
21
|
-
const DISTANCE_TOLERANCE = 1e-9;
|
|
22
|
-
const posInfos = [];
|
|
23
|
-
for (let i = 0; i < bezierPieces.length; i++) {
|
|
24
|
-
const bezierPiece = bezierPieces[i];
|
|
25
|
-
// TOOD - important - should be able to return multiple points
|
|
26
|
-
const ps = closestPointsOnCurve(bezierPiece.curve, point, bezierPiece.ts, touchedCurve, t);
|
|
27
|
-
//if (ps === undefined) { continue; }
|
|
28
|
-
for (let j = 0; j < ps.length; j++) {
|
|
29
|
-
const p = ps[j];
|
|
30
|
-
const d = distanceBetween(p.p, point);
|
|
31
|
-
let curve = bezierPiece.curve;
|
|
32
|
-
let t_ = p.t;
|
|
33
|
-
if (Math.abs(d - distance) < DISTANCE_TOLERANCE) {
|
|
34
|
-
if (t_ === 0) {
|
|
35
|
-
t_ = 1;
|
|
36
|
-
curve = bezierPiece.curve.prev;
|
|
37
|
-
}
|
|
38
|
-
posInfos.push({ pos: new PointOnShape(curve, t_), d });
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
if (posInfos.length > 1) {
|
|
43
|
-
// Remove ones that are too close together.
|
|
44
|
-
// TODO - in future remove all these checks and join n-prongs when they
|
|
45
|
-
// are being added - much simpler and more symmetric. Remeber order when
|
|
46
|
-
// comparing closeness!
|
|
47
|
-
const indexesToCheck = [];
|
|
48
|
-
for (let i = 0; i < posInfos.length; i++) {
|
|
49
|
-
const pi = posInfos[i];
|
|
50
|
-
// Only check if they are close to the edges. Why??
|
|
51
|
-
//if (pi.pos.t < 1e-2 || 1-pi.pos.t < 1e-2) {
|
|
52
|
-
indexesToCheck.push(i);
|
|
53
|
-
//}
|
|
54
|
-
}
|
|
55
|
-
const indexesToRemove = [];
|
|
56
|
-
for (let i = 0; i < indexesToCheck.length; i++) {
|
|
57
|
-
for (let j = i + 1; j < indexesToCheck.length; j++) {
|
|
58
|
-
if (i === j) {
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
const p1 = posInfos[indexesToCheck[i]].pos.p;
|
|
62
|
-
const p2 = posInfos[indexesToCheck[j]].pos.p;
|
|
63
|
-
// Below checks for source point too - similar to
|
|
64
|
-
// isAnotherCpCloseBy
|
|
65
|
-
const p3 = p_;
|
|
66
|
-
if ((Math.abs(p1[0] - p2[0]) < 1e-6 &&
|
|
67
|
-
Math.abs(p1[1] - p2[1]) < 1e-6) ||
|
|
68
|
-
(Math.abs(p1[0] - p3[0]) < 1e-6 &&
|
|
69
|
-
Math.abs(p1[1] - p3[1]) < 1e-6)) {
|
|
70
|
-
indexesToRemove.push(indexesToCheck[i]);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
for (let i = indexesToRemove.length - 1; i >= 0; i--) {
|
|
75
|
-
posInfos.splice(indexesToRemove[i], 1);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return posInfos;
|
|
79
|
-
}
|
|
80
|
-
export { getCloseBoundaryPoints };
|
|
81
|
-
//# sourceMappingURL=get-close-boundary-points.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-close-boundary-points.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-close-boundary-points.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAiB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,oBAAoB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,CAAC,GAAG,IAAI;oBACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;oBAE/B,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;wBAC9B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAC/B;oBAEF,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;iBACxC;aACD;SACD;QACD,KAAK,IAAI,CAAC,GAAC,eAAe,CAAC,MAAM,GAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YAChD,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SACzC;KACD;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC;AAGD,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Curve } from '../../curve.js';
|
|
2
|
-
import { IPointOnShape } from '../../point-on-shape.js';
|
|
3
|
-
import { BezierPiece } from '../bezier-piece.js';
|
|
4
|
-
/**
|
|
5
|
-
* @hidden
|
|
6
|
-
* Returns the closest boundary point to the given point, limited to the given
|
|
7
|
-
* bezier pieces, including the beziers actually checked after culling.
|
|
8
|
-
* @param bezierPieces
|
|
9
|
-
* @param point
|
|
10
|
-
* @param touchedCurve
|
|
11
|
-
* @param t
|
|
12
|
-
* @param extreme
|
|
13
|
-
*/
|
|
14
|
-
declare function getClosestBoundaryPoint(bezierPieces: BezierPiece[], point: number[], touchedCurve: Curve, t: number): {
|
|
15
|
-
pos: IPointOnShape;
|
|
16
|
-
d: number;
|
|
17
|
-
};
|
|
18
|
-
export { getClosestBoundaryPoint };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { distanceBetween, getObjClosestTo } from 'flo-vector2d';
|
|
2
|
-
import { PointOnShape } from '../../point-on-shape.js';
|
|
3
|
-
import { cullBezierPieces } from './cull-bezier-pieces.js';
|
|
4
|
-
import { closestPointsOnCurve } from './closest-points-on-curve.js';
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
* Returns the closest boundary point to the given point, limited to the given
|
|
8
|
-
* bezier pieces, including the beziers actually checked after culling.
|
|
9
|
-
* @param bezierPieces
|
|
10
|
-
* @param point
|
|
11
|
-
* @param touchedCurve
|
|
12
|
-
* @param t
|
|
13
|
-
* @param extreme
|
|
14
|
-
*/
|
|
15
|
-
function getClosestBoundaryPoint(bezierPieces, point, touchedCurve, t) {
|
|
16
|
-
bezierPieces = cullBezierPieces(bezierPieces, point);
|
|
17
|
-
let bestDistance = Number.POSITIVE_INFINITY;
|
|
18
|
-
let posInfo;
|
|
19
|
-
for (let i = 0; i < bezierPieces.length; i++) {
|
|
20
|
-
const bezierPiece = bezierPieces[i];
|
|
21
|
-
const ps = closestPointsOnCurve(bezierPiece.curve, point, bezierPiece.ts, touchedCurve, t);
|
|
22
|
-
const p = getObjClosestTo(point, ps, p => p.p);
|
|
23
|
-
if (p === undefined) {
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
const d = distanceBetween(p.p, point);
|
|
27
|
-
let curve = bezierPiece.curve;
|
|
28
|
-
let t_ = p.t;
|
|
29
|
-
if (d < bestDistance) {
|
|
30
|
-
if (t_ === 0) {
|
|
31
|
-
t_ = 1;
|
|
32
|
-
curve = bezierPiece.curve.prev;
|
|
33
|
-
}
|
|
34
|
-
posInfo = { pos: new PointOnShape(curve, t_), d };
|
|
35
|
-
bestDistance = d;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return posInfo;
|
|
39
|
-
}
|
|
40
|
-
export { getClosestBoundaryPoint };
|
|
41
|
-
//# sourceMappingURL=get-closest-boundary-point.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-closest-boundary-point.js","sourceRoot":"","sources":["../../../src/mat/closest-boundary-point/get-closest-boundary-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhE,OAAO,EAAE,YAAY,EAAiB,MAAM,yBAAyB,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAGpE;;;;;;;;;GASG;AACH,SAAS,uBAAuB,CACxB,YAA2B,EAC3B,KAAe,EACrB,YAAmB,EACnB,CAAS;IAEV,YAAY,GAAG,gBAAgB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAErD,IAAI,YAAY,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAC5C,IAAI,OAA0C,CAAC;IAC/C,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACzC,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAEpC,MAAM,EAAE,GAAG,oBAAoB,CAC7B,WAAW,CAAC,KAAK,EACjB,KAAK,EACL,WAAW,CAAC,EAAE,EACd,YAAY,EACZ,CAAC,CACF,CAAC;QAEF,MAAM,CAAC,GAAG,eAAe,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAE9C,IAAI,CAAC,KAAK,SAAS,EAAE;YAAE,SAAS;SAAE;QAElC,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAEtC,IAAI,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;QAC9B,IAAI,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC;QAEZ,IAAI,CAAC,GAAG,YAAY,EAAE;YACrB,IAAI,EAAE,KAAK,CAAC,EAAE;gBACb,EAAE,GAAG,CAAC,CAAC;gBACP,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC;aAC/B;YAED,OAAO,GAAG,EAAE,GAAG,EAAE,IAAI,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;YAClD,YAAY,GAAG,CAAC,CAAC;SACjB;KACD;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAGD,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
-
import { Loop } from '../../loop.js';
|
|
3
|
-
import { IPointOnShape } from '../../point-on-shape.js';
|
|
4
|
-
import { CpNode } from '../../cp-node.js';
|
|
5
|
-
/**
|
|
6
|
-
* @hidden
|
|
7
|
-
* Add a 1-prong to the MAT.
|
|
8
|
-
* @param cpGraphs
|
|
9
|
-
* @param pos
|
|
10
|
-
*/
|
|
11
|
-
declare function add1Prong(maxOsculatingCircleRadius: number, cpGraphs: Map<Loop, LlRbTree<CpNode>>, pos: IPointOnShape): void;
|
|
12
|
-
export { add1Prong };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-1-prong.js","sourceRoot":"","sources":["../../../src/mat/find-mat/add-1-prong.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,eAAe,EAAiB,MAAM,yBAAyB,CAAC;AAE5G,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGjE;;;;;GAKG;AACH,SAAS,SAAS,CAChB,yBAAiC,EAC3B,QAAoC,EACpC,GAAkB;IAEzB,uCAAuC;IACpC,IAAI,eAAe,CAAC,GAAG,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AE,CAAC,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAE3B,QAAQ;QACR,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC5B,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC5B,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAC5B,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAE5B,aAAa;QACb,MAAM,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC3B,MAAM,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAE3B,OAAO,EAAE,GAAG,EAAE,CAAC;IAChB,CAAC,CAAA;AACF,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { addToCpGraph } from '../add-to-cp-graph.js';
|
|
2
|
-
import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
|
|
3
|
-
/**
|
|
4
|
-
* @hidden
|
|
5
|
-
* Adds a 3-prong MAT circle according to the 3 given (previously calculated)
|
|
6
|
-
* points on the shape.
|
|
7
|
-
* @param cpTrees
|
|
8
|
-
* @param orders
|
|
9
|
-
* @param threeProng
|
|
10
|
-
*/
|
|
11
|
-
function add3Prong(cpTrees, orders, threeProng) {
|
|
12
|
-
const { circle, ps: poss, δ3s } = threeProng;
|
|
13
|
-
// Keep for possible future debugging.
|
|
14
|
-
/*
|
|
15
|
-
if (typeof _debug_ !== 'undefined') {
|
|
16
|
-
for (let i=0; i<3; i++) {
|
|
17
|
-
let cpBef = threeProng.δ3s[i][0].cp;
|
|
18
|
-
let cpAft = threeProng.δ3s[i][1].cp;
|
|
19
|
-
//let cmpBef = PointOnShape.compareInclOrder(cpBef.pointOnShape, ps[i], cpBef.order, orders[i]);
|
|
20
|
-
//let cmpAft = PointOnShape.compareInclOrder(cpAft.pointOnShape, ps[i], cpAft.order, orders[i]);
|
|
21
|
-
|
|
22
|
-
let cmpBef = PointOnShape.compare(cpBef.pointOnShape, ps[i]);
|
|
23
|
-
let cmpAft = PointOnShape.compare(cpAft.pointOnShape, ps[i]);
|
|
24
|
-
|
|
25
|
-
// len is used by debug functions to reference a particular
|
|
26
|
-
// three-prong.
|
|
27
|
-
let len = _debug_.generated.elems.threeProng.length-1;
|
|
28
|
-
if (cmpBef > 0) {
|
|
29
|
-
console.log('----------------------------------------');
|
|
30
|
-
console.log(`3-prong order is wrong (bef) : i: ${i} - cmp: ${cmpBef} - n: ${len}`);
|
|
31
|
-
console.log(threeProng);
|
|
32
|
-
console.log(cpBef);
|
|
33
|
-
console.log(cpAft);
|
|
34
|
-
console.log(ps[i]);
|
|
35
|
-
}
|
|
36
|
-
if (cmpAft < 0) {
|
|
37
|
-
console.log('----------------------------------------');
|
|
38
|
-
console.log(`3-prong order is wrong (aft) : i: ${i} - cmp: ${cmpAft} - n: ${len}`);
|
|
39
|
-
console.log(threeProng);
|
|
40
|
-
console.log(cpBef);
|
|
41
|
-
console.log(cpAft);
|
|
42
|
-
console.log(ps[i]);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
*/
|
|
47
|
-
// TODO - replace 1000 below with correct value
|
|
48
|
-
isAnotherCpCloseby(cpTrees, poss[0], circle, orders[0], 0, 1000, 'blue');
|
|
49
|
-
isAnotherCpCloseby(cpTrees, poss[1], circle, orders[1], 0, 1000, 'blue');
|
|
50
|
-
isAnotherCpCloseby(cpTrees, poss[2], circle, orders[2], 0, 1000, 'blue');
|
|
51
|
-
addToCpGraph(circle, orders, cpTrees, poss, δ3s);
|
|
52
|
-
return circle;
|
|
53
|
-
}
|
|
54
|
-
export { add3Prong };
|
|
55
|
-
//# sourceMappingURL=add-3-prong.js.map
|