flo-mat 2.0.4 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.quokka +4 -0
- package/browser/index.js +18434 -14538
- package/browser/index.min.js +1 -1
- package/node/closest-boundary-point/cull-bezier-pieces.d.ts +9 -0
- package/node/closest-boundary-point/cull-bezier-pieces.js +17 -0
- package/node/closest-boundary-point/cull-bezier-pieces.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.js +2 -2
- package/node/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.js +1 -1
- package/node/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.d.ts +25 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.js +68 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.js.map +1 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.d.ts +10 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.js +2 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.js +2 -3
- package/node/closest-boundary-point/get-best-distance-squared.js.map +1 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.d.ts +15 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.js +40 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.d.ts +15 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.js +42 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.js.map +1 -0
- package/node/closest-boundary-point/get-p-from-box.d.ts +3 -0
- package/node/closest-boundary-point/get-p-from-box.js +11 -0
- package/node/closest-boundary-point/get-p-from-box.js.map +1 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.d.ts +12 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js +93 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js.map +1 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.d.ts +13 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js +58 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js.map +1 -0
- package/node/{contact-point.d.ts → contact-point/contact-point.d.ts} +3 -3
- package/node/{contact-point.js → contact-point/contact-point.js} +1 -5
- package/node/contact-point/contact-point.js.map +1 -0
- package/node/{compare-curvatures-at-interface.js → corner/compare-curvatures-at-interface.js} +2 -2
- package/node/corner/compare-curvatures-at-interface.js.map +1 -0
- package/node/{mat → corner}/corner.d.ts +1 -1
- package/node/{mat → corner}/corner.js.map +1 -1
- package/node/corner/get-corner.d.ts +15 -0
- package/node/{curve.js → corner/get-corner.js} +6 -17
- package/node/corner/get-corner.js.map +1 -0
- package/node/{get-interface-ccw.js → corner/get-interface-ccw.js} +18 -33
- package/node/corner/get-interface-ccw.js.map +1 -0
- package/node/cp-node/clone.d.ts +1 -1
- package/node/cp-node/clone.js +6 -4
- package/node/cp-node/clone.js.map +1 -1
- package/node/cp-node/cp-node.d.ts +196 -0
- package/node/cp-node/cp-node.js +249 -0
- package/node/cp-node/cp-node.js.map +1 -0
- package/node/cp-node/create-cp-node.d.ts +4 -0
- package/node/cp-node/create-cp-node.js +8 -0
- package/node/cp-node/create-cp-node.js.map +1 -0
- package/node/cp-node/enhance-cp-node.d.ts +24 -0
- package/node/cp-node/enhance-cp-node.js +20 -0
- package/node/cp-node/enhance-cp-node.js.map +1 -0
- package/node/{get-boundary-bezier-parts-to-next.js → cp-node/get-boundary-bezier-parts-to-next.js} +1 -1
- package/node/cp-node/get-boundary-bezier-parts-to-next.js.map +1 -0
- package/node/{get-boundary-beziers-to-next.d.ts → cp-node/get-boundary-beziers-to-next.d.ts} +1 -1
- package/node/{get-boundary-beziers-to-next.js → cp-node/get-boundary-beziers-to-next.js} +1 -1
- package/node/cp-node/get-boundary-beziers-to-next.js.map +1 -0
- package/node/cp-node/get-cp-node-ordering.d.ts +8 -0
- package/node/cp-node/get-cp-node-ordering.js +12 -0
- package/node/cp-node/get-cp-node-ordering.js.map +1 -0
- package/node/{get-curve-to-next.js → cp-node/get-curve-to-next.js} +1 -1
- package/node/cp-node/get-curve-to-next.js.map +1 -0
- package/node/cp-node/remove.d.ts +1 -1
- package/node/cp-node/traverse-cp.d.ts +12 -0
- package/node/cp-node/traverse-cp.js +26 -0
- package/node/cp-node/traverse-cp.js.map +1 -0
- package/node/{traverse-edges.js → cp-node/traverse-edges.js} +4 -3
- package/node/cp-node/traverse-edges.js.map +1 -0
- package/node/{traverse-vertices.js → cp-node/traverse-vertices.js} +4 -3
- package/node/cp-node/traverse-vertices.js.map +1 -0
- package/node/{curve.d.ts → curve/curve.d.ts} +4 -17
- package/node/curve/curve.js +14 -0
- package/node/curve/curve.js.map +1 -0
- package/node/debug/cp-node-for-debugging.d.ts +2 -2
- package/node/debug/debug-elem-types.d.ts +8 -8
- package/node/debug/debug.d.ts +6 -6
- package/node/debug/debug.js +2 -2
- package/node/debug/debug.js.map +1 -1
- package/node/debug/functions/draw-elem/bounding-hull.d.ts +2 -2
- package/node/debug/functions/draw-elem/bounding-hull.js +3 -3
- package/node/debug/functions/draw-elem/bounding-hull.js.map +1 -1
- package/node/debug/functions/draw-elem/branch.d.ts +2 -2
- package/node/debug/functions/draw-elem/branch.js +4 -3
- package/node/debug/functions/draw-elem/branch.js.map +1 -1
- package/node/debug/functions/draw-elem/culls.d.ts +2 -2
- package/node/debug/functions/draw-elem/culls.js +2 -2
- package/node/debug/functions/draw-elem/culls.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.js +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-elem.d.ts +3 -3
- package/node/debug/functions/draw-elem/draw-elem.js +3 -3
- package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
- package/node/debug/functions/draw-elem/dull-corner.d.ts +3 -3
- package/node/debug/functions/draw-elem/dull-corner.js +3 -4
- package/node/debug/functions/draw-elem/dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/leaves.d.ts +2 -2
- package/node/debug/functions/draw-elem/leaves.js +1 -1
- package/node/debug/functions/draw-elem/leaves.js.map +1 -1
- package/node/debug/functions/draw-elem/loop.d.ts +2 -2
- package/node/debug/functions/draw-elem/loop.js +1 -2
- package/node/debug/functions/draw-elem/loop.js.map +1 -1
- package/node/debug/functions/draw-elem/loops.d.ts +1 -1
- package/node/debug/functions/draw-elem/loops.js +0 -1
- package/node/debug/functions/draw-elem/loops.js.map +1 -1
- package/node/debug/functions/draw-elem/loose-bounding-box.d.ts +2 -2
- package/node/debug/functions/draw-elem/loose-bounding-box.js +3 -3
- package/node/debug/functions/draw-elem/loose-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/mat.d.ts +3 -3
- package/node/debug/functions/draw-elem/mat.js +9 -7
- package/node/debug/functions/draw-elem/mat.js.map +1 -1
- package/node/debug/functions/draw-elem/max-vertex.d.ts +2 -2
- package/node/debug/functions/draw-elem/max-vertex.js +1 -1
- package/node/debug/functions/draw-elem/max-vertex.js.map +1 -1
- package/node/debug/functions/draw-elem/min-y.d.ts +3 -3
- package/node/debug/functions/draw-elem/min-y.js +2 -6
- package/node/debug/functions/draw-elem/min-y.js.map +1 -1
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.d.ts +2 -2
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js +2 -2
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/one-prong.d.ts +2 -2
- package/node/debug/functions/draw-elem/one-prong.js +6 -11
- package/node/debug/functions/draw-elem/one-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/sharp-corner.d.ts +3 -3
- package/node/debug/functions/draw-elem/sharp-corner.js +3 -4
- package/node/debug/functions/draw-elem/sharp-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/three-prong.d.ts +2 -2
- package/node/debug/functions/draw-elem/three-prong.js +8 -10
- package/node/debug/functions/draw-elem/three-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/tight-bounding-box.d.ts +2 -2
- package/node/debug/functions/draw-elem/tight-bounding-box.js +3 -3
- package/node/debug/functions/draw-elem/tight-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/two-prong.d.ts +2 -2
- package/node/debug/functions/draw-elem/two-prong.js +7 -8
- package/node/debug/functions/draw-elem/two-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/vertex.d.ts +4 -3
- package/node/debug/functions/draw-elem/vertex.js +11 -9
- package/node/debug/functions/draw-elem/vertex.js.map +1 -1
- package/node/debug/functions/general.d.ts +8 -8
- package/node/debug/functions/general.js +8 -8
- package/node/debug/functions/general.js.map +1 -1
- package/node/debug/functions/three-prong.d.ts +2 -2
- package/node/debug/functions/three-prong.js +10 -13
- package/node/debug/functions/three-prong.js.map +1 -1
- package/node/debug/functions/two-prong.d.ts +16 -5
- package/node/debug/functions/two-prong.js +56 -58
- package/node/debug/functions/two-prong.js.map +1 -1
- package/node/debug/three-prong-for-debugging.d.ts +6 -6
- package/node/debug/three-prong-for-debugging.js +1 -1
- package/node/debug/three-prong-for-debugging.js.map +1 -1
- package/node/debug/two-prong-for-debugging.d.ts +7 -7
- package/node/error-analysis/gamma.d.ts +26 -0
- package/node/error-analysis/gamma.js +35 -0
- package/node/error-analysis/gamma.js.map +1 -0
- package/node/find-2-prong/add-1-prong.d.ts +12 -0
- package/node/{mat/find-mat → find-2-prong}/add-1-prong.js +11 -11
- package/node/find-2-prong/add-1-prong.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/add-2-prong.d.ts +6 -9
- package/node/{mat/find-mat → find-2-prong}/add-2-prong.js +26 -74
- package/node/find-2-prong/add-2-prong.js.map +1 -0
- package/node/find-2-prong/add-debug-info.d.ts +8 -0
- package/node/{mat/find-mat/find-2-prong → find-2-prong}/add-debug-info.js +5 -4
- package/node/find-2-prong/add-debug-info.js.map +1 -0
- package/node/find-2-prong/cull-bezier-pieces.d.ts +11 -0
- package/node/find-2-prong/cull-bezier-pieces.js +28 -0
- package/node/find-2-prong/cull-bezier-pieces.js.map +1 -0
- package/node/{mat/find-mat/find-2-prong → find-2-prong}/find-2-prong.d.ts +9 -13
- package/node/find-2-prong/find-2-prong.js +144 -0
- package/node/find-2-prong/find-2-prong.js.map +1 -0
- package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.d.ts +15 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-2-prongs-on-all-paths.js +5 -4
- package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-2-prongs.d.ts +5 -5
- package/node/find-2-prong/find-and-add-2-prongs.js +60 -0
- package/node/find-2-prong/find-and-add-2-prongs.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.d.ts +3 -3
- package/node/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.js +5 -5
- package/node/find-2-prong/find-and-add-hole-closing-2-prongs.js.map +1 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.d.ts +10 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.js +56 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.js.map +1 -0
- package/node/find-2-prong/get-initial-bezier-pieces.d.ts +15 -0
- package/node/find-2-prong/get-initial-bezier-pieces.js +40 -0
- package/node/find-2-prong/get-initial-bezier-pieces.js.map +1 -0
- package/node/find-2-prong/reduce-radius.d.ts +8 -0
- package/node/find-2-prong/reduce-radius.js +72 -0
- package/node/find-2-prong/reduce-radius.js.map +1 -0
- package/node/find-2-prong/squared-distance-between-dd.d.ts +2 -0
- package/node/find-2-prong/squared-distance-between-dd.js +17 -0
- package/node/find-2-prong/squared-distance-between-dd.js.map +1 -0
- package/node/find-2-prong/x-for-debugging.d.ts +9 -0
- package/node/find-2-prong/x-for-debugging.js.map +1 -0
- package/node/{mat/find-mat → find-3-prong.ts}/add-3-prong.d.ts +12 -7
- package/node/find-3-prong.ts/add-3-prong.js +82 -0
- package/node/find-3-prong.ts/add-3-prong.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.d.ts +4 -4
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.js +1 -1
- package/node/find-3-prong.ts/calc-better-x.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.d.ts +3 -3
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.js +5 -7
- package/node/find-3-prong.ts/calc-initial-3-prong-center.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.d.ts +6 -6
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.js +11 -12
- package/node/find-3-prong.ts/find-3-prong-for-delta3s.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong.d.ts +5 -5
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong.js +52 -39
- package/node/find-3-prong.ts/find-3-prong.js.map +1 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.d.ts +5 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.js +74 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.js.map +1 -0
- package/node/{mat/find-mat/find-and-add-3-prongs.d.ts → find-3-prong.ts/find-and-add-all-3-prongs.d.ts} +3 -3
- package/node/find-3-prong.ts/find-and-add-all-3-prongs.js +66 -0
- package/node/find-3-prong.ts/find-and-add-all-3-prongs.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/get-closest-points.d.ts +3 -3
- package/node/find-3-prong.ts/get-closest-points.js +14 -0
- package/node/find-3-prong.ts/get-closest-points.js.map +1 -0
- package/node/{mat/find-mat → find-mat}/add-debug-info.d.ts +4 -4
- package/node/{mat/find-mat → find-mat}/add-debug-info.js +6 -6
- package/node/find-mat/add-debug-info.js.map +1 -0
- package/node/{mat/find-mat → find-mat}/create-initial-cp-graph.d.ts +5 -5
- package/node/{mat/find-mat → find-mat}/create-initial-cp-graph.js +5 -6
- package/node/find-mat/create-initial-cp-graph.js.map +1 -0
- package/node/find-mat/find-mat.d.ts +10 -0
- package/node/find-mat/find-mat.js +57 -0
- package/node/find-mat/find-mat.js.map +1 -0
- package/node/{find-mats.d.ts → find-mat/find-mats.d.ts} +1 -1
- package/node/find-mat/find-mats.js +58 -0
- package/node/find-mat/find-mats.js.map +1 -0
- package/node/find-mat/fix-ordering.d.ts +8 -0
- package/node/find-mat/fix-ordering.js +59 -0
- package/node/find-mat/fix-ordering.js.map +1 -0
- package/node/find-mat/get-dull-corners.d.ts +5 -0
- package/node/find-mat/get-dull-corners.js +22 -0
- package/node/find-mat/get-dull-corners.js.map +1 -0
- package/node/find-mat/get-for-1-prongs-on-loop.d.ts +11 -0
- package/node/find-mat/get-for-1-prongs-on-loop.js +28 -0
- package/node/find-mat/get-for-1-prongs-on-loop.js.map +1 -0
- package/node/find-mat/get-for-2-prongs-on-loop.d.ts +11 -0
- package/node/find-mat/get-for-2-prongs-on-loop.js +30 -0
- package/node/find-mat/get-for-2-prongs-on-loop.js.map +1 -0
- package/node/find-mat/get-sharp-corners.d.ts +5 -0
- package/node/find-mat/get-sharp-corners.js +21 -0
- package/node/find-mat/get-sharp-corners.js.map +1 -0
- package/node/find-mat/get-size-params.d.ts +7 -0
- package/node/find-mat/get-size-params.js +33 -0
- package/node/find-mat/get-size-params.js.map +1 -0
- package/node/geometry/circle.js.map +1 -0
- package/node/geometry/get-bounding-box-.js.map +1 -0
- package/node/{mat/geometry → geometry}/get-closest-square-distance-to-rect.d.ts +1 -1
- package/node/{mat/geometry → geometry}/get-closest-square-distance-to-rect.js +1 -1
- package/node/geometry/get-closest-square-distance-to-rect.js.map +1 -0
- package/node/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.d.ts +1 -1
- package/node/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.js +1 -1
- package/node/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -0
- package/node/get-curve/get-curve-between.d.ts +1 -1
- package/node/get-curve/get-curve-between.js +2 -2
- package/node/get-curve/get-curve-between.js.map +1 -1
- package/node/get-curve/get-edge-direction.d.ts +2 -2
- package/node/get-curve/get-edge-direction.js +2 -4
- package/node/get-curve/get-edge-direction.js.map +1 -1
- package/node/index.d.ts +24 -20
- package/node/index.js +21 -16
- package/node/index.js.map +1 -1
- package/node/loop/get-max-coordinate.d.ts +1 -1
- package/node/loop/get-max-coordinate.js +1 -1
- package/node/mat/add-to-cp-graph.d.ts +8 -7
- package/node/mat/add-to-cp-graph.js +6 -4
- package/node/mat/add-to-cp-graph.js.map +1 -1
- package/node/mat/bezier-piece.d.ts +2 -2
- package/node/mat/create-new-cp-tree.d.ts +3 -3
- package/node/mat/create-new-cp-tree.js +5 -7
- package/node/mat/create-new-cp-tree.js.map +1 -1
- package/node/mat/elem-type-two-prong.d.ts +1 -1
- package/node/mat/get-boundary-piece-beziers.d.ts +2 -2
- package/node/mat/get-boundary-piece-beziers.js +4 -4
- package/node/mat/get-boundary-piece-beziers.js.map +1 -1
- package/node/{get-branches.d.ts → mat/get-branches.d.ts} +1 -1
- package/node/{get-branches.js → mat/get-branches.js} +7 -6
- package/node/mat/get-branches.js.map +1 -0
- package/node/mat/get-largest-vertex.d.ts +2 -2
- package/node/mat/get-largest-vertex.js +1 -1
- package/node/mat/get-largest-vertex.js.map +1 -1
- package/node/mat/get-neighboring-cps.d.ts +6 -4
- package/node/mat/get-neighboring-cps.js +5 -3
- package/node/mat/get-neighboring-cps.js.map +1 -1
- package/node/mat/get-two-prong-type.d.ts +1 -1
- package/node/mat/get-two-prong-type.js +1 -1
- package/node/mat/get-two-prong-type.js.map +1 -1
- package/node/mat/is-another-cp-closeby.d.ts +9 -8
- package/node/mat/is-another-cp-closeby.js +21 -29
- package/node/mat/is-another-cp-closeby.js.map +1 -1
- package/node/{mat.d.ts → mat/mat.d.ts} +2 -2
- package/node/mat/mat.js.map +1 -0
- package/node/mat/simplify-mat-map-only.d.ts +1 -1
- package/node/mat/simplify-mat-map-only.js +4 -3
- package/node/mat/simplify-mat-map-only.js.map +1 -1
- package/node/{simplify-mat.d.ts → mat/simplify-mat.d.ts} +3 -5
- package/node/{simplify-mat.js → mat/simplify-mat.js} +11 -13
- package/node/mat/simplify-mat.js.map +1 -0
- package/node/mat/trim-mat.d.ts +1 -1
- package/node/mat/trim-mat.js +1 -1
- package/node/mat/trim-mat.js.map +1 -1
- package/node/point-on-shape/calc-pos-order.d.ts +13 -0
- package/node/point-on-shape/calc-pos-order.js +27 -0
- package/node/point-on-shape/calc-pos-order.js.map +1 -0
- package/node/point-on-shape/compare-poss.d.ts +10 -0
- package/node/point-on-shape/compare-poss.js +18 -0
- package/node/point-on-shape/compare-poss.js.map +1 -0
- package/node/point-on-shape/create-pos.d.ts +4 -0
- package/node/point-on-shape/create-pos.js +12 -0
- package/node/point-on-shape/create-pos.js.map +1 -0
- package/node/point-on-shape/get-osculating-circle.d.ts +10 -0
- package/node/point-on-shape/get-osculating-circle.js +25 -0
- package/node/point-on-shape/get-osculating-circle.js.map +1 -0
- package/node/point-on-shape/get-pos-corner.d.ts +7 -0
- package/node/point-on-shape/get-pos-corner.js +9 -0
- package/node/point-on-shape/get-pos-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-corner.js +8 -0
- package/node/point-on-shape/is-pos-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-dull-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-dull-corner.js +14 -0
- package/node/point-on-shape/is-pos-dull-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.js +14 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-sharp-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-sharp-corner.js +14 -0
- package/node/point-on-shape/is-pos-sharp-corner.js.map +1 -0
- package/node/point-on-shape/point-on-shape.d.ts +11 -0
- package/node/point-on-shape/point-on-shape.js +2 -0
- package/node/point-on-shape/point-on-shape.js.map +1 -0
- package/node/point-on-shape/pos-to-human-string.d.ts +8 -0
- package/node/point-on-shape/pos-to-human-string.js +12 -0
- package/node/point-on-shape/pos-to-human-string.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/add-debug-info.d.ts +2 -2
- package/node/{mat/to-scale-axis → sat}/add-debug-info.js +1 -1
- package/node/sat/add-debug-info.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/cull-non-cycles.d.ts +3 -3
- package/node/{mat/to-scale-axis → sat}/cull-non-cycles.js +6 -6
- package/node/sat/cull-non-cycles.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/cull.d.ts +3 -3
- package/node/{mat/to-scale-axis → sat}/cull.js +4 -4
- package/node/sat/cull.js.map +1 -0
- package/node/{mat → sat}/get-leaves.d.ts +2 -2
- package/node/sat/get-leaves.js +14 -0
- package/node/sat/get-leaves.js.map +1 -0
- package/node/{to-scale-axis.d.ts → sat/to-scale-axis.d.ts} +2 -2
- package/node/{to-scale-axis.js → sat/to-scale-axis.js} +11 -10
- package/node/sat/to-scale-axis.js.map +1 -0
- package/node/svg/get-loop-bounds.d.ts +7 -7
- package/node/svg/get-loop-bounds.js +11 -7
- package/node/svg/get-loop-bounds.js.map +1 -1
- package/node/svg/get-min-y-pos.d.ts +4 -4
- package/node/svg/get-min-y-pos.js +1 -1
- package/node/svg/get-shape-bounds.d.ts +6 -5
- package/node/svg/get-shape-bounds.js +6 -2
- package/node/svg/get-shape-bounds.js.map +1 -1
- package/node/sweep-line/sweep-line.d.ts +1 -1
- package/node/sweep-line/sweep-line.js +4 -4
- package/node/sweep-line/sweep-line.js.map +1 -1
- package/package.json +10 -10
- package/src/closest-boundary-point/closest-points-on-curve-precise.ts +75 -0
- package/src/closest-boundary-point/closest-points-on-curve.ts +72 -0
- package/src/closest-boundary-point/cull-bezier-pieces.ts +35 -0
- package/src/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.ts +4 -3
- package/src/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.ts +2 -2
- package/src/closest-boundary-point/dd-deflate-with-running-error.ts +88 -0
- package/src/closest-boundary-point/foot-and-endpoint-info.ts +16 -0
- package/src/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.ts +3 -4
- package/src/closest-boundary-point/get-close-boundary-points-certified.ts +69 -0
- package/src/closest-boundary-point/get-closest-boundary-point-certified.ts +70 -0
- package/src/closest-boundary-point/get-p-from-box.ts +14 -0
- package/src/closest-boundary-point/get-potential-closest-points-on-curve-certified.ts +122 -0
- package/src/closest-boundary-point/root-interval-to-distance-squared-interval.ts +75 -0
- package/src/{contact-point.ts → contact-point/contact-point.ts} +4 -6
- package/src/{compare-curvatures-at-interface.ts → corner/compare-curvatures-at-interface.ts} +2 -2
- package/src/{mat → corner}/corner.ts +1 -1
- package/src/{curve.ts → corner/get-corner.ts} +10 -49
- package/src/{get-interface-ccw.ts → corner/get-interface-ccw.ts} +28 -35
- package/src/cp-node/clone.ts +17 -6
- package/src/cp-node/cp-node.ts +422 -0
- package/src/cp-node/create-cp-node.ts +21 -0
- package/src/cp-node/enhance-cp-node.ts +27 -0
- package/src/{get-boundary-bezier-parts-to-next.ts → cp-node/get-boundary-bezier-parts-to-next.ts} +3 -3
- package/src/{get-boundary-beziers-to-next.ts → cp-node/get-boundary-beziers-to-next.ts} +2 -2
- package/src/cp-node/get-cp-node-ordering.ts +17 -0
- package/src/{get-curve-to-next.ts → cp-node/get-curve-to-next.ts} +1 -1
- package/src/cp-node/remove.ts +1 -1
- package/src/cp-node/traverse-cp.ts +35 -0
- package/src/{traverse-edges.ts → cp-node/traverse-edges.ts} +5 -5
- package/src/{traverse-vertices.ts → cp-node/traverse-vertices.ts} +5 -5
- package/src/curve/curve.ts +46 -0
- package/src/debug/cp-node-for-debugging.ts +2 -2
- package/src/debug/debug-elem-types.ts +8 -8
- package/src/debug/debug.ts +11 -11
- package/src/debug/functions/draw-elem/bounding-hull.ts +5 -3
- package/src/debug/functions/draw-elem/branch.ts +4 -4
- package/src/debug/functions/draw-elem/culls.ts +3 -3
- package/src/debug/functions/draw-elem/draw-circle-percent.ts +1 -1
- package/src/debug/functions/draw-elem/draw-elem.ts +10 -6
- package/src/debug/functions/draw-elem/dull-corner.ts +10 -6
- package/src/debug/functions/draw-elem/leaves.ts +2 -2
- package/src/debug/functions/draw-elem/loop.ts +4 -3
- package/src/debug/functions/draw-elem/loops.ts +1 -2
- package/src/debug/functions/draw-elem/loose-bounding-box.ts +8 -3
- package/src/debug/functions/draw-elem/mat.ts +16 -8
- package/src/debug/functions/draw-elem/max-vertex.ts +2 -2
- package/src/debug/functions/draw-elem/min-y.ts +4 -9
- package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +10 -2
- package/src/debug/functions/draw-elem/one-prong.ts +12 -15
- package/src/debug/functions/draw-elem/sharp-corner.ts +10 -6
- package/src/debug/functions/draw-elem/three-prong.ts +13 -11
- package/src/debug/functions/draw-elem/tight-bounding-box.ts +9 -3
- package/src/debug/functions/draw-elem/two-prong.ts +12 -8
- package/src/debug/functions/draw-elem/vertex.ts +12 -11
- package/src/debug/functions/general.ts +10 -10
- package/src/debug/functions/three-prong.ts +16 -20
- package/src/debug/functions/two-prong.ts +89 -77
- package/src/debug/three-prong-for-debugging.ts +17 -16
- package/src/debug/two-prong-for-debugging.ts +7 -7
- package/src/error-analysis/gamma.ts +41 -0
- package/src/{mat/find-mat → find-2-prong}/add-1-prong.ts +19 -16
- package/src/{mat/find-mat → find-2-prong}/add-2-prong.ts +45 -91
- package/src/find-2-prong/add-debug-info.ts +49 -0
- package/src/{mat/find-mat/find-2-prong → find-2-prong}/cull-bezier-pieces.ts +9 -11
- package/src/find-2-prong/find-2-prong.ts +191 -0
- package/src/{mat/find-mat → find-2-prong}/find-and-add-2-prongs-on-all-paths.ts +12 -9
- package/src/find-2-prong/find-and-add-2-prongs.ts +88 -0
- package/src/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.ts +7 -7
- package/src/find-2-prong/find-equidistant-point-on-line-dd.ts +77 -0
- package/src/{mat/find-mat/find-2-prong → find-2-prong}/find-equidistant-point-on-line.ts +1 -1
- package/src/find-2-prong/get-initial-bezier-pieces.ts +61 -0
- package/src/find-2-prong/pyth-trips.ts +146 -0
- package/src/find-2-prong/reduce-radius.ts +98 -0
- package/src/find-2-prong/squared-distance-between-dd.ts +25 -0
- package/src/find-2-prong/x-for-debugging.ts +13 -0
- package/src/find-3-prong.ts/add-3-prong.ts +110 -0
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.ts +5 -5
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.ts +11 -12
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.ts +28 -28
- package/src/find-3-prong.ts/find-3-prong.ts +148 -0
- package/src/find-3-prong.ts/find-and-add-3-prongs.ts +111 -0
- package/src/find-3-prong.ts/find-and-add-all-3-prongs.ts +109 -0
- package/src/find-3-prong.ts/get-closest-points.ts +24 -0
- package/src/{mat/find-mat → find-mat}/add-debug-info.ts +10 -10
- package/src/{mat/find-mat → find-mat}/create-initial-cp-graph.ts +11 -12
- package/src/find-mat/find-mat.ts +89 -0
- package/src/find-mat/find-mats.ts +83 -0
- package/src/find-mat/fix-ordering.ts +69 -0
- package/src/find-mat/get-dull-corners.ts +34 -0
- package/src/find-mat/get-for-1-prongs-on-loop.ts +40 -0
- package/src/find-mat/get-for-2-prongs-on-loop.ts +44 -0
- package/src/find-mat/get-sharp-corners.ts +33 -0
- package/src/find-mat/get-size-params.ts +34 -0
- package/src/{mat/find-mat → find-mat}/get-total-by.ts +4 -4
- package/src/{mat/geometry → geometry}/get-closest-square-distance-to-rect.ts +1 -1
- package/src/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.ts +2 -2
- package/src/get-curve/get-curve-between.ts +7 -7
- package/src/get-curve/get-edge-direction.ts +11 -11
- package/src/index.ts +64 -21
- package/src/loop/get-max-coordinate.ts +1 -1
- package/src/mat/add-to-cp-graph.ts +15 -12
- package/src/mat/bezier-piece.ts +2 -2
- package/src/mat/cmp-cp-on-delta.ts +6 -3
- package/src/mat/create-new-cp-tree.ts +6 -9
- package/src/mat/elem-type-two-prong.ts +1 -1
- package/src/mat/get-boundary-piece-beziers.ts +7 -7
- package/src/{get-branches.ts → mat/get-branches.ts} +8 -8
- package/src/mat/get-edges-as-array.ts +2 -2
- package/src/mat/get-largest-three-prong.ts +3 -3
- package/src/mat/get-largest-vertex.ts +2 -2
- package/src/mat/get-neighboring-cps.ts +9 -6
- package/src/mat/get-two-prong-type.ts +1 -1
- package/src/mat/is-another-cp-closeby.ts +29 -44
- package/src/{mat.ts → mat/mat.ts} +2 -2
- package/src/mat/simplify-mat-map-only.ts +5 -5
- package/src/{simplify-mat.ts → mat/simplify-mat.ts} +12 -14
- package/src/mat/trim-mat.ts +3 -3
- package/src/point-on-shape/calc-pos-order.ts +35 -0
- package/src/point-on-shape/compare-poss.ts +26 -0
- package/src/point-on-shape/create-pos.ts +21 -0
- package/src/point-on-shape/get-osculating-circle.ts +39 -0
- package/src/point-on-shape/get-pos-corner.ts +16 -0
- package/src/point-on-shape/is-pos-corner.ts +12 -0
- package/src/point-on-shape/is-pos-dull-corner.ts +16 -0
- package/src/point-on-shape/is-pos-quite-dull-corner.ts +17 -0
- package/src/point-on-shape/is-pos-quite-sharp-corner.ts +17 -0
- package/src/point-on-shape/is-pos-sharp-corner.ts +17 -0
- package/src/point-on-shape/point-on-shape.ts +15 -0
- package/src/point-on-shape/pos-to-human-string.ts +16 -0
- package/src/{mat/to-scale-axis → sat}/add-debug-info.ts +3 -3
- package/src/{mat/to-scale-axis → sat}/cull-non-cycles.ts +7 -7
- package/src/{mat/to-scale-axis → sat}/cull.ts +6 -6
- package/src/{mat → sat}/get-leaves.ts +4 -4
- package/src/{mat/to-scale-axis → sat}/t-tree.ts +2 -2
- package/src/{to-scale-axis.ts → sat/to-scale-axis.ts} +16 -16
- package/src/{mat/to-scale-axis → sat}/traverse-spacial-tree.ts +5 -5
- package/src/svg/get-loop-bounds.ts +22 -17
- package/src/svg/get-min-y-pos.ts +3 -3
- package/src/svg/get-shape-bounds.ts +12 -9
- package/src/sweep-line/are-boxes-intersecting.ts +1 -1
- package/src/sweep-line/sweep-line.ts +7 -7
- package/tsconfig.json +3 -7
- package/wallaby.mjs +32 -0
- package/node/circle.js.map +0 -1
- package/node/compare-curvatures-at-interface.js.map +0 -1
- package/node/contact-point.js.map +0 -1
- package/node/cp-node.d.ts +0 -202
- package/node/cp-node.js +0 -321
- package/node/cp-node.js.map +0 -1
- package/node/curve.js.map +0 -1
- package/node/find-mats.js +0 -123
- package/node/find-mats.js.map +0 -1
- package/node/get-boundary-bezier-parts-to-next.js.map +0 -1
- package/node/get-boundary-beziers-to-next.js.map +0 -1
- package/node/get-bounding-box-.js.map +0 -1
- package/node/get-branches.js.map +0 -1
- package/node/get-curve-to-next.js.map +0 -1
- package/node/get-interface-ccw.js.map +0 -1
- package/node/loop.d.ts +0 -16
- package/node/loop.js +0 -35
- package/node/loop.js.map +0 -1
- package/node/mat/closest-boundary-point/closest-points-on-curve.d.ts +0 -14
- package/node/mat/closest-boundary-point/closest-points-on-curve.js +0 -73
- package/node/mat/closest-boundary-point/closest-points-on-curve.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-bezier-pieces.d.ts +0 -9
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js +0 -20
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js.map +0 -1
- package/node/mat/closest-boundary-point/get-best-distance-squared.js.map +0 -1
- package/node/mat/closest-boundary-point/get-close-boundary-points.d.ts +0 -17
- package/node/mat/closest-boundary-point/get-close-boundary-points.js +0 -81
- package/node/mat/closest-boundary-point/get-close-boundary-points.js.map +0 -1
- package/node/mat/closest-boundary-point/get-closest-boundary-point.d.ts +0 -18
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js +0 -41
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js.map +0 -1
- package/node/mat/find-mat/add-1-prong.d.ts +0 -12
- package/node/mat/find-mat/add-1-prong.js.map +0 -1
- package/node/mat/find-mat/add-2-prong.js.map +0 -1
- package/node/mat/find-mat/add-3-prong.js +0 -55
- package/node/mat/find-mat/add-3-prong.js.map +0 -1
- package/node/mat/find-mat/add-debug-info.js.map +0 -1
- package/node/mat/find-mat/create-get-interesting-points-on-loop.d.ts +0 -11
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js +0 -52
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js.map +0 -1
- package/node/mat/find-mat/create-initial-cp-graph.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/add-debug-info.d.ts +0 -8
- package/node/mat/find-mat/find-2-prong/add-debug-info.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.d.ts +0 -11
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js +0 -30
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/find-2-prong.js +0 -233
- package/node/mat/find-mat/find-2-prong/find-2-prong.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.d.ts +0 -9
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js +0 -40
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.d.ts +0 -11
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js +0 -38
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/x-for-debugging.d.ts +0 -9
- package/node/mat/find-mat/find-2-prong/x-for-debugging.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/calc-better-x.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/get-closest-points.js +0 -17
- package/node/mat/find-mat/find-3-prong/get-closest-points.js.map +0 -1
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.d.ts +0 -15
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js.map +0 -1
- package/node/mat/find-mat/find-and-add-2-prongs.js +0 -74
- package/node/mat/find-mat/find-and-add-2-prongs.js.map +0 -1
- package/node/mat/find-mat/find-and-add-3-prongs.js +0 -147
- package/node/mat/find-mat/find-and-add-3-prongs.js.map +0 -1
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js.map +0 -1
- package/node/mat/find-mat/get-potential-2-prongs.d.ts +0 -4
- package/node/mat/find-mat/get-potential-2-prongs.js +0 -17
- package/node/mat/find-mat/get-potential-2-prongs.js.map +0 -1
- package/node/mat/find-mat/get-sharp-corners.d.ts +0 -4
- package/node/mat/find-mat/get-sharp-corners.js +0 -18
- package/node/mat/find-mat/get-sharp-corners.js.map +0 -1
- package/node/mat/geometry/get-closest-square-distance-to-rect.js.map +0 -1
- package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js.map +0 -1
- package/node/mat/get-contact-circles-at-interface.d.ts +0 -8
- package/node/mat/get-contact-circles-at-interface.js +0 -21
- package/node/mat/get-contact-circles-at-interface.js.map +0 -1
- package/node/mat/get-leaves.js +0 -13
- package/node/mat/get-leaves.js.map +0 -1
- package/node/mat/to-scale-axis/add-debug-info.js.map +0 -1
- package/node/mat/to-scale-axis/cull-non-cycles.js.map +0 -1
- package/node/mat/to-scale-axis/cull.js.map +0 -1
- package/node/mat.js.map +0 -1
- package/node/point-on-shape.d.ts +0 -73
- package/node/point-on-shape.js +0 -168
- package/node/point-on-shape.js.map +0 -1
- package/node/simplify-mat.js.map +0 -1
- package/node/to-scale-axis.js.map +0 -1
- package/node/traverse-edges.js.map +0 -1
- package/node/traverse-vertices.js.map +0 -1
- package/src/cp-node.ts +0 -388
- package/src/find-mats.ts +0 -171
- package/src/loop.ts +0 -56
- package/src/mat/closest-boundary-point/closest-point-on-curve-old.ts_ +0 -88
- package/src/mat/closest-boundary-point/closest-point-on-curve.ts_ +0 -95
- package/src/mat/closest-boundary-point/closest-points-on-curve.ts +0 -84
- package/src/mat/closest-boundary-point/cull-bezier-pieces.ts +0 -38
- package/src/mat/closest-boundary-point/get-close-boundary-points.ts +0 -107
- package/src/mat/closest-boundary-point/get-closest-boundary-point.ts +0 -64
- package/src/mat/find-mat/add-3-prong.ts +0 -75
- package/src/mat/find-mat/create-get-interesting-points-on-loop.ts +0 -73
- package/src/mat/find-mat/find-2-prong/add-debug-info.ts +0 -46
- package/src/mat/find-mat/find-2-prong/find-2-prong.ts +0 -316
- package/src/mat/find-mat/find-2-prong/get-initial-bezier-pieces.ts +0 -52
- package/src/mat/find-mat/find-2-prong/x-for-debugging.ts +0 -13
- package/src/mat/find-mat/find-3-prong/find-3-prong.ts +0 -106
- package/src/mat/find-mat/find-3-prong/get-closest-points.ts +0 -28
- package/src/mat/find-mat/find-and-add-2-prongs.ts +0 -108
- package/src/mat/find-mat/find-and-add-3-prongs.ts +0 -218
- package/src/mat/find-mat/get-potential-2-prongs.ts +0 -24
- package/src/mat/find-mat/get-sharp-corners.ts +0 -25
- package/src/mat/find-mat/get-total-abs-curvature.ts +0 -17
- package/src/mat/get-contact-circles-at-interface.ts +0 -26
- package/src/mat/to-scale-axis/add-to-tree.ts +0 -66
- package/src/mat/to-scale-axis/calc-groups.ts +0 -82
- package/src/mat/to-scale-axis/create-spacial-tree.ts +0 -41
- package/src/mat/to-scale-axis/get-engulfed-vertices.ts +0 -135
- package/src/point-on-shape.ts +0 -231
- package/src/svg/get-curvature-at-interface.ts +0 -55
- /package/node/{compare-curvatures-at-interface.d.ts → corner/compare-curvatures-at-interface.d.ts} +0 -0
- /package/node/{mat → corner}/corner.js +0 -0
- /package/node/{get-interface-ccw.d.ts → corner/get-interface-ccw.d.ts} +0 -0
- /package/node/{get-boundary-bezier-parts-to-next.d.ts → cp-node/get-boundary-bezier-parts-to-next.d.ts} +0 -0
- /package/node/{get-curve-to-next.d.ts → cp-node/get-curve-to-next.d.ts} +0 -0
- /package/node/{traverse-edges.d.ts → cp-node/traverse-edges.d.ts} +0 -0
- /package/node/{traverse-vertices.d.ts → cp-node/traverse-vertices.d.ts} +0 -0
- /package/node/{mat/find-mat/find-2-prong → find-2-prong}/x-for-debugging.js +0 -0
- /package/node/{circle.d.ts → geometry/circle.d.ts} +0 -0
- /package/node/{circle.js → geometry/circle.js} +0 -0
- /package/node/{get-bounding-box-.d.ts → geometry/get-bounding-box-.d.ts} +0 -0
- /package/node/{get-bounding-box-.js → geometry/get-bounding-box-.js} +0 -0
- /package/node/{mat.js → mat/mat.js} +0 -0
- /package/src/{circle.ts → geometry/circle.ts} +0 -0
- /package/src/{get-bounding-box-.ts → geometry/get-bounding-box-.ts} +0 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { compareCps } from '../contact-point/contact-point.js';
|
|
2
|
+
import { removeCpNode } from './remove.js';
|
|
3
|
+
import { getCurveToNext } from './get-curve-to-next.js';
|
|
4
|
+
import { createCpNode } from './create-cp-node.js';
|
|
5
|
+
/**
|
|
6
|
+
* Returns the bezier curve from the maximal disk of this [[CpNode]] to the
|
|
7
|
+
* next [[CpNode]]'s maximal disk and thus directly represents a piece of the
|
|
8
|
+
* medial axis.
|
|
9
|
+
* @deprecated Use [[getCurveToNext]] instead
|
|
10
|
+
* @param cpNode
|
|
11
|
+
*/
|
|
12
|
+
function matCurveToNextVertex(cpNode) {
|
|
13
|
+
return getCurveToNext(cpNode);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Primarily for internal use.
|
|
17
|
+
*
|
|
18
|
+
* Compares the order of two [[CpNode]]s. The order is cyclic and depends
|
|
19
|
+
* on a [[CpNode]]'s relative position along the shape boundary.
|
|
20
|
+
*/
|
|
21
|
+
const cpNodeComparator = (a, b) => compareCps(a.cp, b.cp);
|
|
22
|
+
/**
|
|
23
|
+
* Returns the children of this [[CpNode]] when seen as a MAT edge. Only
|
|
24
|
+
* children in a 'forward' direction are returned. These include all edges
|
|
25
|
+
* except the 'backward' edge given by [[prevOnCircle]], even terminating
|
|
26
|
+
* edges.
|
|
27
|
+
*/
|
|
28
|
+
function getChildren(cpNode) {
|
|
29
|
+
const children = [];
|
|
30
|
+
const cp = cpNode.next;
|
|
31
|
+
let cp_ = cp;
|
|
32
|
+
do {
|
|
33
|
+
children.push(cp_);
|
|
34
|
+
cp_ = cp_.nextOnCircle;
|
|
35
|
+
} while (cp_.nextOnCircle !== cp);
|
|
36
|
+
return children;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Similar to [[getChildren]] but returns the child nodes of the tree when
|
|
40
|
+
* [[CpNode]] is seen as a MAT vertex point (as opposed to edge). In this
|
|
41
|
+
* way the dual graph of the tree can easily be traversed - see e.g.
|
|
42
|
+
* [[traverseVertices]]. Generally, however, traversing the edges is
|
|
43
|
+
* preferred as it returns the entire Medial Axis (by utilizing
|
|
44
|
+
* [[getCurveToNext]] on each returned edge).
|
|
45
|
+
*/
|
|
46
|
+
function vertexChildren(cpNode) {
|
|
47
|
+
if (isTerminating(cpNode)) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
const children = [];
|
|
51
|
+
let cp_ = cpNode;
|
|
52
|
+
while (cp_ !== cpNode.prevOnCircle) {
|
|
53
|
+
if (!isTerminating(cp_)) {
|
|
54
|
+
children.push(cp_.next);
|
|
55
|
+
}
|
|
56
|
+
cp_ = cp_.nextOnCircle;
|
|
57
|
+
}
|
|
58
|
+
return children;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Returns all [[CpNode]]s on the MAT that this [[CpNode]] is part of
|
|
62
|
+
* starting from the current one and going anti-clockwise around the shape.
|
|
63
|
+
*/
|
|
64
|
+
function getAllOnLoop(cpNode) {
|
|
65
|
+
const cpStart = cpNode;
|
|
66
|
+
const cpNodes = [cpStart];
|
|
67
|
+
let cpNode_ = cpNode.next;
|
|
68
|
+
while (cpNode_ !== cpStart) {
|
|
69
|
+
cpNodes.push(cpNode_);
|
|
70
|
+
cpNode_ = cpNode_.next;
|
|
71
|
+
}
|
|
72
|
+
return cpNodes;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Primarily for internal use.
|
|
76
|
+
*
|
|
77
|
+
* Insert a [[CpNode]] into the MAT tree graph after the specified point
|
|
78
|
+
* and returns the freshly inserted [[CpNode]].
|
|
79
|
+
* @param isHoleClosing True if this is a hole closing contact point.
|
|
80
|
+
* @param isIntersection True if this is a contact point at a shape boundary
|
|
81
|
+
* intersection point.
|
|
82
|
+
* @param cpTree The tree graph holding the [[CpNodes]] of the MAT.
|
|
83
|
+
* @param cp [[ContactPoint]] defining the [[CpNode]].
|
|
84
|
+
* @param prev_ Inserts the new [[CpNode]] right after this item if the
|
|
85
|
+
* loop is not empty, else insert the new [[CpNode]] as the only item in the
|
|
86
|
+
* loop.
|
|
87
|
+
*/
|
|
88
|
+
function insertCpNode(isHoleClosing, isIntersection, cpTree, cp, prev_) {
|
|
89
|
+
// const cpNode = new CpNode(cp, isHoleClosing, isIntersection);
|
|
90
|
+
const cpNode = createCpNode(cp, isHoleClosing, isIntersection);
|
|
91
|
+
if (typeof _debug_ !== 'undefined') {
|
|
92
|
+
_debug_.generated.elems.cpNode.push({
|
|
93
|
+
generated: _debug_.generated,
|
|
94
|
+
cpNode
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
let prev;
|
|
98
|
+
let next;
|
|
99
|
+
if (!prev_) {
|
|
100
|
+
prev = cpNode;
|
|
101
|
+
next = cpNode;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
prev = prev_;
|
|
105
|
+
next = prev.next;
|
|
106
|
+
}
|
|
107
|
+
next.prev = cpNode;
|
|
108
|
+
prev.next = cpNode;
|
|
109
|
+
cpNode.prev = prev;
|
|
110
|
+
cpNode.next = next;
|
|
111
|
+
cpTree.insert(cpNode);
|
|
112
|
+
return cpNode;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Return this (except if exclThis is truthy) and the the other CpNodes
|
|
116
|
+
* around the maximal disk vertex circle in an anti-clockwise order.
|
|
117
|
+
* @param exclThis If true the returned array does not include this
|
|
118
|
+
* [[CpNode]].
|
|
119
|
+
*/
|
|
120
|
+
function getCpNodesOnCircle(cpNode, exclThis = false) {
|
|
121
|
+
// const startCp = this as CpNode;
|
|
122
|
+
const startCpNode = cpNode;
|
|
123
|
+
let cpNode_ = startCpNode;
|
|
124
|
+
const cpNodes = [];
|
|
125
|
+
do {
|
|
126
|
+
if (exclThis) {
|
|
127
|
+
exclThis = false;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
cpNodes.push(cpNode_);
|
|
131
|
+
}
|
|
132
|
+
cpNode_ = cpNode_.nextOnCircle;
|
|
133
|
+
} while (cpNode_ !== startCpNode);
|
|
134
|
+
return cpNodes;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Returns true if the 2 given [[CpNode]]s are on the same maximal disk
|
|
138
|
+
* circle.
|
|
139
|
+
* @param cpNode1 A [[CpNode]].
|
|
140
|
+
* @param cpNode2 Another [[CpNode]]
|
|
141
|
+
*/
|
|
142
|
+
function isOnSameCircle(cpNode1, cpNode2) {
|
|
143
|
+
const cpNodes = getCpNodesOnCircle(cpNode1, true);
|
|
144
|
+
return cpNodes.indexOf(cpNode2) >= 0;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Returns true if this [[CpNode]] is terminating, i.e. implies a leaf MAT
|
|
148
|
+
* vertex.
|
|
149
|
+
*
|
|
150
|
+
* This is always the case for sharp corners and maximal disks with
|
|
151
|
+
* a single contact point. Note, however, that even in these cases there are
|
|
152
|
+
* two contact points stored (sitting 'on top' of each other) for the
|
|
153
|
+
* maximal disk. It can be seen as a limiting case of a two-prong where the
|
|
154
|
+
* distance between two of the contact points tend to zero. One point
|
|
155
|
+
* (represented by a [[CpNode]] of course) will be terminating with the
|
|
156
|
+
* other point being its [[next]], whereas the other point will *not* be
|
|
157
|
+
* terminating and 'points' back into the shape.
|
|
158
|
+
*/
|
|
159
|
+
function isTerminating(cpNode) {
|
|
160
|
+
// return this === this.next.prevOnCircle;
|
|
161
|
+
return cpNode === cpNode.next.prevOnCircle;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Like isTerminating() but only returns true if all cpNodes on the circle
|
|
165
|
+
* (except this.prevOnCircle) is terminating.
|
|
166
|
+
*/
|
|
167
|
+
function isFullyTerminating(cpNode) {
|
|
168
|
+
const otherOnCircle = getCpNodesOnCircle(cpNode.prevOnCircle, true);
|
|
169
|
+
const isFullyTerminating = otherOnCircle.every(cpn => isTerminating(cpn));
|
|
170
|
+
return isFullyTerminating;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Returns the first [[CpNode]] (from this one by successively applying
|
|
174
|
+
* .nextOnCircle) that exits the circle.
|
|
175
|
+
*/
|
|
176
|
+
function getFirstExit(cpNode) {
|
|
177
|
+
// const startNode = this as CpNode;
|
|
178
|
+
const startNode = cpNode;
|
|
179
|
+
let cpNode_ = startNode;
|
|
180
|
+
while (cpNode_.next === cpNode_.prevOnCircle) {
|
|
181
|
+
cpNode_ = cpNode_.next;
|
|
182
|
+
if (cpNode_ === startNode) {
|
|
183
|
+
// The very special case the MAT is a single point.
|
|
184
|
+
return undefined;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return cpNode_;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Returns true if this [[CpNode]] represents a sharp corner, i.e. the
|
|
191
|
+
* limiting case of a two-prong having zero radius.
|
|
192
|
+
*
|
|
193
|
+
* Note that two [[CpNode]]s are stored for each sharp corner, one being
|
|
194
|
+
* terminating and one not. See [[isTerminating]] for more details.
|
|
195
|
+
*/
|
|
196
|
+
function isSharp(cpNode) {
|
|
197
|
+
return cpNode.cp.circle.radius === 0;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Returns the number of contact points on the maximal disk circle implied
|
|
201
|
+
* by this [[CpNode]].
|
|
202
|
+
*
|
|
203
|
+
* Note, however, that even one-prongs and sharp corners will return 2 (see
|
|
204
|
+
* [[isTerminating]] for more details); if this is not desired use
|
|
205
|
+
* [[getRealProngCount]] instead which will return 1 in these cases.
|
|
206
|
+
*/
|
|
207
|
+
function getProngCount(cpNode) {
|
|
208
|
+
// const startCp = this as CpNode;
|
|
209
|
+
const startCpNode = cpNode;
|
|
210
|
+
let cpNode_ = startCpNode;
|
|
211
|
+
let i = 0;
|
|
212
|
+
do {
|
|
213
|
+
i++;
|
|
214
|
+
cpNode_ = cpNode_.nextOnCircle;
|
|
215
|
+
} while (cpNode_ !== startCpNode);
|
|
216
|
+
return i;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Returns the number of contact points (up to planar coordinates) on the
|
|
220
|
+
* maximal disk circle implied by this [[CpNode]].
|
|
221
|
+
*
|
|
222
|
+
* See also [[getProngCount]].
|
|
223
|
+
*/
|
|
224
|
+
function getRealProngCount(cpNode) {
|
|
225
|
+
if (isOneProng(cpNode)) {
|
|
226
|
+
return 1;
|
|
227
|
+
}
|
|
228
|
+
return getProngCount(cpNode);
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Returns true if this [[CpNode]]'s maximal disk has only one contact point
|
|
232
|
+
* on the shape boundary (up to planar coordinates). These includes sharp
|
|
233
|
+
* corners.
|
|
234
|
+
*
|
|
235
|
+
* Note, however, that two [[CpNode]]s are stored for each such point to
|
|
236
|
+
* preserve symmetry - see [[isTerminating]] for more details.
|
|
237
|
+
*/
|
|
238
|
+
function isOneProng(cpNode) {
|
|
239
|
+
const cp1 = cpNode;
|
|
240
|
+
if (cp1.cp.circle.radius === 0) {
|
|
241
|
+
return true;
|
|
242
|
+
}
|
|
243
|
+
const cp2 = cp1.nextOnCircle;
|
|
244
|
+
const p1 = cp1.cp.pointOnShape.p;
|
|
245
|
+
const p2 = cp2.cp.pointOnShape.p;
|
|
246
|
+
return (p1[0] === p2[0] && p1[1] === p2[1]);
|
|
247
|
+
}
|
|
248
|
+
export { matCurveToNextVertex, getChildren, vertexChildren, getAllOnLoop, insertCpNode, getCpNodesOnCircle, isOnSameCircle, isTerminating, isFullyTerminating, getFirstExit, isSharp, isOneProng, getProngCount, getRealProngCount, cpNodeComparator, removeCpNode };
|
|
249
|
+
//# sourceMappingURL=cp-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cp-node.js","sourceRoot":"","sources":["../../src/cp-node/cp-node.ts"],"names":[],"mappings":"AAKA,OAAO,EAAgB,UAAU,EAAE,MAAM,mCAA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AC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC;AAGD,OAAO,EAEN,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACP,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ContactPoint } from '../contact-point/contact-point.js';
|
|
2
|
+
import { CpNode } from './cp-node.js';
|
|
3
|
+
declare function createCpNode(cp: ContactPoint, isHoleClosing: boolean, isIntersection: boolean, prev?: CpNode, next?: CpNode, prevOnCircle?: CpNode, nextOnCircle?: CpNode): CpNode;
|
|
4
|
+
export { createCpNode };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
function createCpNode(cp, isHoleClosing, isIntersection, prev = undefined, next = undefined, prevOnCircle = undefined, nextOnCircle = undefined) {
|
|
2
|
+
return {
|
|
3
|
+
cp, isHoleClosing, isIntersection,
|
|
4
|
+
prev, next, prevOnCircle, nextOnCircle
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export { createCpNode };
|
|
8
|
+
//# sourceMappingURL=create-cp-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-cp-node.js","sourceRoot":"","sources":["../../src/cp-node/create-cp-node.ts"],"names":[],"mappings":"AAIA,SAAS,YAAY,CACb,EAAgB,EAChB,aAAwB,EACxB,cAAwB,EACxB,OAA0B,SAAU,EACpC,OAA0B,SAAU,EACpC,eAA0B,SAAU,EACpC,eAA0B,SAAU;IAExC,OAAO;QACH,EAAE,EAAE,aAAa,EAAE,cAAc;QACjC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY;KACzC,CAAA;AACL,CAAC;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CpNode } from "./cp-node.js";
|
|
2
|
+
declare function enhanceCpNode(cpNode: CpNode): {
|
|
3
|
+
isTerminating: boolean;
|
|
4
|
+
isFullyTerminating: boolean;
|
|
5
|
+
isSharp: boolean;
|
|
6
|
+
prongCount: number;
|
|
7
|
+
getRealProngCount: number;
|
|
8
|
+
ordering: {
|
|
9
|
+
idx: number;
|
|
10
|
+
t: number;
|
|
11
|
+
order: number;
|
|
12
|
+
order2: number;
|
|
13
|
+
};
|
|
14
|
+
curve: import("../curve/curve.js").Curve;
|
|
15
|
+
loop: import("flo-boolean/node/loop/loop.js").Loop;
|
|
16
|
+
cp: import("../contact-point/contact-point.js").ContactPoint;
|
|
17
|
+
isHoleClosing: boolean;
|
|
18
|
+
isIntersection: boolean;
|
|
19
|
+
prev: CpNode;
|
|
20
|
+
next: CpNode;
|
|
21
|
+
prevOnCircle: CpNode;
|
|
22
|
+
nextOnCircle: CpNode;
|
|
23
|
+
};
|
|
24
|
+
export { enhanceCpNode };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getProngCount, getRealProngCount, isFullyTerminating, isSharp, isTerminating } from "./cp-node.js";
|
|
2
|
+
import { getCpNodeOrdering } from './get-cp-node-ordering.js';
|
|
3
|
+
function enhanceCpNode(cpNode) {
|
|
4
|
+
const cp = cpNode.cp;
|
|
5
|
+
const pos = cp.pointOnShape;
|
|
6
|
+
const curve = pos.curve;
|
|
7
|
+
return {
|
|
8
|
+
...cpNode,
|
|
9
|
+
isTerminating: isTerminating(cpNode),
|
|
10
|
+
isFullyTerminating: isFullyTerminating(cpNode),
|
|
11
|
+
isSharp: isSharp(cpNode),
|
|
12
|
+
prongCount: getProngCount(cpNode),
|
|
13
|
+
getRealProngCount: getRealProngCount(cpNode),
|
|
14
|
+
ordering: getCpNodeOrdering(cpNode),
|
|
15
|
+
curve,
|
|
16
|
+
loop: curve.loop
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export { enhanceCpNode };
|
|
20
|
+
//# sourceMappingURL=enhance-cp-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enhance-cp-node.js","sourceRoot":"","sources":["../../src/cp-node/enhance-cp-node.ts"],"names":[],"mappings":"AAAA,OAAO,EACK,aAAa,EAAE,iBAAiB,EAAE,kBAAkB,EAC5D,OAAO,EAAE,aAAa,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D,SAAS,aAAa,CAAC,MAAc;IACjC,MAAM,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;IACrB,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC;IAC5B,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;IAExB,OAAO;QACH,GAAG,MAAM;QACT,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC;QACpC,kBAAkB,EAAE,kBAAkB,CAAC,MAAM,CAAC;QAC9C,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC;QACxB,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC;QACjC,iBAAiB,EAAE,iBAAiB,CAAC,MAAM,CAAC;QAC5C,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC;QACnC,KAAK;QACL,IAAI,EAAE,KAAK,CAAC,IAAI;KACnB,CAAA;AACL,CAAC;AAGD,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-boundary-bezier-parts-to-next.js","sourceRoot":"","sources":["../../src/cp-node/get-boundary-bezier-parts-to-next.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,SAAS,4BAA4B,CAAC,MAAc;IAChD,MAAM,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;IAE3B,MAAM,OAAO,GAA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AE,SAAS,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAA;QAEtC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KAChC,QAAQ,SAAS,KAAK,QAAQ,EAAE;AAGrC,CAAC;AAGD,OAAO,EAAE,4BAA4B,EAAE,CAAA"}
|
package/node/{get-boundary-beziers-to-next.d.ts → cp-node/get-boundary-beziers-to-next.d.ts}
RENAMED
|
@@ -4,5 +4,5 @@ import { CpNode } from './cp-node.js';
|
|
|
4
4
|
* on the boundary.
|
|
5
5
|
* @param cpNode
|
|
6
6
|
*/
|
|
7
|
-
declare function getBoundaryBeziersToNext(cpNode: CpNode): number[][][];
|
|
7
|
+
declare function getBoundaryBeziersToNext(cpNode: CpNode): number[][][] | undefined;
|
|
8
8
|
export { getBoundaryBeziersToNext };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-boundary-beziers-to-next.js","sourceRoot":"","sources":["../../src/cp-node/get-boundary-beziers-to-next.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAKrC;;;;GAIG;AACH,SAAS,wBAAwB,CAAC,MAAc;IAC5C,MAAM,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;IAE3B,MAAM,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC;IACvC,MAAM,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC;IAEvC,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC;IAChC,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC;IAEhC,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,EAAE;QACnC,wEAAwE;QACxE,UAAU;QACV,OAAO,SAAS,CAAC;KACpB;IAED,MAAM,OAAO,GAAG,EAAE,CAAC;IAEnB,IAAI,SAAS,KAAK,SAAS,EAAE;QACzB,OAAO,CAAC,IAAI,CACR,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CACjD,CAAC;KACL;SAAM;QACH,OAAO,CAAC,IAAI,CACR,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CACzC,CAAC;QAEF,iBAAiB,CACT,OAAO,EACP,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,KAAK,EACb,OAAO,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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function getCpNodeOrdering(cpNode) {
|
|
2
|
+
const cp = cpNode.cp;
|
|
3
|
+
const pos = cp.pointOnShape;
|
|
4
|
+
return {
|
|
5
|
+
'idx': pos.curve.idx,
|
|
6
|
+
't': pos.t,
|
|
7
|
+
'order': cp.order,
|
|
8
|
+
'order2': cp.order2
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export { getCpNodeOrdering };
|
|
12
|
+
//# sourceMappingURL=get-cp-node-ordering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-cp-node-ordering.js","sourceRoot":"","sources":["../../src/cp-node/get-cp-node-ordering.ts"],"names":[],"mappings":"AAGA,SAAS,iBAAiB,CAAC,MAAc;IACrC,MAAM,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;IACrB,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC;IAE5B,OAAO;QACH,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG;QACpB,GAAG,EAAE,GAAG,CAAC,CAAC;QACV,OAAO,EAAE,EAAE,CAAC,KAAK;QACjB,QAAQ,EAAE,EAAE,CAAC,MAAM;KACtB,CAAC;AACN,CAAC;AAGD,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCurveBetween } from '
|
|
1
|
+
import { getCurveBetween } from '../get-curve/get-curve-between.js';
|
|
2
2
|
/**
|
|
3
3
|
* Returns the bezier curve from the maximal disk of the given [[CpNode]] to the
|
|
4
4
|
* next [[CpNode]]'s maximal disk and thus directly represents a piece of the
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-curve-to-next.js","sourceRoot":"","sources":["../../src/cp-node/get-curve-to-next.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAGpE;;;;;GAKG;AACH,SAAS,cAAc,CAAC,MAAc;IACrC,OAAO,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC;AAGD,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
package/node/cp-node/remove.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CpNode } from "./cp-node";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*
|
|
5
|
+
* Traverses the shape from the given `CpNode` going around the shortest path
|
|
6
|
+
* so that only a piece of the shape is traversed and returns the visited
|
|
7
|
+
* `CpNode`s (starting from the given `CpNode`).
|
|
8
|
+
*
|
|
9
|
+
* @param cpStart The `CpNode` from where to start the traversal.
|
|
10
|
+
*/
|
|
11
|
+
declare function traverseCp(cpStart: CpNode): CpNode[];
|
|
12
|
+
export { traverseCp };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*
|
|
4
|
+
* Traverses the shape from the given `CpNode` going around the shortest path
|
|
5
|
+
* so that only a piece of the shape is traversed and returns the visited
|
|
6
|
+
* `CpNode`s (starting from the given `CpNode`).
|
|
7
|
+
*
|
|
8
|
+
* @param cpStart The `CpNode` from where to start the traversal.
|
|
9
|
+
*/
|
|
10
|
+
function traverseCp(cpStart) {
|
|
11
|
+
let cpNode = cpStart;
|
|
12
|
+
if (cpNode === cpNode.next.prevOnCircle) {
|
|
13
|
+
return [cpNode]; // one-sharp corner
|
|
14
|
+
}
|
|
15
|
+
const visitedCps = [];
|
|
16
|
+
do {
|
|
17
|
+
visitedCps.push(cpNode);
|
|
18
|
+
const next = cpNode.next.prevOnCircle;
|
|
19
|
+
cpNode = cpNode === next
|
|
20
|
+
? cpNode = cpNode.next.next // Terminal vertex
|
|
21
|
+
: cpNode = next; // Take last exit
|
|
22
|
+
} while (cpNode !== cpStart);
|
|
23
|
+
return visitedCps;
|
|
24
|
+
}
|
|
25
|
+
export { traverseCp };
|
|
26
|
+
//# sourceMappingURL=traverse-cp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traverse-cp.js","sourceRoot":"","sources":["../../src/cp-node/traverse-cp.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,SAAS,UAAU,CAAC,OAAe;IAClC,IAAI,MAAM,GAAG,OAAO,CAAC;IAErB,IAAI,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE;QACxC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAE,mBAAmB;KACrC;IAED,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,GAAG;QACF,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAExB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;QACtC,MAAM,GAAG,MAAM,KAAK,IAAI;YACtB,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB;YAC9C,CAAC,CAAC,MAAM,GAAG,IAAI,CAAA,CAAS,iBAAiB;KAE3C,QAAQ,MAAM,KAAK,OAAO,EAAE;IAE7B,OAAO,UAAU,CAAC;AACnB,CAAC;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getChildren, getCpNodesOnCircle, isTerminating } from './cp-node.js';
|
|
1
2
|
/**
|
|
2
3
|
* Traverses all edges (depth first) of the given MAT tree starting at the given
|
|
3
4
|
* vertex (represented by a [[CpNode]]).
|
|
@@ -8,14 +9,14 @@
|
|
|
8
9
|
function traverseEdges(cpNode, f) {
|
|
9
10
|
// Since the tree is unrooted we must iterate in all directions from the
|
|
10
11
|
// given vertex.
|
|
11
|
-
const cps =
|
|
12
|
+
const cps = getCpNodesOnCircle(cpNode);
|
|
12
13
|
while (cps.length) {
|
|
13
14
|
const cp = cps.pop();
|
|
14
15
|
f(cp);
|
|
15
|
-
if (
|
|
16
|
+
if (isTerminating(cp)) {
|
|
16
17
|
continue;
|
|
17
18
|
}
|
|
18
|
-
cps.push(...
|
|
19
|
+
cps.push(...getChildren(cp));
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
export { traverseEdges };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traverse-edges.js","sourceRoot":"","sources":["../../src/cp-node/traverse-edges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,WAAW,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGtF;;;;;;IAMI;AACJ,SAAS,aAAa,CACpB,MAAc,EACd,CAA2B;IAE5B,wEAAwE;IACxE,gBAAgB;IAChB,MAAM,GAAG,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAEvC,OAAO,GAAG,CAAC,MAAM,EAAE;QAClB,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,EAAG,CAAC;QACtB,CAAC,CAAC,EAAE,CAAC,CAAC;QAEN,IAAI,aAAa,CAAC,EAAE,CAAC,EAAE;YAAE,SAAS;SAAE;QACpC,GAAG,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;KAC7B;AACF,CAAC;AAGD,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getCpNodesOnCircle, isTerminating, vertexChildren } from './cp-node.js';
|
|
1
2
|
/**
|
|
2
3
|
* Traverses the MAT tree and calls the given callback function for each vertex
|
|
3
4
|
* (represented by a [[CpNode]]) on the MAT.
|
|
@@ -11,8 +12,8 @@ function traverseVertices(cpNode, f) {
|
|
|
11
12
|
f(cpNode);
|
|
12
13
|
// Since the tree is unrooted we must iterate in all directions from the
|
|
13
14
|
// given cpNode.
|
|
14
|
-
|
|
15
|
-
.filter(cpNode => !
|
|
15
|
+
getCpNodesOnCircle(cpNode)
|
|
16
|
+
.filter(cpNode => !isTerminating(cpNode))
|
|
16
17
|
.map(cpNode => cpNode.next)
|
|
17
18
|
.forEach(f_);
|
|
18
19
|
function f_(cpNode) {
|
|
@@ -20,7 +21,7 @@ function traverseVertices(cpNode, f) {
|
|
|
20
21
|
while (cps.length) {
|
|
21
22
|
const cp = cps.pop();
|
|
22
23
|
f(cp);
|
|
23
|
-
cps.push(...cp
|
|
24
|
+
cps.push(...vertexChildren(cp));
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traverse-vertices.js","sourceRoot":"","sources":["../../src/cp-node/traverse-vertices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGzF;;;;;;;;GAQG;AACH,SAAS,gBAAgB,CACvB,MAAc,EACd,CAA2B;IAE5B,CAAC,CAAC,MAAM,CAAC,CAAC;IAEV,wEAAwE;IACxE,iBAAiB;IACjB,kBAAkB,CAAC,MAAM,CAAC;SACxB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;SACxC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;SAC1B,OAAO,CAAC,EAAE,CAAC,CAAC;IAEd,SAAS,EAAE,CAAC,MAAc;QACzB,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;QACrB,OAAO,GAAG,CAAC,MAAM,EAAE;YAClB,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,EAAG,CAAC;YACtB,CAAC,CAAC,EAAE,CAAC,CAAC;YACN,GAAG,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC;SAChC;IACF,CAAC;AACF,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Loop } from '
|
|
2
|
-
import {
|
|
1
|
+
import { Loop } from 'flo-boolean';
|
|
2
|
+
import { getCorner } from '../corner/get-corner.js';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a bezier curve on the shape boundary / loop.
|
|
5
5
|
*/
|
|
@@ -25,22 +25,9 @@ interface Curve {
|
|
|
25
25
|
idx: number;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* @
|
|
29
|
-
* Returns a new corner with properties.
|
|
30
|
-
*
|
|
31
|
-
* PRECONDITION: The beziers has control points with max bit-length of 26 and
|
|
32
|
-
* aligned to a 'grid' to have the same exponent. This is so the vectors between
|
|
33
|
-
* control points can be calculated exactly without resorting to adaptive
|
|
34
|
-
* infinite precision floating point operations.
|
|
35
|
-
*
|
|
36
|
-
* @param psI The incoming bezier that ends in the corner
|
|
37
|
-
* @param psO The outgoing bezier that starts at the corner
|
|
38
|
-
*/
|
|
39
|
-
declare function getCorner(psI: number[][], psO: number[][]): Corner;
|
|
40
|
-
/**
|
|
41
|
-
* @hidden
|
|
28
|
+
* @internal
|
|
42
29
|
* Returns information about the corner created at the end of this curve
|
|
43
30
|
* (at t === 1) and the start of the next curve (at t === 0).
|
|
44
31
|
*/
|
|
45
|
-
declare const getCornerAtEnd: (a: Curve) => Corner;
|
|
32
|
+
declare const getCornerAtEnd: (a: Curve) => import("../corner/corner.js").Corner;
|
|
46
33
|
export { Curve, getCorner, getCornerAtEnd };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { memoize } from 'flo-memoize';
|
|
2
|
+
import { getCorner } from '../corner/get-corner.js';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* Returns information about the corner created at the end of this curve
|
|
6
|
+
* (at t === 1) and the start of the next curve (at t === 0).
|
|
7
|
+
*/
|
|
8
|
+
const getCornerAtEnd = memoize(function (curve) {
|
|
9
|
+
const psE = curve.ps;
|
|
10
|
+
const psS = curve.next.ps;
|
|
11
|
+
return getCorner(psE, psS);
|
|
12
|
+
});
|
|
13
|
+
export { getCorner, getCornerAtEnd };
|
|
14
|
+
//# sourceMappingURL=curve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curve.js","sourceRoot":"","sources":["../../src/curve/curve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AA8BpD;;;;GAIG;AACH,MAAM,cAAc,GAAG,OAAO,CAAC,UAAS,KAAY;IACnD,MAAM,GAAG,GAAG,KAAK,CAAC,EAAE,CAAC;IACrB,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;IAE1B,OAAO,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC,CAAC,CAAC;AAGH,OAAO,EAAS,SAAS,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PointOnShape } from '../point-on-shape/point-on-shape.js';
|
|
2
2
|
import { TwoProngForDebugging } from './two-prong-for-debugging.js';
|
|
3
3
|
import { ThreeProngForDebugging } from './three-prong-for-debugging.js';
|
|
4
|
-
import { Curve } from '../curve.js';
|
|
5
|
-
import { Mat } from '../mat.js';
|
|
6
|
-
import { CpNode } from '../cp-node.js';
|
|
7
|
-
import { Circle } from '../circle.js';
|
|
4
|
+
import { Curve } from '../curve/curve.js';
|
|
5
|
+
import { Mat } from '../mat/mat.js';
|
|
6
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
7
|
+
import { Circle } from '../geometry/circle.js';
|
|
8
8
|
import { ICpNodeForDebugging } from './cp-node-for-debugging.js';
|
|
9
|
-
/** @
|
|
9
|
+
/** @internal */
|
|
10
10
|
interface IDebugElems {
|
|
11
|
-
oneProng:
|
|
12
|
-
oneProngAtDullCorner:
|
|
11
|
+
oneProng: CpNode[];
|
|
12
|
+
oneProngAtDullCorner: PointOnShape;
|
|
13
13
|
twoProng_regular: TwoProngForDebugging;
|
|
14
14
|
twoProng_failed: TwoProngForDebugging;
|
|
15
15
|
twoProng_notAdded: TwoProngForDebugging;
|
package/node/debug/debug.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { ITwoProngDebugFunctions } from './functions/two-prong.js';
|
|
|
3
3
|
import { IThreeProngDebugFunctions } from './functions/three-prong.js';
|
|
4
4
|
import { TDrawElemFunctions } from './functions/draw-elem/draw-elem.js';
|
|
5
5
|
import { IDebugElems } from './debug-elem-types.js';
|
|
6
|
-
/** @
|
|
6
|
+
/** @internal */
|
|
7
7
|
interface Debug {
|
|
8
8
|
/** Generated by debug object for later inspection */
|
|
9
9
|
generated: Generated;
|
|
@@ -14,11 +14,11 @@ interface Debug {
|
|
|
14
14
|
fs: IDebugFunctions;
|
|
15
15
|
directives: IDirectives;
|
|
16
16
|
}
|
|
17
|
-
/** @
|
|
17
|
+
/** @internal */
|
|
18
18
|
type GeneratedElems = {
|
|
19
19
|
[T in keyof IDebugElems]: IDebugElems[T][];
|
|
20
20
|
};
|
|
21
|
-
/** @
|
|
21
|
+
/** @internal */
|
|
22
22
|
interface ITiming {
|
|
23
23
|
holeClosers: number;
|
|
24
24
|
oneAnd2Prongs: number;
|
|
@@ -26,18 +26,18 @@ interface ITiming {
|
|
|
26
26
|
sats: number;
|
|
27
27
|
simplifyMat: number;
|
|
28
28
|
}
|
|
29
|
-
/** @
|
|
29
|
+
/** @internal */
|
|
30
30
|
interface Generated {
|
|
31
31
|
elems: GeneratedElems;
|
|
32
32
|
timing: ITiming;
|
|
33
33
|
}
|
|
34
|
-
/** @
|
|
34
|
+
/** @internal */
|
|
35
35
|
interface IDebugFunctions extends IGeneralDebugFunctions {
|
|
36
36
|
twoProng: ITwoProngDebugFunctions;
|
|
37
37
|
threeProng: IThreeProngDebugFunctions;
|
|
38
38
|
drawElem: TDrawElemFunctions;
|
|
39
39
|
}
|
|
40
|
-
/** @
|
|
40
|
+
/** @internal */
|
|
41
41
|
interface IDirectives {
|
|
42
42
|
stopAfterHoleClosers: boolean;
|
|
43
43
|
stopAfterHoleClosersNum: number;
|