flo-mat 2.0.4 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.quokka +4 -0
- package/browser/index.js +18434 -14538
- package/browser/index.min.js +1 -1
- package/node/closest-boundary-point/cull-bezier-pieces.d.ts +9 -0
- package/node/closest-boundary-point/cull-bezier-pieces.js +17 -0
- package/node/closest-boundary-point/cull-bezier-pieces.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.js +2 -2
- package/node/closest-boundary-point/cull-by-loose-bounding-box.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.js +1 -1
- package/node/closest-boundary-point/cull-by-tight-boundary-box.js.map +1 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.d.ts +25 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.js +68 -0
- package/node/closest-boundary-point/dd-deflate-with-running-error.js.map +1 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.d.ts +10 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.js +2 -0
- package/node/closest-boundary-point/foot-and-endpoint-info.js.map +1 -0
- package/node/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.d.ts +2 -2
- package/node/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.js +2 -3
- package/node/closest-boundary-point/get-best-distance-squared.js.map +1 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.d.ts +15 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.js +40 -0
- package/node/closest-boundary-point/get-close-boundary-points-certified.js.map +1 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.d.ts +15 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.js +42 -0
- package/node/closest-boundary-point/get-closest-boundary-point-certified.js.map +1 -0
- package/node/closest-boundary-point/get-p-from-box.d.ts +3 -0
- package/node/closest-boundary-point/get-p-from-box.js +11 -0
- package/node/closest-boundary-point/get-p-from-box.js.map +1 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.d.ts +12 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js +93 -0
- package/node/closest-boundary-point/get-potential-closest-points-on-curve-certified.js.map +1 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.d.ts +13 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js +58 -0
- package/node/closest-boundary-point/root-interval-to-distance-squared-interval.js.map +1 -0
- package/node/{contact-point.d.ts → contact-point/contact-point.d.ts} +3 -3
- package/node/{contact-point.js → contact-point/contact-point.js} +1 -5
- package/node/contact-point/contact-point.js.map +1 -0
- package/node/{compare-curvatures-at-interface.js → corner/compare-curvatures-at-interface.js} +2 -2
- package/node/corner/compare-curvatures-at-interface.js.map +1 -0
- package/node/{mat → corner}/corner.d.ts +1 -1
- package/node/{mat → corner}/corner.js.map +1 -1
- package/node/corner/get-corner.d.ts +15 -0
- package/node/{curve.js → corner/get-corner.js} +6 -17
- package/node/corner/get-corner.js.map +1 -0
- package/node/{get-interface-ccw.js → corner/get-interface-ccw.js} +18 -33
- package/node/corner/get-interface-ccw.js.map +1 -0
- package/node/cp-node/clone.d.ts +1 -1
- package/node/cp-node/clone.js +6 -4
- package/node/cp-node/clone.js.map +1 -1
- package/node/cp-node/cp-node.d.ts +196 -0
- package/node/cp-node/cp-node.js +249 -0
- package/node/cp-node/cp-node.js.map +1 -0
- package/node/cp-node/create-cp-node.d.ts +4 -0
- package/node/cp-node/create-cp-node.js +8 -0
- package/node/cp-node/create-cp-node.js.map +1 -0
- package/node/cp-node/enhance-cp-node.d.ts +24 -0
- package/node/cp-node/enhance-cp-node.js +20 -0
- package/node/cp-node/enhance-cp-node.js.map +1 -0
- package/node/{get-boundary-bezier-parts-to-next.js → cp-node/get-boundary-bezier-parts-to-next.js} +1 -1
- package/node/cp-node/get-boundary-bezier-parts-to-next.js.map +1 -0
- package/node/{get-boundary-beziers-to-next.d.ts → cp-node/get-boundary-beziers-to-next.d.ts} +1 -1
- package/node/{get-boundary-beziers-to-next.js → cp-node/get-boundary-beziers-to-next.js} +1 -1
- package/node/cp-node/get-boundary-beziers-to-next.js.map +1 -0
- package/node/cp-node/get-cp-node-ordering.d.ts +8 -0
- package/node/cp-node/get-cp-node-ordering.js +12 -0
- package/node/cp-node/get-cp-node-ordering.js.map +1 -0
- package/node/{get-curve-to-next.js → cp-node/get-curve-to-next.js} +1 -1
- package/node/cp-node/get-curve-to-next.js.map +1 -0
- package/node/cp-node/remove.d.ts +1 -1
- package/node/cp-node/traverse-cp.d.ts +12 -0
- package/node/cp-node/traverse-cp.js +26 -0
- package/node/cp-node/traverse-cp.js.map +1 -0
- package/node/{traverse-edges.js → cp-node/traverse-edges.js} +4 -3
- package/node/cp-node/traverse-edges.js.map +1 -0
- package/node/{traverse-vertices.js → cp-node/traverse-vertices.js} +4 -3
- package/node/cp-node/traverse-vertices.js.map +1 -0
- package/node/{curve.d.ts → curve/curve.d.ts} +4 -17
- package/node/curve/curve.js +14 -0
- package/node/curve/curve.js.map +1 -0
- package/node/debug/cp-node-for-debugging.d.ts +2 -2
- package/node/debug/debug-elem-types.d.ts +8 -8
- package/node/debug/debug.d.ts +6 -6
- package/node/debug/debug.js +2 -2
- package/node/debug/debug.js.map +1 -1
- package/node/debug/functions/draw-elem/bounding-hull.d.ts +2 -2
- package/node/debug/functions/draw-elem/bounding-hull.js +3 -3
- package/node/debug/functions/draw-elem/bounding-hull.js.map +1 -1
- package/node/debug/functions/draw-elem/branch.d.ts +2 -2
- package/node/debug/functions/draw-elem/branch.js +4 -3
- package/node/debug/functions/draw-elem/branch.js.map +1 -1
- package/node/debug/functions/draw-elem/culls.d.ts +2 -2
- package/node/debug/functions/draw-elem/culls.js +2 -2
- package/node/debug/functions/draw-elem/culls.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.d.ts +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.js +1 -1
- package/node/debug/functions/draw-elem/draw-circle-percent.js.map +1 -1
- package/node/debug/functions/draw-elem/draw-elem.d.ts +3 -3
- package/node/debug/functions/draw-elem/draw-elem.js +3 -3
- package/node/debug/functions/draw-elem/draw-elem.js.map +1 -1
- package/node/debug/functions/draw-elem/dull-corner.d.ts +3 -3
- package/node/debug/functions/draw-elem/dull-corner.js +3 -4
- package/node/debug/functions/draw-elem/dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/leaves.d.ts +2 -2
- package/node/debug/functions/draw-elem/leaves.js +1 -1
- package/node/debug/functions/draw-elem/leaves.js.map +1 -1
- package/node/debug/functions/draw-elem/loop.d.ts +2 -2
- package/node/debug/functions/draw-elem/loop.js +1 -2
- package/node/debug/functions/draw-elem/loop.js.map +1 -1
- package/node/debug/functions/draw-elem/loops.d.ts +1 -1
- package/node/debug/functions/draw-elem/loops.js +0 -1
- package/node/debug/functions/draw-elem/loops.js.map +1 -1
- package/node/debug/functions/draw-elem/loose-bounding-box.d.ts +2 -2
- package/node/debug/functions/draw-elem/loose-bounding-box.js +3 -3
- package/node/debug/functions/draw-elem/loose-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/mat.d.ts +3 -3
- package/node/debug/functions/draw-elem/mat.js +9 -7
- package/node/debug/functions/draw-elem/mat.js.map +1 -1
- package/node/debug/functions/draw-elem/max-vertex.d.ts +2 -2
- package/node/debug/functions/draw-elem/max-vertex.js +1 -1
- package/node/debug/functions/draw-elem/max-vertex.js.map +1 -1
- package/node/debug/functions/draw-elem/min-y.d.ts +3 -3
- package/node/debug/functions/draw-elem/min-y.js +2 -6
- package/node/debug/functions/draw-elem/min-y.js.map +1 -1
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.d.ts +2 -2
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js +2 -2
- package/node/debug/functions/draw-elem/one-prong-at-dull-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/one-prong.d.ts +2 -2
- package/node/debug/functions/draw-elem/one-prong.js +6 -11
- package/node/debug/functions/draw-elem/one-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/sharp-corner.d.ts +3 -3
- package/node/debug/functions/draw-elem/sharp-corner.js +3 -4
- package/node/debug/functions/draw-elem/sharp-corner.js.map +1 -1
- package/node/debug/functions/draw-elem/three-prong.d.ts +2 -2
- package/node/debug/functions/draw-elem/three-prong.js +8 -10
- package/node/debug/functions/draw-elem/three-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/tight-bounding-box.d.ts +2 -2
- package/node/debug/functions/draw-elem/tight-bounding-box.js +3 -3
- package/node/debug/functions/draw-elem/tight-bounding-box.js.map +1 -1
- package/node/debug/functions/draw-elem/two-prong.d.ts +2 -2
- package/node/debug/functions/draw-elem/two-prong.js +7 -8
- package/node/debug/functions/draw-elem/two-prong.js.map +1 -1
- package/node/debug/functions/draw-elem/vertex.d.ts +4 -3
- package/node/debug/functions/draw-elem/vertex.js +11 -9
- package/node/debug/functions/draw-elem/vertex.js.map +1 -1
- package/node/debug/functions/general.d.ts +8 -8
- package/node/debug/functions/general.js +8 -8
- package/node/debug/functions/general.js.map +1 -1
- package/node/debug/functions/three-prong.d.ts +2 -2
- package/node/debug/functions/three-prong.js +10 -13
- package/node/debug/functions/three-prong.js.map +1 -1
- package/node/debug/functions/two-prong.d.ts +16 -5
- package/node/debug/functions/two-prong.js +56 -58
- package/node/debug/functions/two-prong.js.map +1 -1
- package/node/debug/three-prong-for-debugging.d.ts +6 -6
- package/node/debug/three-prong-for-debugging.js +1 -1
- package/node/debug/three-prong-for-debugging.js.map +1 -1
- package/node/debug/two-prong-for-debugging.d.ts +7 -7
- package/node/error-analysis/gamma.d.ts +26 -0
- package/node/error-analysis/gamma.js +35 -0
- package/node/error-analysis/gamma.js.map +1 -0
- package/node/find-2-prong/add-1-prong.d.ts +12 -0
- package/node/{mat/find-mat → find-2-prong}/add-1-prong.js +11 -11
- package/node/find-2-prong/add-1-prong.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/add-2-prong.d.ts +6 -9
- package/node/{mat/find-mat → find-2-prong}/add-2-prong.js +26 -74
- package/node/find-2-prong/add-2-prong.js.map +1 -0
- package/node/find-2-prong/add-debug-info.d.ts +8 -0
- package/node/{mat/find-mat/find-2-prong → find-2-prong}/add-debug-info.js +5 -4
- package/node/find-2-prong/add-debug-info.js.map +1 -0
- package/node/find-2-prong/cull-bezier-pieces.d.ts +11 -0
- package/node/find-2-prong/cull-bezier-pieces.js +28 -0
- package/node/find-2-prong/cull-bezier-pieces.js.map +1 -0
- package/node/{mat/find-mat/find-2-prong → find-2-prong}/find-2-prong.d.ts +9 -13
- package/node/find-2-prong/find-2-prong.js +144 -0
- package/node/find-2-prong/find-2-prong.js.map +1 -0
- package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.d.ts +15 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-2-prongs-on-all-paths.js +5 -4
- package/node/find-2-prong/find-and-add-2-prongs-on-all-paths.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-2-prongs.d.ts +5 -5
- package/node/find-2-prong/find-and-add-2-prongs.js +60 -0
- package/node/find-2-prong/find-and-add-2-prongs.js.map +1 -0
- package/node/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.d.ts +3 -3
- package/node/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.js +5 -5
- package/node/find-2-prong/find-and-add-hole-closing-2-prongs.js.map +1 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.d.ts +10 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.js +56 -0
- package/node/find-2-prong/find-equidistant-point-on-line-dd.js.map +1 -0
- package/node/find-2-prong/get-initial-bezier-pieces.d.ts +15 -0
- package/node/find-2-prong/get-initial-bezier-pieces.js +40 -0
- package/node/find-2-prong/get-initial-bezier-pieces.js.map +1 -0
- package/node/find-2-prong/reduce-radius.d.ts +8 -0
- package/node/find-2-prong/reduce-radius.js +72 -0
- package/node/find-2-prong/reduce-radius.js.map +1 -0
- package/node/find-2-prong/squared-distance-between-dd.d.ts +2 -0
- package/node/find-2-prong/squared-distance-between-dd.js +17 -0
- package/node/find-2-prong/squared-distance-between-dd.js.map +1 -0
- package/node/find-2-prong/x-for-debugging.d.ts +9 -0
- package/node/find-2-prong/x-for-debugging.js.map +1 -0
- package/node/{mat/find-mat → find-3-prong.ts}/add-3-prong.d.ts +12 -7
- package/node/find-3-prong.ts/add-3-prong.js +82 -0
- package/node/find-3-prong.ts/add-3-prong.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.d.ts +4 -4
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.js +1 -1
- package/node/find-3-prong.ts/calc-better-x.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.d.ts +3 -3
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.js +5 -7
- package/node/find-3-prong.ts/calc-initial-3-prong-center.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.d.ts +6 -6
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.js +11 -12
- package/node/find-3-prong.ts/find-3-prong-for-delta3s.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong.d.ts +5 -5
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong.js +52 -39
- package/node/find-3-prong.ts/find-3-prong.js.map +1 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.d.ts +5 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.js +74 -0
- package/node/find-3-prong.ts/find-and-add-3-prongs.js.map +1 -0
- package/node/{mat/find-mat/find-and-add-3-prongs.d.ts → find-3-prong.ts/find-and-add-all-3-prongs.d.ts} +3 -3
- package/node/find-3-prong.ts/find-and-add-all-3-prongs.js +66 -0
- package/node/find-3-prong.ts/find-and-add-all-3-prongs.js.map +1 -0
- package/node/{mat/find-mat/find-3-prong → find-3-prong.ts}/get-closest-points.d.ts +3 -3
- package/node/find-3-prong.ts/get-closest-points.js +14 -0
- package/node/find-3-prong.ts/get-closest-points.js.map +1 -0
- package/node/{mat/find-mat → find-mat}/add-debug-info.d.ts +4 -4
- package/node/{mat/find-mat → find-mat}/add-debug-info.js +6 -6
- package/node/find-mat/add-debug-info.js.map +1 -0
- package/node/{mat/find-mat → find-mat}/create-initial-cp-graph.d.ts +5 -5
- package/node/{mat/find-mat → find-mat}/create-initial-cp-graph.js +5 -6
- package/node/find-mat/create-initial-cp-graph.js.map +1 -0
- package/node/find-mat/find-mat.d.ts +10 -0
- package/node/find-mat/find-mat.js +57 -0
- package/node/find-mat/find-mat.js.map +1 -0
- package/node/{find-mats.d.ts → find-mat/find-mats.d.ts} +1 -1
- package/node/find-mat/find-mats.js +58 -0
- package/node/find-mat/find-mats.js.map +1 -0
- package/node/find-mat/fix-ordering.d.ts +8 -0
- package/node/find-mat/fix-ordering.js +59 -0
- package/node/find-mat/fix-ordering.js.map +1 -0
- package/node/find-mat/get-dull-corners.d.ts +5 -0
- package/node/find-mat/get-dull-corners.js +22 -0
- package/node/find-mat/get-dull-corners.js.map +1 -0
- package/node/find-mat/get-for-1-prongs-on-loop.d.ts +11 -0
- package/node/find-mat/get-for-1-prongs-on-loop.js +28 -0
- package/node/find-mat/get-for-1-prongs-on-loop.js.map +1 -0
- package/node/find-mat/get-for-2-prongs-on-loop.d.ts +11 -0
- package/node/find-mat/get-for-2-prongs-on-loop.js +30 -0
- package/node/find-mat/get-for-2-prongs-on-loop.js.map +1 -0
- package/node/find-mat/get-sharp-corners.d.ts +5 -0
- package/node/find-mat/get-sharp-corners.js +21 -0
- package/node/find-mat/get-sharp-corners.js.map +1 -0
- package/node/find-mat/get-size-params.d.ts +7 -0
- package/node/find-mat/get-size-params.js +33 -0
- package/node/find-mat/get-size-params.js.map +1 -0
- package/node/geometry/circle.js.map +1 -0
- package/node/geometry/get-bounding-box-.js.map +1 -0
- package/node/{mat/geometry → geometry}/get-closest-square-distance-to-rect.d.ts +1 -1
- package/node/{mat/geometry → geometry}/get-closest-square-distance-to-rect.js +1 -1
- package/node/geometry/get-closest-square-distance-to-rect.js.map +1 -0
- package/node/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.d.ts +1 -1
- package/node/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.js +1 -1
- package/node/geometry/get-closest-squared-distance-to-rotated-rect.js.map +1 -0
- package/node/get-curve/get-curve-between.d.ts +1 -1
- package/node/get-curve/get-curve-between.js +2 -2
- package/node/get-curve/get-curve-between.js.map +1 -1
- package/node/get-curve/get-edge-direction.d.ts +2 -2
- package/node/get-curve/get-edge-direction.js +2 -4
- package/node/get-curve/get-edge-direction.js.map +1 -1
- package/node/index.d.ts +24 -20
- package/node/index.js +21 -16
- package/node/index.js.map +1 -1
- package/node/loop/get-max-coordinate.d.ts +1 -1
- package/node/loop/get-max-coordinate.js +1 -1
- package/node/mat/add-to-cp-graph.d.ts +8 -7
- package/node/mat/add-to-cp-graph.js +6 -4
- package/node/mat/add-to-cp-graph.js.map +1 -1
- package/node/mat/bezier-piece.d.ts +2 -2
- package/node/mat/create-new-cp-tree.d.ts +3 -3
- package/node/mat/create-new-cp-tree.js +5 -7
- package/node/mat/create-new-cp-tree.js.map +1 -1
- package/node/mat/elem-type-two-prong.d.ts +1 -1
- package/node/mat/get-boundary-piece-beziers.d.ts +2 -2
- package/node/mat/get-boundary-piece-beziers.js +4 -4
- package/node/mat/get-boundary-piece-beziers.js.map +1 -1
- package/node/{get-branches.d.ts → mat/get-branches.d.ts} +1 -1
- package/node/{get-branches.js → mat/get-branches.js} +7 -6
- package/node/mat/get-branches.js.map +1 -0
- package/node/mat/get-largest-vertex.d.ts +2 -2
- package/node/mat/get-largest-vertex.js +1 -1
- package/node/mat/get-largest-vertex.js.map +1 -1
- package/node/mat/get-neighboring-cps.d.ts +6 -4
- package/node/mat/get-neighboring-cps.js +5 -3
- package/node/mat/get-neighboring-cps.js.map +1 -1
- package/node/mat/get-two-prong-type.d.ts +1 -1
- package/node/mat/get-two-prong-type.js +1 -1
- package/node/mat/get-two-prong-type.js.map +1 -1
- package/node/mat/is-another-cp-closeby.d.ts +9 -8
- package/node/mat/is-another-cp-closeby.js +21 -29
- package/node/mat/is-another-cp-closeby.js.map +1 -1
- package/node/{mat.d.ts → mat/mat.d.ts} +2 -2
- package/node/mat/mat.js.map +1 -0
- package/node/mat/simplify-mat-map-only.d.ts +1 -1
- package/node/mat/simplify-mat-map-only.js +4 -3
- package/node/mat/simplify-mat-map-only.js.map +1 -1
- package/node/{simplify-mat.d.ts → mat/simplify-mat.d.ts} +3 -5
- package/node/{simplify-mat.js → mat/simplify-mat.js} +11 -13
- package/node/mat/simplify-mat.js.map +1 -0
- package/node/mat/trim-mat.d.ts +1 -1
- package/node/mat/trim-mat.js +1 -1
- package/node/mat/trim-mat.js.map +1 -1
- package/node/point-on-shape/calc-pos-order.d.ts +13 -0
- package/node/point-on-shape/calc-pos-order.js +27 -0
- package/node/point-on-shape/calc-pos-order.js.map +1 -0
- package/node/point-on-shape/compare-poss.d.ts +10 -0
- package/node/point-on-shape/compare-poss.js +18 -0
- package/node/point-on-shape/compare-poss.js.map +1 -0
- package/node/point-on-shape/create-pos.d.ts +4 -0
- package/node/point-on-shape/create-pos.js +12 -0
- package/node/point-on-shape/create-pos.js.map +1 -0
- package/node/point-on-shape/get-osculating-circle.d.ts +10 -0
- package/node/point-on-shape/get-osculating-circle.js +25 -0
- package/node/point-on-shape/get-osculating-circle.js.map +1 -0
- package/node/point-on-shape/get-pos-corner.d.ts +7 -0
- package/node/point-on-shape/get-pos-corner.js +9 -0
- package/node/point-on-shape/get-pos-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-corner.js +8 -0
- package/node/point-on-shape/is-pos-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-dull-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-dull-corner.js +14 -0
- package/node/point-on-shape/is-pos-dull-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.js +14 -0
- package/node/point-on-shape/is-pos-quite-sharp-corner.js.map +1 -0
- package/node/point-on-shape/is-pos-sharp-corner.d.ts +6 -0
- package/node/point-on-shape/is-pos-sharp-corner.js +14 -0
- package/node/point-on-shape/is-pos-sharp-corner.js.map +1 -0
- package/node/point-on-shape/point-on-shape.d.ts +11 -0
- package/node/point-on-shape/point-on-shape.js +2 -0
- package/node/point-on-shape/point-on-shape.js.map +1 -0
- package/node/point-on-shape/pos-to-human-string.d.ts +8 -0
- package/node/point-on-shape/pos-to-human-string.js +12 -0
- package/node/point-on-shape/pos-to-human-string.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/add-debug-info.d.ts +2 -2
- package/node/{mat/to-scale-axis → sat}/add-debug-info.js +1 -1
- package/node/sat/add-debug-info.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/cull-non-cycles.d.ts +3 -3
- package/node/{mat/to-scale-axis → sat}/cull-non-cycles.js +6 -6
- package/node/sat/cull-non-cycles.js.map +1 -0
- package/node/{mat/to-scale-axis → sat}/cull.d.ts +3 -3
- package/node/{mat/to-scale-axis → sat}/cull.js +4 -4
- package/node/sat/cull.js.map +1 -0
- package/node/{mat → sat}/get-leaves.d.ts +2 -2
- package/node/sat/get-leaves.js +14 -0
- package/node/sat/get-leaves.js.map +1 -0
- package/node/{to-scale-axis.d.ts → sat/to-scale-axis.d.ts} +2 -2
- package/node/{to-scale-axis.js → sat/to-scale-axis.js} +11 -10
- package/node/sat/to-scale-axis.js.map +1 -0
- package/node/svg/get-loop-bounds.d.ts +7 -7
- package/node/svg/get-loop-bounds.js +11 -7
- package/node/svg/get-loop-bounds.js.map +1 -1
- package/node/svg/get-min-y-pos.d.ts +4 -4
- package/node/svg/get-min-y-pos.js +1 -1
- package/node/svg/get-shape-bounds.d.ts +6 -5
- package/node/svg/get-shape-bounds.js +6 -2
- package/node/svg/get-shape-bounds.js.map +1 -1
- package/node/sweep-line/sweep-line.d.ts +1 -1
- package/node/sweep-line/sweep-line.js +4 -4
- package/node/sweep-line/sweep-line.js.map +1 -1
- package/package.json +10 -10
- package/src/closest-boundary-point/closest-points-on-curve-precise.ts +75 -0
- package/src/closest-boundary-point/closest-points-on-curve.ts +72 -0
- package/src/closest-boundary-point/cull-bezier-pieces.ts +35 -0
- package/src/{mat/closest-boundary-point → closest-boundary-point}/cull-by-loose-bounding-box.ts +4 -3
- package/src/{mat/closest-boundary-point → closest-boundary-point}/cull-by-tight-boundary-box.ts +2 -2
- package/src/closest-boundary-point/dd-deflate-with-running-error.ts +88 -0
- package/src/closest-boundary-point/foot-and-endpoint-info.ts +16 -0
- package/src/{mat/closest-boundary-point → closest-boundary-point}/get-best-distance-squared.ts +3 -4
- package/src/closest-boundary-point/get-close-boundary-points-certified.ts +69 -0
- package/src/closest-boundary-point/get-closest-boundary-point-certified.ts +70 -0
- package/src/closest-boundary-point/get-p-from-box.ts +14 -0
- package/src/closest-boundary-point/get-potential-closest-points-on-curve-certified.ts +122 -0
- package/src/closest-boundary-point/root-interval-to-distance-squared-interval.ts +75 -0
- package/src/{contact-point.ts → contact-point/contact-point.ts} +4 -6
- package/src/{compare-curvatures-at-interface.ts → corner/compare-curvatures-at-interface.ts} +2 -2
- package/src/{mat → corner}/corner.ts +1 -1
- package/src/{curve.ts → corner/get-corner.ts} +10 -49
- package/src/{get-interface-ccw.ts → corner/get-interface-ccw.ts} +28 -35
- package/src/cp-node/clone.ts +17 -6
- package/src/cp-node/cp-node.ts +422 -0
- package/src/cp-node/create-cp-node.ts +21 -0
- package/src/cp-node/enhance-cp-node.ts +27 -0
- package/src/{get-boundary-bezier-parts-to-next.ts → cp-node/get-boundary-bezier-parts-to-next.ts} +3 -3
- package/src/{get-boundary-beziers-to-next.ts → cp-node/get-boundary-beziers-to-next.ts} +2 -2
- package/src/cp-node/get-cp-node-ordering.ts +17 -0
- package/src/{get-curve-to-next.ts → cp-node/get-curve-to-next.ts} +1 -1
- package/src/cp-node/remove.ts +1 -1
- package/src/cp-node/traverse-cp.ts +35 -0
- package/src/{traverse-edges.ts → cp-node/traverse-edges.ts} +5 -5
- package/src/{traverse-vertices.ts → cp-node/traverse-vertices.ts} +5 -5
- package/src/curve/curve.ts +46 -0
- package/src/debug/cp-node-for-debugging.ts +2 -2
- package/src/debug/debug-elem-types.ts +8 -8
- package/src/debug/debug.ts +11 -11
- package/src/debug/functions/draw-elem/bounding-hull.ts +5 -3
- package/src/debug/functions/draw-elem/branch.ts +4 -4
- package/src/debug/functions/draw-elem/culls.ts +3 -3
- package/src/debug/functions/draw-elem/draw-circle-percent.ts +1 -1
- package/src/debug/functions/draw-elem/draw-elem.ts +10 -6
- package/src/debug/functions/draw-elem/dull-corner.ts +10 -6
- package/src/debug/functions/draw-elem/leaves.ts +2 -2
- package/src/debug/functions/draw-elem/loop.ts +4 -3
- package/src/debug/functions/draw-elem/loops.ts +1 -2
- package/src/debug/functions/draw-elem/loose-bounding-box.ts +8 -3
- package/src/debug/functions/draw-elem/mat.ts +16 -8
- package/src/debug/functions/draw-elem/max-vertex.ts +2 -2
- package/src/debug/functions/draw-elem/min-y.ts +4 -9
- package/src/debug/functions/draw-elem/one-prong-at-dull-corner.ts +10 -2
- package/src/debug/functions/draw-elem/one-prong.ts +12 -15
- package/src/debug/functions/draw-elem/sharp-corner.ts +10 -6
- package/src/debug/functions/draw-elem/three-prong.ts +13 -11
- package/src/debug/functions/draw-elem/tight-bounding-box.ts +9 -3
- package/src/debug/functions/draw-elem/two-prong.ts +12 -8
- package/src/debug/functions/draw-elem/vertex.ts +12 -11
- package/src/debug/functions/general.ts +10 -10
- package/src/debug/functions/three-prong.ts +16 -20
- package/src/debug/functions/two-prong.ts +89 -77
- package/src/debug/three-prong-for-debugging.ts +17 -16
- package/src/debug/two-prong-for-debugging.ts +7 -7
- package/src/error-analysis/gamma.ts +41 -0
- package/src/{mat/find-mat → find-2-prong}/add-1-prong.ts +19 -16
- package/src/{mat/find-mat → find-2-prong}/add-2-prong.ts +45 -91
- package/src/find-2-prong/add-debug-info.ts +49 -0
- package/src/{mat/find-mat/find-2-prong → find-2-prong}/cull-bezier-pieces.ts +9 -11
- package/src/find-2-prong/find-2-prong.ts +191 -0
- package/src/{mat/find-mat → find-2-prong}/find-and-add-2-prongs-on-all-paths.ts +12 -9
- package/src/find-2-prong/find-and-add-2-prongs.ts +88 -0
- package/src/{mat/find-mat → find-2-prong}/find-and-add-hole-closing-2-prongs.ts +7 -7
- package/src/find-2-prong/find-equidistant-point-on-line-dd.ts +77 -0
- package/src/{mat/find-mat/find-2-prong → find-2-prong}/find-equidistant-point-on-line.ts +1 -1
- package/src/find-2-prong/get-initial-bezier-pieces.ts +61 -0
- package/src/find-2-prong/pyth-trips.ts +146 -0
- package/src/find-2-prong/reduce-radius.ts +98 -0
- package/src/find-2-prong/squared-distance-between-dd.ts +25 -0
- package/src/find-2-prong/x-for-debugging.ts +13 -0
- package/src/find-3-prong.ts/add-3-prong.ts +110 -0
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-better-x.ts +5 -5
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/calc-initial-3-prong-center.ts +11 -12
- package/src/{mat/find-mat/find-3-prong → find-3-prong.ts}/find-3-prong-for-delta3s.ts +28 -28
- package/src/find-3-prong.ts/find-3-prong.ts +148 -0
- package/src/find-3-prong.ts/find-and-add-3-prongs.ts +111 -0
- package/src/find-3-prong.ts/find-and-add-all-3-prongs.ts +109 -0
- package/src/find-3-prong.ts/get-closest-points.ts +24 -0
- package/src/{mat/find-mat → find-mat}/add-debug-info.ts +10 -10
- package/src/{mat/find-mat → find-mat}/create-initial-cp-graph.ts +11 -12
- package/src/find-mat/find-mat.ts +89 -0
- package/src/find-mat/find-mats.ts +83 -0
- package/src/find-mat/fix-ordering.ts +69 -0
- package/src/find-mat/get-dull-corners.ts +34 -0
- package/src/find-mat/get-for-1-prongs-on-loop.ts +40 -0
- package/src/find-mat/get-for-2-prongs-on-loop.ts +44 -0
- package/src/find-mat/get-sharp-corners.ts +33 -0
- package/src/find-mat/get-size-params.ts +34 -0
- package/src/{mat/find-mat → find-mat}/get-total-by.ts +4 -4
- package/src/{mat/geometry → geometry}/get-closest-square-distance-to-rect.ts +1 -1
- package/src/{mat/geometry → geometry}/get-closest-squared-distance-to-rotated-rect.ts +2 -2
- package/src/get-curve/get-curve-between.ts +7 -7
- package/src/get-curve/get-edge-direction.ts +11 -11
- package/src/index.ts +64 -21
- package/src/loop/get-max-coordinate.ts +1 -1
- package/src/mat/add-to-cp-graph.ts +15 -12
- package/src/mat/bezier-piece.ts +2 -2
- package/src/mat/cmp-cp-on-delta.ts +6 -3
- package/src/mat/create-new-cp-tree.ts +6 -9
- package/src/mat/elem-type-two-prong.ts +1 -1
- package/src/mat/get-boundary-piece-beziers.ts +7 -7
- package/src/{get-branches.ts → mat/get-branches.ts} +8 -8
- package/src/mat/get-edges-as-array.ts +2 -2
- package/src/mat/get-largest-three-prong.ts +3 -3
- package/src/mat/get-largest-vertex.ts +2 -2
- package/src/mat/get-neighboring-cps.ts +9 -6
- package/src/mat/get-two-prong-type.ts +1 -1
- package/src/mat/is-another-cp-closeby.ts +29 -44
- package/src/{mat.ts → mat/mat.ts} +2 -2
- package/src/mat/simplify-mat-map-only.ts +5 -5
- package/src/{simplify-mat.ts → mat/simplify-mat.ts} +12 -14
- package/src/mat/trim-mat.ts +3 -3
- package/src/point-on-shape/calc-pos-order.ts +35 -0
- package/src/point-on-shape/compare-poss.ts +26 -0
- package/src/point-on-shape/create-pos.ts +21 -0
- package/src/point-on-shape/get-osculating-circle.ts +39 -0
- package/src/point-on-shape/get-pos-corner.ts +16 -0
- package/src/point-on-shape/is-pos-corner.ts +12 -0
- package/src/point-on-shape/is-pos-dull-corner.ts +16 -0
- package/src/point-on-shape/is-pos-quite-dull-corner.ts +17 -0
- package/src/point-on-shape/is-pos-quite-sharp-corner.ts +17 -0
- package/src/point-on-shape/is-pos-sharp-corner.ts +17 -0
- package/src/point-on-shape/point-on-shape.ts +15 -0
- package/src/point-on-shape/pos-to-human-string.ts +16 -0
- package/src/{mat/to-scale-axis → sat}/add-debug-info.ts +3 -3
- package/src/{mat/to-scale-axis → sat}/cull-non-cycles.ts +7 -7
- package/src/{mat/to-scale-axis → sat}/cull.ts +6 -6
- package/src/{mat → sat}/get-leaves.ts +4 -4
- package/src/{mat/to-scale-axis → sat}/t-tree.ts +2 -2
- package/src/{to-scale-axis.ts → sat/to-scale-axis.ts} +16 -16
- package/src/{mat/to-scale-axis → sat}/traverse-spacial-tree.ts +5 -5
- package/src/svg/get-loop-bounds.ts +22 -17
- package/src/svg/get-min-y-pos.ts +3 -3
- package/src/svg/get-shape-bounds.ts +12 -9
- package/src/sweep-line/are-boxes-intersecting.ts +1 -1
- package/src/sweep-line/sweep-line.ts +7 -7
- package/tsconfig.json +3 -7
- package/wallaby.mjs +32 -0
- package/node/circle.js.map +0 -1
- package/node/compare-curvatures-at-interface.js.map +0 -1
- package/node/contact-point.js.map +0 -1
- package/node/cp-node.d.ts +0 -202
- package/node/cp-node.js +0 -321
- package/node/cp-node.js.map +0 -1
- package/node/curve.js.map +0 -1
- package/node/find-mats.js +0 -123
- package/node/find-mats.js.map +0 -1
- package/node/get-boundary-bezier-parts-to-next.js.map +0 -1
- package/node/get-boundary-beziers-to-next.js.map +0 -1
- package/node/get-bounding-box-.js.map +0 -1
- package/node/get-branches.js.map +0 -1
- package/node/get-curve-to-next.js.map +0 -1
- package/node/get-interface-ccw.js.map +0 -1
- package/node/loop.d.ts +0 -16
- package/node/loop.js +0 -35
- package/node/loop.js.map +0 -1
- package/node/mat/closest-boundary-point/closest-points-on-curve.d.ts +0 -14
- package/node/mat/closest-boundary-point/closest-points-on-curve.js +0 -73
- package/node/mat/closest-boundary-point/closest-points-on-curve.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-bezier-pieces.d.ts +0 -9
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js +0 -20
- package/node/mat/closest-boundary-point/cull-bezier-pieces.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-by-loose-bounding-box.js.map +0 -1
- package/node/mat/closest-boundary-point/cull-by-tight-boundary-box.js.map +0 -1
- package/node/mat/closest-boundary-point/get-best-distance-squared.js.map +0 -1
- package/node/mat/closest-boundary-point/get-close-boundary-points.d.ts +0 -17
- package/node/mat/closest-boundary-point/get-close-boundary-points.js +0 -81
- package/node/mat/closest-boundary-point/get-close-boundary-points.js.map +0 -1
- package/node/mat/closest-boundary-point/get-closest-boundary-point.d.ts +0 -18
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js +0 -41
- package/node/mat/closest-boundary-point/get-closest-boundary-point.js.map +0 -1
- package/node/mat/find-mat/add-1-prong.d.ts +0 -12
- package/node/mat/find-mat/add-1-prong.js.map +0 -1
- package/node/mat/find-mat/add-2-prong.js.map +0 -1
- package/node/mat/find-mat/add-3-prong.js +0 -55
- package/node/mat/find-mat/add-3-prong.js.map +0 -1
- package/node/mat/find-mat/add-debug-info.js.map +0 -1
- package/node/mat/find-mat/create-get-interesting-points-on-loop.d.ts +0 -11
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js +0 -52
- package/node/mat/find-mat/create-get-interesting-points-on-loop.js.map +0 -1
- package/node/mat/find-mat/create-initial-cp-graph.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/add-debug-info.d.ts +0 -8
- package/node/mat/find-mat/find-2-prong/add-debug-info.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.d.ts +0 -11
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js +0 -30
- package/node/mat/find-mat/find-2-prong/cull-bezier-pieces.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/find-2-prong.js +0 -233
- package/node/mat/find-mat/find-2-prong/find-2-prong.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.d.ts +0 -9
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js +0 -40
- package/node/mat/find-mat/find-2-prong/find-equidistant-point-on-line.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.d.ts +0 -11
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js +0 -38
- package/node/mat/find-mat/find-2-prong/get-initial-bezier-pieces.js.map +0 -1
- package/node/mat/find-mat/find-2-prong/x-for-debugging.d.ts +0 -9
- package/node/mat/find-mat/find-2-prong/x-for-debugging.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/calc-better-x.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/calc-initial-3-prong-center.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong-for-delta3s.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/find-3-prong.js.map +0 -1
- package/node/mat/find-mat/find-3-prong/get-closest-points.js +0 -17
- package/node/mat/find-mat/find-3-prong/get-closest-points.js.map +0 -1
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.d.ts +0 -15
- package/node/mat/find-mat/find-and-add-2-prongs-on-all-paths.js.map +0 -1
- package/node/mat/find-mat/find-and-add-2-prongs.js +0 -74
- package/node/mat/find-mat/find-and-add-2-prongs.js.map +0 -1
- package/node/mat/find-mat/find-and-add-3-prongs.js +0 -147
- package/node/mat/find-mat/find-and-add-3-prongs.js.map +0 -1
- package/node/mat/find-mat/find-and-add-hole-closing-2-prongs.js.map +0 -1
- package/node/mat/find-mat/get-potential-2-prongs.d.ts +0 -4
- package/node/mat/find-mat/get-potential-2-prongs.js +0 -17
- package/node/mat/find-mat/get-potential-2-prongs.js.map +0 -1
- package/node/mat/find-mat/get-sharp-corners.d.ts +0 -4
- package/node/mat/find-mat/get-sharp-corners.js +0 -18
- package/node/mat/find-mat/get-sharp-corners.js.map +0 -1
- package/node/mat/geometry/get-closest-square-distance-to-rect.js.map +0 -1
- package/node/mat/geometry/get-closest-squared-distance-to-rotated-rect.js.map +0 -1
- package/node/mat/get-contact-circles-at-interface.d.ts +0 -8
- package/node/mat/get-contact-circles-at-interface.js +0 -21
- package/node/mat/get-contact-circles-at-interface.js.map +0 -1
- package/node/mat/get-leaves.js +0 -13
- package/node/mat/get-leaves.js.map +0 -1
- package/node/mat/to-scale-axis/add-debug-info.js.map +0 -1
- package/node/mat/to-scale-axis/cull-non-cycles.js.map +0 -1
- package/node/mat/to-scale-axis/cull.js.map +0 -1
- package/node/mat.js.map +0 -1
- package/node/point-on-shape.d.ts +0 -73
- package/node/point-on-shape.js +0 -168
- package/node/point-on-shape.js.map +0 -1
- package/node/simplify-mat.js.map +0 -1
- package/node/to-scale-axis.js.map +0 -1
- package/node/traverse-edges.js.map +0 -1
- package/node/traverse-vertices.js.map +0 -1
- package/src/cp-node.ts +0 -388
- package/src/find-mats.ts +0 -171
- package/src/loop.ts +0 -56
- package/src/mat/closest-boundary-point/closest-point-on-curve-old.ts_ +0 -88
- package/src/mat/closest-boundary-point/closest-point-on-curve.ts_ +0 -95
- package/src/mat/closest-boundary-point/closest-points-on-curve.ts +0 -84
- package/src/mat/closest-boundary-point/cull-bezier-pieces.ts +0 -38
- package/src/mat/closest-boundary-point/get-close-boundary-points.ts +0 -107
- package/src/mat/closest-boundary-point/get-closest-boundary-point.ts +0 -64
- package/src/mat/find-mat/add-3-prong.ts +0 -75
- package/src/mat/find-mat/create-get-interesting-points-on-loop.ts +0 -73
- package/src/mat/find-mat/find-2-prong/add-debug-info.ts +0 -46
- package/src/mat/find-mat/find-2-prong/find-2-prong.ts +0 -316
- package/src/mat/find-mat/find-2-prong/get-initial-bezier-pieces.ts +0 -52
- package/src/mat/find-mat/find-2-prong/x-for-debugging.ts +0 -13
- package/src/mat/find-mat/find-3-prong/find-3-prong.ts +0 -106
- package/src/mat/find-mat/find-3-prong/get-closest-points.ts +0 -28
- package/src/mat/find-mat/find-and-add-2-prongs.ts +0 -108
- package/src/mat/find-mat/find-and-add-3-prongs.ts +0 -218
- package/src/mat/find-mat/get-potential-2-prongs.ts +0 -24
- package/src/mat/find-mat/get-sharp-corners.ts +0 -25
- package/src/mat/find-mat/get-total-abs-curvature.ts +0 -17
- package/src/mat/get-contact-circles-at-interface.ts +0 -26
- package/src/mat/to-scale-axis/add-to-tree.ts +0 -66
- package/src/mat/to-scale-axis/calc-groups.ts +0 -82
- package/src/mat/to-scale-axis/create-spacial-tree.ts +0 -41
- package/src/mat/to-scale-axis/get-engulfed-vertices.ts +0 -135
- package/src/point-on-shape.ts +0 -231
- package/src/svg/get-curvature-at-interface.ts +0 -55
- /package/node/{compare-curvatures-at-interface.d.ts → corner/compare-curvatures-at-interface.d.ts} +0 -0
- /package/node/{mat → corner}/corner.js +0 -0
- /package/node/{get-interface-ccw.d.ts → corner/get-interface-ccw.d.ts} +0 -0
- /package/node/{get-boundary-bezier-parts-to-next.d.ts → cp-node/get-boundary-bezier-parts-to-next.d.ts} +0 -0
- /package/node/{get-curve-to-next.d.ts → cp-node/get-curve-to-next.d.ts} +0 -0
- /package/node/{traverse-edges.d.ts → cp-node/traverse-edges.d.ts} +0 -0
- /package/node/{traverse-vertices.d.ts → cp-node/traverse-vertices.d.ts} +0 -0
- /package/node/{mat/find-mat/find-2-prong → find-2-prong}/x-for-debugging.js +0 -0
- /package/node/{circle.d.ts → geometry/circle.d.ts} +0 -0
- /package/node/{circle.js → geometry/circle.js} +0 -0
- /package/node/{get-bounding-box-.d.ts → geometry/get-bounding-box-.d.ts} +0 -0
- /package/node/{get-bounding-box-.js → geometry/get-bounding-box-.js} +0 -0
- /package/node/{mat.js → mat/mat.js} +0 -0
- /package/src/{circle.ts → geometry/circle.ts} +0 -0
- /package/src/{get-bounding-box-.ts → geometry/get-bounding-box-.ts} +0 -0
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { deflate, allRootsPrecise, allRootsMultiWithErrBounds, toCasStr } from 'flo-poly';
|
|
3
|
-
|
|
4
|
-
import { getObjClosestTo } from 'flo-vector2d';
|
|
5
|
-
import { evaluate, getTangentPolyFromPoint, getTangentPolyFromPointExact } from 'flo-bezier3';
|
|
6
|
-
import { estimate } from 'flo-numerical';
|
|
7
|
-
|
|
8
|
-
import { Curve } from "../../curve";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/** @hidden */
|
|
12
|
-
// TODO - remove delta
|
|
13
|
-
let DELTA = 1e-11;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @hidden
|
|
18
|
-
* @param curve The curve
|
|
19
|
-
* @param p The point from which to check
|
|
20
|
-
* @param tRange The allowed t range
|
|
21
|
-
* @param touchedCurve The bezier on which p is located
|
|
22
|
-
* @param t The t value of the bezier that locates p
|
|
23
|
-
*/
|
|
24
|
-
function closestPointOnCurve(
|
|
25
|
-
curve: Curve,
|
|
26
|
-
p: number[],
|
|
27
|
-
[tS,tE]: number[] = [0,1],
|
|
28
|
-
touchedCurve?: Curve,
|
|
29
|
-
t?: number) {
|
|
30
|
-
|
|
31
|
-
let poly = getTangentPolyFromPointExact(curve.ps, p);
|
|
32
|
-
|
|
33
|
-
//if (curve === touchedCurve) {
|
|
34
|
-
// poly = deflate(poly, t);
|
|
35
|
-
//}
|
|
36
|
-
|
|
37
|
-
let roots = allRootsMultiWithErrBounds(
|
|
38
|
-
poly,
|
|
39
|
-
poly.map(c => 0), // because all coefficients are exact
|
|
40
|
-
() => [], // ...
|
|
41
|
-
tS,
|
|
42
|
-
tE
|
|
43
|
-
).map(t => t.tM);
|
|
44
|
-
|
|
45
|
-
// Also test the endpoints
|
|
46
|
-
let push0 = true;
|
|
47
|
-
let push1 = true;
|
|
48
|
-
if ((t === 1 && curve === touchedCurve.next) ||
|
|
49
|
-
(t === 0 && curve === touchedCurve)) {
|
|
50
|
-
push0 = false;
|
|
51
|
-
}
|
|
52
|
-
if ((t === 0 && curve === touchedCurve.prev) ||
|
|
53
|
-
(t === 1 && curve === touchedCurve)) {
|
|
54
|
-
push1 = false;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (tS === 0) {
|
|
58
|
-
if (push0) { roots.push(0); }
|
|
59
|
-
} else if (tS === 1) {
|
|
60
|
-
if (push1) { roots.push(1); }
|
|
61
|
-
} else {
|
|
62
|
-
roots.push(tS);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (tE === 0) {
|
|
66
|
-
if (push0) { roots.push(0); }
|
|
67
|
-
} else if (tE === 1) {
|
|
68
|
-
if (push1) { roots.push(1); }
|
|
69
|
-
} else {
|
|
70
|
-
roots.push(tE);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// This is to take care of a numerical issue - see shape p1.svg.
|
|
74
|
-
//let roots_: number[] = [];
|
|
75
|
-
//for (let i=0; i<roots.length; i++) {
|
|
76
|
-
// let root = roots[i];
|
|
77
|
-
// if (root !== 0 && root < DELTA) {
|
|
78
|
-
// root = 0;
|
|
79
|
-
// } else if (root !== 1 && 1-root < DELTA) {
|
|
80
|
-
// root = 1;
|
|
81
|
-
// }
|
|
82
|
-
// roots_.push(root);
|
|
83
|
-
//}
|
|
84
|
-
|
|
85
|
-
let ev = evaluate(curve.ps);
|
|
86
|
-
//let ps = roots_.map(
|
|
87
|
-
let ps = roots.map(
|
|
88
|
-
root => ({ p: ev(root), t: root })
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
return getObjClosestTo(p, ps, p => p.p);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
export { closestPointOnCurve }
|
|
@@ -1,84 +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, RootInterval } from 'flo-poly';
|
|
4
|
-
import { evalDeCasteljau, evaluate, getFootpointPolyDd, getFootpointPolyExact } from 'flo-bezier3';
|
|
5
|
-
import { Curve } from "../../curve.js";
|
|
6
|
-
import { eToDd } from 'big-float-ts';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
* @param curve The curve
|
|
12
|
-
* @param p The point from which to check
|
|
13
|
-
* @param tRange The allowed t range
|
|
14
|
-
* @param touchedCurve The bezier on which p is located
|
|
15
|
-
* @param t The t value of the bezier that locates p
|
|
16
|
-
*/
|
|
17
|
-
function closestPointsOnCurve(
|
|
18
|
-
curve: Curve,
|
|
19
|
-
p: number[],
|
|
20
|
-
[tS,tE]: number[] = [0,1],
|
|
21
|
-
touchedCurve: Curve,
|
|
22
|
-
t: number): {
|
|
23
|
-
p: number[];
|
|
24
|
-
t: number;
|
|
25
|
-
}[] {
|
|
26
|
-
|
|
27
|
-
// qqq let poly = getTangentPolyFromPointExact(curve.ps, p);
|
|
28
|
-
const _poly = getFootpointPolyDd(curve.ps, p);
|
|
29
|
-
|
|
30
|
-
// qqq poly = deflateQuad(poly, t);
|
|
31
|
-
const poly = curve === touchedCurve
|
|
32
|
-
? ddDeflate(_poly, t)
|
|
33
|
-
: _poly;
|
|
34
|
-
|
|
35
|
-
// let roots: Omit<RootInterval,'multiplicity'>[] = allRootsMultiWithErrBounds(
|
|
36
|
-
const roots: Omit<RootInterval,'multiplicity'>[] = allRootsCertified(poly, tS, tE);
|
|
37
|
-
|
|
38
|
-
// Also test the endpoints
|
|
39
|
-
let push0 = true;
|
|
40
|
-
let push1 = true;
|
|
41
|
-
if ((t === 1 && curve === touchedCurve.next) ||
|
|
42
|
-
(t === 0 && curve === touchedCurve)) {
|
|
43
|
-
push0 = false;
|
|
44
|
-
}
|
|
45
|
-
if ((t === 0 && curve === touchedCurve.prev) ||
|
|
46
|
-
(t === 1 && curve === touchedCurve)) {
|
|
47
|
-
push1 = false;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (tS === 0) {
|
|
51
|
-
if (push0) { roots.push({ tS: 0, tE: 0 }); }
|
|
52
|
-
} else if (tS === 1) {
|
|
53
|
-
if (push1) { roots.push({ tS: 1, tE: 1 }); }
|
|
54
|
-
} else {
|
|
55
|
-
roots.push({ tS: tS, tE: tS });
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (tE === 0) {
|
|
59
|
-
if (push0) { roots.push({ tS: 0, tE: 0 }); }
|
|
60
|
-
} else if (tE === 1) {
|
|
61
|
-
if (push1) { roots.push({ tS: 1, tE: 1 }); }
|
|
62
|
-
} else {
|
|
63
|
-
roots.push({ tS: tE, tE: tE });
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const ps = roots.map(
|
|
67
|
-
root => {
|
|
68
|
-
const tS = root.tS;
|
|
69
|
-
const tE = root.tE;
|
|
70
|
-
// TODO - tS, tE should always stay within [0,1] - modify findRootsMulti
|
|
71
|
-
const t = tS < 0
|
|
72
|
-
? 0
|
|
73
|
-
: tE > 1 ? 1 : (tS + tE)/2;
|
|
74
|
-
// TODO - why does evalDeCasteljau not work here?
|
|
75
|
-
return { p: evaluate(curve.ps,t), t }
|
|
76
|
-
//return { p: evalDeCasteljau(curve.ps,t), t }
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
return ps;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
export { closestPointsOnCurve }
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { BezierPiece } from '../bezier-piece.js';
|
|
2
|
-
import { getBestDistanceSquared } from './get-best-distance-squared.js';
|
|
3
|
-
import { cullByLooseBoundingBox } from './cull-by-loose-bounding-box.js';
|
|
4
|
-
import { cullByTightBoundingBox } from './cull-by-tight-boundary-box.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
* @param bezierPieces
|
|
10
|
-
* @param p
|
|
11
|
-
* @param extreme
|
|
12
|
-
*/
|
|
13
|
-
function cullBezierPieces(
|
|
14
|
-
bezierPieces: BezierPiece[],
|
|
15
|
-
p: number[]) {
|
|
16
|
-
|
|
17
|
-
const CULL_THRESHOLD = 0;
|
|
18
|
-
|
|
19
|
-
if (bezierPieces.length > CULL_THRESHOLD) {
|
|
20
|
-
const bestSquaredDistance = getBestDistanceSquared(
|
|
21
|
-
bezierPieces, p
|
|
22
|
-
);
|
|
23
|
-
bezierPieces = cullByLooseBoundingBox(
|
|
24
|
-
bezierPieces, p,
|
|
25
|
-
bestSquaredDistance
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
bezierPieces = cullByTightBoundingBox(
|
|
29
|
-
bezierPieces, p,
|
|
30
|
-
bestSquaredDistance
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return bezierPieces;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export { cullBezierPieces }
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { distanceBetween } from 'flo-vector2d';
|
|
2
|
-
import { IPointOnShape, PointOnShape } from '../../point-on-shape.js';
|
|
3
|
-
import { BezierPiece } from '../bezier-piece.js';
|
|
4
|
-
import { cullBezierPieces } from './cull-bezier-pieces.js';
|
|
5
|
-
import { closestPointsOnCurve } from './closest-points-on-curve.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @hidden
|
|
10
|
-
* Returns the closest boundary point to the given point, limited to the given
|
|
11
|
-
* bezier pieces, including the beziers actually checked after culling.
|
|
12
|
-
* @param bezierPieces
|
|
13
|
-
* @param point
|
|
14
|
-
* @param touchedCurve
|
|
15
|
-
* @param t
|
|
16
|
-
* @param extreme
|
|
17
|
-
*/
|
|
18
|
-
function getCloseBoundaryPoints(
|
|
19
|
-
bezierPieces: BezierPiece[],
|
|
20
|
-
point: number[],
|
|
21
|
-
y: IPointOnShape,
|
|
22
|
-
distance: number) {
|
|
23
|
-
|
|
24
|
-
const touchedCurve = y.curve;
|
|
25
|
-
const t = y.t;
|
|
26
|
-
const p_ = y.p;
|
|
27
|
-
|
|
28
|
-
bezierPieces = cullBezierPieces(bezierPieces, point);
|
|
29
|
-
|
|
30
|
-
// TODO - integrate with is-another-cp-closeby - we MUST check angle too!
|
|
31
|
-
const DISTANCE_TOLERANCE = 1e-9;
|
|
32
|
-
const posInfos: { pos: IPointOnShape; d: number }[] = [];
|
|
33
|
-
for (let i=0; i<bezierPieces.length; i++) {
|
|
34
|
-
const bezierPiece = bezierPieces[i];
|
|
35
|
-
|
|
36
|
-
// TOOD - important - should be able to return multiple points
|
|
37
|
-
const ps = closestPointsOnCurve(
|
|
38
|
-
bezierPiece.curve,
|
|
39
|
-
point,
|
|
40
|
-
bezierPiece.ts,
|
|
41
|
-
touchedCurve,
|
|
42
|
-
t
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
//if (ps === undefined) { continue; }
|
|
46
|
-
|
|
47
|
-
for (let j=0; j<ps.length; j++) {
|
|
48
|
-
const p = ps[j];
|
|
49
|
-
const d = distanceBetween(p.p, point);
|
|
50
|
-
|
|
51
|
-
let curve = bezierPiece.curve;
|
|
52
|
-
let t_= p.t;
|
|
53
|
-
|
|
54
|
-
if (Math.abs(d-distance) < DISTANCE_TOLERANCE) {
|
|
55
|
-
if (t_ === 0) {
|
|
56
|
-
t_ = 1;
|
|
57
|
-
curve = bezierPiece.curve.prev;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
posInfos.push({ pos: new PointOnShape(curve, t_), d });
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (posInfos.length > 1) {
|
|
66
|
-
// Remove ones that are too close together.
|
|
67
|
-
// TODO - in future remove all these checks and join n-prongs when they
|
|
68
|
-
// are being added - much simpler and more symmetric. Remeber order when
|
|
69
|
-
// comparing closeness!
|
|
70
|
-
const indexesToCheck: number[] = [];
|
|
71
|
-
for (let i=0; i<posInfos.length; i++) {
|
|
72
|
-
const pi = posInfos[i];
|
|
73
|
-
// Only check if they are close to the edges. Why??
|
|
74
|
-
//if (pi.pos.t < 1e-2 || 1-pi.pos.t < 1e-2) {
|
|
75
|
-
indexesToCheck.push(i);
|
|
76
|
-
//}
|
|
77
|
-
}
|
|
78
|
-
const indexesToRemove: number[] = [];
|
|
79
|
-
for (let i=0; i<indexesToCheck.length; i++) {
|
|
80
|
-
for (let j=i+1; j<indexesToCheck.length; j++) {
|
|
81
|
-
if (i === j) { continue; }
|
|
82
|
-
const p1 = posInfos[indexesToCheck[i]].pos.p;
|
|
83
|
-
const p2 = posInfos[indexesToCheck[j]].pos.p;
|
|
84
|
-
// Below checks for source point too - similar to
|
|
85
|
-
// isAnotherCpCloseBy
|
|
86
|
-
const p3 = p_;
|
|
87
|
-
if ((Math.abs(p1[0] - p2[0]) < 1e-6 &&
|
|
88
|
-
Math.abs(p1[1] - p2[1]) < 1e-6) ||
|
|
89
|
-
|
|
90
|
-
(Math.abs(p1[0] - p3[0]) < 1e-6 &&
|
|
91
|
-
Math.abs(p1[1] - p3[1]) < 1e-6)
|
|
92
|
-
) {
|
|
93
|
-
|
|
94
|
-
indexesToRemove.push(indexesToCheck[i]);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
for (let i=indexesToRemove.length -1; i >= 0; i--) {
|
|
99
|
-
posInfos.splice(indexesToRemove[i], 1);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return posInfos;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
export { getCloseBoundaryPoints };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { distanceBetween, getObjClosestTo } from 'flo-vector2d';
|
|
2
|
-
import { Curve } from '../../curve.js';
|
|
3
|
-
import { PointOnShape, IPointOnShape } from '../../point-on-shape.js';
|
|
4
|
-
import { BezierPiece } from '../bezier-piece.js';
|
|
5
|
-
import { cullBezierPieces } from './cull-bezier-pieces.js';
|
|
6
|
-
import { closestPointsOnCurve } from './closest-points-on-curve.js';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @hidden
|
|
11
|
-
* Returns the closest boundary point to the given point, limited to the given
|
|
12
|
-
* bezier pieces, including the beziers actually checked after culling.
|
|
13
|
-
* @param bezierPieces
|
|
14
|
-
* @param point
|
|
15
|
-
* @param touchedCurve
|
|
16
|
-
* @param t
|
|
17
|
-
* @param extreme
|
|
18
|
-
*/
|
|
19
|
-
function getClosestBoundaryPoint(
|
|
20
|
-
bezierPieces: BezierPiece[],
|
|
21
|
-
point: number[],
|
|
22
|
-
touchedCurve: Curve,
|
|
23
|
-
t: number) {
|
|
24
|
-
|
|
25
|
-
bezierPieces = cullBezierPieces(bezierPieces, point);
|
|
26
|
-
|
|
27
|
-
let bestDistance = Number.POSITIVE_INFINITY;
|
|
28
|
-
let posInfo: { pos: IPointOnShape; d: number };
|
|
29
|
-
for (let i=0; i<bezierPieces.length; i++) {
|
|
30
|
-
const bezierPiece = bezierPieces[i];
|
|
31
|
-
|
|
32
|
-
const ps = closestPointsOnCurve(
|
|
33
|
-
bezierPiece.curve,
|
|
34
|
-
point,
|
|
35
|
-
bezierPiece.ts,
|
|
36
|
-
touchedCurve,
|
|
37
|
-
t
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
const p = getObjClosestTo(point, ps, p => p.p)
|
|
41
|
-
|
|
42
|
-
if (p === undefined) { continue; }
|
|
43
|
-
|
|
44
|
-
const d = distanceBetween(p.p, point);
|
|
45
|
-
|
|
46
|
-
let curve = bezierPiece.curve;
|
|
47
|
-
let t_= p.t;
|
|
48
|
-
|
|
49
|
-
if (d < bestDistance) {
|
|
50
|
-
if (t_ === 0) {
|
|
51
|
-
t_ = 1;
|
|
52
|
-
curve = bezierPiece.curve.prev;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
posInfo = { pos: new PointOnShape(curve, t_), d };
|
|
56
|
-
bestDistance = d;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return posInfo;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
export { getClosestBoundaryPoint };
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { LlRbTree } from 'flo-ll-rb-tree';
|
|
2
|
-
import { CpNode } from '../../cp-node.js';
|
|
3
|
-
import { Loop } from '../../loop.js';
|
|
4
|
-
import { Circle } from '../../circle.js';
|
|
5
|
-
import { IPointOnShape } from '../../point-on-shape.js';
|
|
6
|
-
import { addToCpGraph } from '../add-to-cp-graph.js';
|
|
7
|
-
import { isAnotherCpCloseby } from '../is-another-cp-closeby.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @hidden
|
|
12
|
-
* Adds a 3-prong MAT circle according to the 3 given (previously calculated)
|
|
13
|
-
* points on the shape.
|
|
14
|
-
* @param cpTrees
|
|
15
|
-
* @param orders
|
|
16
|
-
* @param threeProng
|
|
17
|
-
*/
|
|
18
|
-
function add3Prong(
|
|
19
|
-
cpTrees: Map<Loop,LlRbTree<CpNode>>,
|
|
20
|
-
orders: number[],
|
|
21
|
-
threeProng: {
|
|
22
|
-
circle: Circle,
|
|
23
|
-
ps: IPointOnShape[],
|
|
24
|
-
δ3s: CpNode[][]
|
|
25
|
-
}) {
|
|
26
|
-
|
|
27
|
-
const { circle, ps: poss, δ3s } = threeProng;
|
|
28
|
-
|
|
29
|
-
// Keep for possible future debugging.
|
|
30
|
-
/*
|
|
31
|
-
if (typeof _debug_ !== 'undefined') {
|
|
32
|
-
for (let i=0; i<3; i++) {
|
|
33
|
-
let cpBef = threeProng.δ3s[i][0].cp;
|
|
34
|
-
let cpAft = threeProng.δ3s[i][1].cp;
|
|
35
|
-
//let cmpBef = PointOnShape.compareInclOrder(cpBef.pointOnShape, ps[i], cpBef.order, orders[i]);
|
|
36
|
-
//let cmpAft = PointOnShape.compareInclOrder(cpAft.pointOnShape, ps[i], cpAft.order, orders[i]);
|
|
37
|
-
|
|
38
|
-
let cmpBef = PointOnShape.compare(cpBef.pointOnShape, ps[i]);
|
|
39
|
-
let cmpAft = PointOnShape.compare(cpAft.pointOnShape, ps[i]);
|
|
40
|
-
|
|
41
|
-
// len is used by debug functions to reference a particular
|
|
42
|
-
// three-prong.
|
|
43
|
-
let len = _debug_.generated.elems.threeProng.length-1;
|
|
44
|
-
if (cmpBef > 0) {
|
|
45
|
-
console.log('----------------------------------------');
|
|
46
|
-
console.log(`3-prong order is wrong (bef) : i: ${i} - cmp: ${cmpBef} - n: ${len}`);
|
|
47
|
-
console.log(threeProng);
|
|
48
|
-
console.log(cpBef);
|
|
49
|
-
console.log(cpAft);
|
|
50
|
-
console.log(ps[i]);
|
|
51
|
-
}
|
|
52
|
-
if (cmpAft < 0) {
|
|
53
|
-
console.log('----------------------------------------');
|
|
54
|
-
console.log(`3-prong order is wrong (aft) : i: ${i} - cmp: ${cmpAft} - n: ${len}`);
|
|
55
|
-
console.log(threeProng);
|
|
56
|
-
console.log(cpBef);
|
|
57
|
-
console.log(cpAft);
|
|
58
|
-
console.log(ps[i]);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
|
-
// TODO - replace 1000 below with correct value
|
|
65
|
-
isAnotherCpCloseby(cpTrees, poss[0], circle, orders[0], 0, 1000, 'blue');
|
|
66
|
-
isAnotherCpCloseby(cpTrees, poss[1], circle, orders[1], 0, 1000, 'blue');
|
|
67
|
-
isAnotherCpCloseby(cpTrees, poss[2], circle, orders[2], 0, 1000, 'blue');
|
|
68
|
-
|
|
69
|
-
addToCpGraph(circle, orders, cpTrees, poss, δ3s);
|
|
70
|
-
|
|
71
|
-
return circle;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
export { add3Prong }
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { getCurvatureExtrema, splitByCurvatureAndLength, controlPointLinesLength } from 'flo-bezier3';
|
|
2
|
-
import { getContactCirclesAtInterface } from '../get-contact-circles-at-interface.js';
|
|
3
|
-
import { Loop } from '../../loop.js';
|
|
4
|
-
import { PointOnShape, comparePoss, IPointOnShape } from '../../point-on-shape.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @hidden
|
|
9
|
-
* Get useful points on the shape - these incude points of maximum curvature and
|
|
10
|
-
* points at the bezier-bezier interfaces.
|
|
11
|
-
* @param loop
|
|
12
|
-
* @param additionalPointCount
|
|
13
|
-
*/
|
|
14
|
-
function getInterestingPointsOnLoop(
|
|
15
|
-
minBezLength: number,
|
|
16
|
-
maxCurviness: number,
|
|
17
|
-
maxLength: number) {
|
|
18
|
-
|
|
19
|
-
return function(loop: Loop) {
|
|
20
|
-
const allPoints: IPointOnShape[] = [];
|
|
21
|
-
|
|
22
|
-
for (let i=0; i<loop.curves.length; i++) {
|
|
23
|
-
const curve = loop.curves[i];
|
|
24
|
-
|
|
25
|
-
// qqq if (lengthSquaredUpperBound(curve.ps) < minBezLength) {
|
|
26
|
-
if (controlPointLinesLength(curve.ps) < minBezLength) {
|
|
27
|
-
continue;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/*
|
|
32
|
-
let { maxCurvatureTs, maxNegativeCurvatureTs } =
|
|
33
|
-
getCurvatureExtrema(curve.ps);
|
|
34
|
-
let maxCurvatures = maxCurvatureTs.map(t => new PointOnShape(curve, t));
|
|
35
|
-
let maxNegativeCurvatures = maxNegativeCurvatureTs.map(t => new PointOnShape(curve, t));
|
|
36
|
-
|
|
37
|
-
allPoints.push(
|
|
38
|
-
...getContactCirclesAtInterface(curve),
|
|
39
|
-
...maxCurvatures,
|
|
40
|
-
...maxNegativeCurvatures
|
|
41
|
-
);
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
// let { maxima } = getCurvatureExtrema(curve.ps);
|
|
45
|
-
// qqq let { maxCurvatureTs, maxNegativeCurvatureTs } = getCurvatureExtrema(curve.ps);
|
|
46
|
-
const { maxima } = getCurvatureExtrema(curve.ps);
|
|
47
|
-
// let maxAbsCurvatures = maxima.map(t => new PointOnShape(curve, t));
|
|
48
|
-
// qqq let maxAbsCurvatures = [...maxCurvatureTs, ...maxNegativeCurvatureTs].map(t => new PointOnShape(curve, t));
|
|
49
|
-
const maxAbsCurvatures = [...maxima].map(t => new PointOnShape(curve, t));
|
|
50
|
-
|
|
51
|
-
allPoints.push(
|
|
52
|
-
...getContactCirclesAtInterface(curve),
|
|
53
|
-
...maxAbsCurvatures,
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
let ts = splitByCurvatureAndLength(curve.ps, maxCurviness, maxLength);
|
|
57
|
-
if (ts.length === 2) {
|
|
58
|
-
ts = [0, 0.5, 1];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
for (let i=1; i<ts.length-1; i++) {
|
|
62
|
-
allPoints.push( new PointOnShape(curve, ts[i]) );
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
allPoints.sort(comparePoss);
|
|
67
|
-
|
|
68
|
-
return allPoints;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
export { getInterestingPointsOnLoop }
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/** @internal */
|
|
2
|
-
declare const _debug_: Debug;
|
|
3
|
-
|
|
4
|
-
import { Debug } from '../../../debug/debug.js';
|
|
5
|
-
import { IPointOnShape } from '../../../point-on-shape.js';
|
|
6
|
-
import { Circle } from '../../../circle.js';
|
|
7
|
-
import { CpNode } from '../../../cp-node.js';
|
|
8
|
-
import { BezierPiece } from '../../bezier-piece.js';
|
|
9
|
-
import { TwoProngForDebugging } from '../../../debug/two-prong-for-debugging.js';
|
|
10
|
-
import { getTwoProngType } from '../../get-two-prong-type.js';
|
|
11
|
-
import { ElemType_TwoProng } from '../../elem-type-two-prong.js';
|
|
12
|
-
import { TXForDebugging } from './x-for-debugging.js';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/** @hidden */
|
|
16
|
-
function addDebugInfo(
|
|
17
|
-
bezierPieces: BezierPiece[],
|
|
18
|
-
failed: boolean,
|
|
19
|
-
pos: IPointOnShape,
|
|
20
|
-
circle: Circle,
|
|
21
|
-
z: IPointOnShape,
|
|
22
|
-
δ: CpNode[],
|
|
23
|
-
xs: TXForDebugging[],
|
|
24
|
-
holeClosing: boolean) {
|
|
25
|
-
|
|
26
|
-
const twoProng: TwoProngForDebugging = {
|
|
27
|
-
generated: _debug_.generated,
|
|
28
|
-
bezierPieces,
|
|
29
|
-
pos,
|
|
30
|
-
δ,
|
|
31
|
-
z: z ? z.p : undefined,
|
|
32
|
-
circle,
|
|
33
|
-
xs,
|
|
34
|
-
failed,
|
|
35
|
-
holeClosing,
|
|
36
|
-
notAdded: false,
|
|
37
|
-
deleted: false,
|
|
38
|
-
cpNode: undefined
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const twoProngType = getTwoProngType(twoProng) as ElemType_TwoProng;
|
|
42
|
-
_debug_.generated.elems[twoProngType].push(twoProng);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
export { addDebugInfo }
|