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,8 +1,8 @@
|
|
|
1
1
|
import { hausdorffDistance } from 'flo-bezier3';
|
|
2
|
-
import {
|
|
2
|
+
import { getCpNodesOnCircle, isTerminating, removeCpNode } from '../cp-node/cp-node.js';
|
|
3
3
|
import { getBranches } from './get-branches.js';
|
|
4
|
-
import { getCurveToNext } from '
|
|
5
|
-
import { getCurveBetween } from '
|
|
4
|
+
import { getCurveToNext } from '../cp-node/get-curve-to-next.js';
|
|
5
|
+
import { getCurveBetween } from '../get-curve/get-curve-between.js';
|
|
6
6
|
/**
|
|
7
7
|
* Simplifies the given MAT by replacing the piecewise quad beziers composing
|
|
8
8
|
* the MAT with fewer ones to within a given tolerance.
|
|
@@ -10,16 +10,14 @@ import { getCurveBetween } from './get-curve/get-curve-between.js';
|
|
|
10
10
|
* @param anlgeTolerance Tolerance given as the degrees difference of the unit
|
|
11
11
|
* direction vectors at the interface between curves. A tolerance of zero means
|
|
12
12
|
* perfect smoothness is required - defaults to 15.
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
* defaults to
|
|
16
|
-
* @param maxIterations The spacing on the curves used to calculate the Hausdorff
|
|
17
|
-
* Distance - defaults to 1
|
|
13
|
+
* @param hausdorffTolerance The approximate maximum Hausdorff Distance tolerance -
|
|
14
|
+
* defaults to `2**-3`
|
|
15
|
+
* @param maxIterations The max iterations, defaults to `50`
|
|
18
16
|
*/
|
|
19
17
|
function simplifyMat(mat, anlgeTolerance = 15, hausdorffTolerance = 2 ** -3, maxIterations = 50) {
|
|
20
18
|
let cpNode = mat.cpNode;
|
|
21
19
|
// Start from a leaf
|
|
22
|
-
while (!
|
|
20
|
+
while (!isTerminating(cpNode)) {
|
|
23
21
|
cpNode = cpNode.next;
|
|
24
22
|
}
|
|
25
23
|
const branches = getBranches(cpNode, anlgeTolerance);
|
|
@@ -50,12 +48,12 @@ function simplifyMat(mat, anlgeTolerance = 15, hausdorffTolerance = 2 ** -3, max
|
|
|
50
48
|
}
|
|
51
49
|
}
|
|
52
50
|
for (const cpNode of canDeletes) {
|
|
53
|
-
const
|
|
54
|
-
const onCircleCount =
|
|
55
|
-
if (
|
|
51
|
+
const isTerminating_ = isTerminating(cpNode);
|
|
52
|
+
const onCircleCount = getCpNodesOnCircle(cpNode).length;
|
|
53
|
+
if (isTerminating_ || onCircleCount !== 2) {
|
|
56
54
|
continue;
|
|
57
55
|
}
|
|
58
|
-
|
|
56
|
+
removeCpNode(cpNode);
|
|
59
57
|
}
|
|
60
58
|
//return { cpNode, cpTrees: createNewCpTree(cpNode) };
|
|
61
59
|
return { cpNode, cpTrees: undefined };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simplify-mat.js","sourceRoot":"","sources":["../../src/mat/simplify-mat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAU,kBAAkB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAIpE;;;;;;;;;;GAUG;AACH,SAAS,WAAW,CACZ,GAAQ,EACR,cAAc,GAAG,EAAE,EACnB,kBAAkB,GAAG,CAAC,IAAE,CAAC,CAAC,EAC1B,aAAa,GAAG,EAAE;IAEtB,IAAI,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAExB,oBAAoB;IACpB,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE;QAAE,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;KAAE;IAExD,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAErD,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAClC,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE3B,qBAAqB;QACrB,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE;YACtB,MAAM,CAAC,GAAG,CAAC,CAAC;YACZ,OAAO,IAAI,EAAE;gBACT,CAAC,EAAE,CAAC;gBAEJ,IAAI,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE;oBAAE,MAAM;iBAAE;gBAEnC,MAAM,EAAE,GAAG,yBAAyB,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;gBAElE,IAAI,EAAE,GAAG,kBAAkB,EAAE;oBACzB,MAAM;iBACT;qBAAM;oBACH,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;iBAC9B;aACJ;YAED,IAAI,CAAC,GAAC,CAAC,KAAK,CAAC,EAAE;gBACX,4BAA4B;gBAC5B,MAAM;aACT;SACJ;KACJ;IAED,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE;QAC7B,MAAM,cAAc,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,aAAa,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;QACxD,IAAI,cAAc,IAAI,aAAa,KAAK,CAAC,EAAE;YACvC,SAAS;SACZ;QAED,YAAY,CAAC,MAAM,CAAC,CAAC;KACxB;IAED,uDAAuD;IACvD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAU,EAAE,CAAC;AAC3C,CAAC;AAGD,SAAS,yBAAyB,CAC1B,CAAS,EACT,CAAS,EACT,MAAgB,EAChB,gBAAwB;IAE5B,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,MAAM,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC7D,OAAO,CAAC,GAAC,CAAC,GAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACf,GAAG,CAAC,IAAI,CAAC,iBAAiB,CACtB,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EACzB,SAAS,EACT,gBAAgB,CACnB,CAAC,CAAC;KACN;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;AAC5B,CAAC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
package/node/mat/trim-mat.d.ts
CHANGED
package/node/mat/trim-mat.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createNewCpTree } from './create-new-cp-tree.js';
|
|
2
|
-
import { cullNonCycles } from '
|
|
2
|
+
import { cullNonCycles } from '../sat/cull-non-cycles.js';
|
|
3
3
|
import { clone } from '../cp-node/clone.js';
|
|
4
4
|
/**
|
|
5
5
|
* Trims the given Medial Axis Transform so that only cycles remain. Similar to
|
package/node/mat/trim-mat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trim-mat.js","sourceRoot":"","sources":["../../src/mat/trim-mat.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"trim-mat.js","sourceRoot":"","sources":["../../src/mat/trim-mat.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C;;;;GAIG;AACH,SAAS,OAAO,CAAC,GAAQ;IACxB,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAE7C,IAAI,CAAC,MAAM,EAAE;QAAE,OAAO,SAAU,CAAC;KAAE;IAEnC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;AACxD,CAAC;AAGD,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Circle } from "../geometry/circle.js";
|
|
2
|
+
import { PointOnShape } from "./point-on-shape.js";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*
|
|
6
|
+
* Calculates the order (to distinguish between points lying on top of each
|
|
7
|
+
* other) of the contact point if it is a dull corner.
|
|
8
|
+
*
|
|
9
|
+
* @param circle
|
|
10
|
+
* @param pos
|
|
11
|
+
*/
|
|
12
|
+
declare function calcPosOrder(circle: Circle, pos: PointOnShape): number;
|
|
13
|
+
export { calcPosOrder };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { dot, fromTo, rotateNeg90Degrees, toUnitVector } from "flo-vector2d";
|
|
2
|
+
import { isPosCorner } from './is-pos-corner.js';
|
|
3
|
+
import { isPosDullCorner } from "./is-pos-dull-corner.js";
|
|
4
|
+
import { getPosCorner } from './get-pos-corner.js';
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*
|
|
8
|
+
* Calculates the order (to distinguish between points lying on top of each
|
|
9
|
+
* other) of the contact point if it is a dull corner.
|
|
10
|
+
*
|
|
11
|
+
* @param circle
|
|
12
|
+
* @param pos
|
|
13
|
+
*/
|
|
14
|
+
function calcPosOrder(circle, pos) {
|
|
15
|
+
if (!isPosCorner(pos)) {
|
|
16
|
+
return 0;
|
|
17
|
+
}
|
|
18
|
+
if (!isPosDullCorner(pos)) {
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
21
|
+
const corner = getPosCorner(pos);
|
|
22
|
+
const n = rotateNeg90Degrees(corner.tangents[0]);
|
|
23
|
+
const v = toUnitVector(fromTo(pos.p, circle.center));
|
|
24
|
+
return -dot(n, v);
|
|
25
|
+
}
|
|
26
|
+
export { calcPosOrder };
|
|
27
|
+
//# sourceMappingURL=calc-pos-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calc-pos-order.js","sourceRoot":"","sources":["../../src/point-on-shape/calc-pos-order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG7E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD;;;;;;;;GAQG;AACH,SAAS,YAAY,CACb,MAAc,EACd,GAAiB;IAErB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;QAAE,OAAO,CAAC,CAAC;KAAE;IACpC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE;QAAE,OAAO,CAAC,CAAC;KAAE;IAExC,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IAEjC,MAAM,CAAC,GAAG,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,MAAM,CAAC,GAAG,YAAY,CAAE,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAE,CAAC;IAEvD,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACtB,CAAC;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PointOnShape } from "./point-on-shape.js";
|
|
2
|
+
/**
|
|
3
|
+
* Compares two [[PointOnShape]]s according to their cyclic ordering imposed
|
|
4
|
+
* by their relative positions on the shape boundary.
|
|
5
|
+
* @param a The first [[PointOnShape]].
|
|
6
|
+
* @param b The second [[PointOnShape]].
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
declare function comparePoss(a: PointOnShape, b: PointOnShape): number;
|
|
10
|
+
export { comparePoss };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compares two [[PointOnShape]]s according to their cyclic ordering imposed
|
|
3
|
+
* by their relative positions on the shape boundary.
|
|
4
|
+
* @param a The first [[PointOnShape]].
|
|
5
|
+
* @param b The second [[PointOnShape]].
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
function comparePoss(a, b) {
|
|
9
|
+
let res;
|
|
10
|
+
res = a.curve.idx - b.curve.idx;
|
|
11
|
+
if (res !== 0) {
|
|
12
|
+
return res;
|
|
13
|
+
}
|
|
14
|
+
res = a.t - b.t;
|
|
15
|
+
return res;
|
|
16
|
+
}
|
|
17
|
+
export { comparePoss };
|
|
18
|
+
//# sourceMappingURL=compare-poss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare-poss.js","sourceRoot":"","sources":["../../src/point-on-shape/compare-poss.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,SAAS,WAAW,CACZ,CAAe,EACf,CAAe;IAEnB,IAAI,GAAG,CAAC;IAER,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;IAChC,IAAI,GAAG,KAAK,CAAC,EAAE;QAAE,OAAO,GAAG,CAAC;KAAE;IAE9B,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAEhB,OAAO,GAAG,CAAC;AACf,CAAC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { evalDeCasteljauDd } from "flo-bezier3";
|
|
2
|
+
function createPos(curve, t, source) {
|
|
3
|
+
return {
|
|
4
|
+
curve,
|
|
5
|
+
t,
|
|
6
|
+
p: evalDeCasteljauDd(curve.ps, [0, t]).map(c => c[1]),
|
|
7
|
+
// angle
|
|
8
|
+
source
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export { createPos };
|
|
12
|
+
//# sourceMappingURL=create-pos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-pos.js","sourceRoot":"","sources":["../../src/point-on-shape/create-pos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAK/C,SAAS,SAAS,CACV,KAAY,EACZ,CAAS,EACT,MAAe;IAEnB,OAAO;QACH,KAAK;QACL,CAAC;QACD,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACpD,QAAQ;QACR,MAAM;KACT,CAAA;AACL,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Circle } from '../geometry/circle.js';
|
|
2
|
+
import { PointOnShape } from './point-on-shape.js';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the osculating circle at this point of the curve.
|
|
5
|
+
* @param maxOsculatingCircleRadius If not Number.POSITIVE_INFINITY then the
|
|
6
|
+
* circle radius will be limited to this value.
|
|
7
|
+
* @param pos The [[PointOnShape]] identifying the point.
|
|
8
|
+
*/
|
|
9
|
+
declare function getOsculatingCircle(minCurvature: number, pos: PointOnShape, useMaxRadius?: boolean): Circle;
|
|
10
|
+
export { getOsculatingCircle };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { tangentExact, ddCurvature } from 'flo-bezier3';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the osculating circle at this point of the curve.
|
|
4
|
+
* @param maxOsculatingCircleRadius If not Number.POSITIVE_INFINITY then the
|
|
5
|
+
* circle radius will be limited to this value.
|
|
6
|
+
* @param pos The [[PointOnShape]] identifying the point.
|
|
7
|
+
*/
|
|
8
|
+
function getOsculatingCircle(minCurvature, pos, useMaxRadius = false) {
|
|
9
|
+
const ps = pos.curve.ps;
|
|
10
|
+
const { p, t } = pos;
|
|
11
|
+
let k = -ddCurvature(ps, t);
|
|
12
|
+
if (k < minCurvature || useMaxRadius) {
|
|
13
|
+
k = minCurvature;
|
|
14
|
+
}
|
|
15
|
+
const tangent_ = tangentExact(ps, t).map(c => c[c.length - 1]);
|
|
16
|
+
const normal_ = [-tangent_[1], tangent_[0]];
|
|
17
|
+
const l = Math.sqrt(normal_[0] ** 2 + normal_[1] ** 2);
|
|
18
|
+
const circleCenter = [
|
|
19
|
+
p[0] - normal_[0] / (k * l),
|
|
20
|
+
p[1] - normal_[1] / (k * l)
|
|
21
|
+
];
|
|
22
|
+
return { center: circleCenter, radius: 1 / k };
|
|
23
|
+
}
|
|
24
|
+
export { getOsculatingCircle };
|
|
25
|
+
//# sourceMappingURL=get-osculating-circle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-osculating-circle.js","sourceRoot":"","sources":["../../src/point-on-shape/get-osculating-circle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAMxD;;;;;GAKG;AACH,SAAS,mBAAmB,CACpB,YAAoB,EACpB,GAAiB,EACjB,YAAY,GAAG,KAAK;IAExB,MAAM,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;IACxB,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,GAAG,CAAC;IAErB,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAE5B,IAAI,CAAC,GAAG,YAAY,IAAI,YAAY,EAAE;QAClC,CAAC,GAAG,YAAY,CAAC;KACpB;IAED,MAAM,QAAQ,GAAG,YAAY,CAAC,EAAE,EAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,IAAE,CAAC,CAAC,CAAC;IACnD,MAAM,YAAY,GAAG;QACjB,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,GAAC,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,GAAC,CAAC,CAAC;KAC1B,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,GAAC,CAAC,EAAE,CAAC;AACjD,CAAC;AAGD,OAAO,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-pos-corner.js","sourceRoot":"","sources":["../../src/point-on-shape/get-pos-corner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKnD;;GAEG;AACH,SAAS,YAAY,CAAC,GAAiB;IACnC,OAAO,cAAc,CACjB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAC3C,CAAC;AACN,CAAC;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-pos-corner.js","sourceRoot":"","sources":["../../src/point-on-shape/is-pos-corner.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,SAAS,WAAW,CAAC,GAAiB;IAClC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,CAAC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { memoize } from "flo-memoize";
|
|
2
|
+
import { getPosCorner } from "./get-pos-corner.js";
|
|
3
|
+
import { isPosCorner } from "./is-pos-corner.js";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
const isPosDullCorner = memoize((pos) => {
|
|
8
|
+
if (!isPosCorner(pos)) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
return getPosCorner(pos).isDull;
|
|
12
|
+
});
|
|
13
|
+
export { isPosDullCorner };
|
|
14
|
+
//# sourceMappingURL=is-pos-dull-corner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-pos-dull-corner.js","sourceRoot":"","sources":["../../src/point-on-shape/is-pos-dull-corner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD;;GAEG;AACH,MAAM,eAAe,GAAG,OAAO,CAAC,CAAC,GAAiB,EAAE,EAAE;IAClD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;QAAE,OAAO,KAAK,CAAC;KAAE;IAExC,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;AACpC,CAAC,CAAC,CAAC;AAGH,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { memoize } from 'flo-memoize';
|
|
2
|
+
import { isPosCorner } from './is-pos-corner.js';
|
|
3
|
+
import { getPosCorner } from './get-pos-corner.js';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
const isPosQuiteSharpCorner = memoize((pos) => {
|
|
8
|
+
if (!isPosCorner(pos)) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
return getPosCorner(pos).isQuiteSharp;
|
|
12
|
+
});
|
|
13
|
+
export { isPosQuiteSharpCorner };
|
|
14
|
+
//# sourceMappingURL=is-pos-quite-sharp-corner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-pos-quite-sharp-corner.js","sourceRoot":"","sources":["../../src/point-on-shape/is-pos-quite-sharp-corner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD;;GAEG;AACH,MAAM,qBAAqB,GAAG,OAAO,CAAC,CAAC,GAAiB,EAAE,EAAE;IACxD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;QAAE,OAAO,KAAK,CAAC;KAAE;IAExC,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC;AAC1C,CAAC,CAAC,CAAC;AAGH,OAAO,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { memoize } from "flo-memoize";
|
|
2
|
+
import { getPosCorner } from "./get-pos-corner.js";
|
|
3
|
+
import { isPosCorner } from "./is-pos-corner.js";
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
const isPosSharpCorner = memoize((pos) => {
|
|
8
|
+
if (!isPosCorner(pos)) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
return getPosCorner(pos).isSharp;
|
|
12
|
+
});
|
|
13
|
+
export { isPosSharpCorner };
|
|
14
|
+
//# sourceMappingURL=is-pos-sharp-corner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-pos-sharp-corner.js","sourceRoot":"","sources":["../../src/point-on-shape/is-pos-sharp-corner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIjD;;GAEG;AACH,MAAM,gBAAgB,GAAG,OAAO,CAAC,CAAC,GAAiB,EAAE,EAAE;IACnD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;QAAE,OAAO,KAAK,CAAC;KAAE;IAExC,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;AACrC,CAAC,CAAC,CAAC;AAGH,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Curve } from '../curve/curve.js';
|
|
2
|
+
interface PointOnShape {
|
|
3
|
+
/** The [[ICurve]] on the shape boundary this points belong to. */
|
|
4
|
+
curve: Curve;
|
|
5
|
+
/** The bezier parameter value on the curve identifying the point coordinates. */
|
|
6
|
+
t: number;
|
|
7
|
+
p: number[];
|
|
8
|
+
/** just for debugging */
|
|
9
|
+
source: boolean;
|
|
10
|
+
}
|
|
11
|
+
export { PointOnShape };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point-on-shape.js","sourceRoot":"","sources":["../../src/point-on-shape/point-on-shape.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a human-readable string of the given [[PointOnShape]].
|
|
3
|
+
* For debugging only.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
function posToHumanString(pos) {
|
|
7
|
+
return '' + pos.p[0] + ', ' + pos.p[1] +
|
|
8
|
+
' | bz: ' + pos.curve.idx +
|
|
9
|
+
' | t: ' + pos.t;
|
|
10
|
+
}
|
|
11
|
+
export { posToHumanString };
|
|
12
|
+
//# sourceMappingURL=pos-to-human-string.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pos-to-human-string.js","sourceRoot":"","sources":["../../src/point-on-shape/pos-to-human-string.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,GAAiB;IACvC,OAAO,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,SAAS,GAAK,GAAG,CAAC,KAAK,CAAC,GAAG;QAC3B,QAAQ,GAAM,GAAG,CAAC,CAAC,CAAA;AAC3B,CAAC;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-debug-info.js","sourceRoot":"","sources":["../../src/sat/add-debug-info.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,SAAS,YAAY,CACnB,GAAQ,EACR,WAAmB;IAEpB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QAAE,OAAO;KAAE;IAE/C,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEtC,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC;IACxC,MAAM,CAAC,IAAI,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,WAAW,CAAC;AAC/C,CAAC;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CpNode } from '
|
|
1
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @internal
|
|
4
4
|
* Cull all edges not part of a cycle in the MAT planar graph.
|
|
5
5
|
* @param cpStart The start CpNode which must reprsesent the maximal 3-prong
|
|
6
6
|
* vertex.
|
|
7
7
|
*/
|
|
8
|
-
declare function cullNonCycles(cpStart: CpNode): CpNode;
|
|
8
|
+
declare function cullNonCycles(cpStart: CpNode): CpNode | undefined;
|
|
9
9
|
export { cullNonCycles };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getLeaves } from '
|
|
2
|
-
import {
|
|
1
|
+
import { getLeaves } from './get-leaves.js';
|
|
2
|
+
import { getProngCount, isOnSameCircle, isTerminating } from '../cp-node/cp-node.js';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @internal
|
|
5
5
|
* Cull all edges not part of a cycle in the MAT planar graph.
|
|
6
6
|
* @param cpStart The start CpNode which must reprsesent the maximal 3-prong
|
|
7
7
|
* vertex.
|
|
@@ -20,11 +20,11 @@ function cullNonCycles(cpStart) {
|
|
|
20
20
|
cpNode = cpNode.next;
|
|
21
21
|
let cut = false;
|
|
22
22
|
const cp1 = cpNode.prevOnCircle;
|
|
23
|
-
if (
|
|
23
|
+
if (getProngCount(cpNode) > 2) {
|
|
24
24
|
//const cp2 = cp1.prevOnCircle;
|
|
25
25
|
const cp2 = cpNode.nextOnCircle;
|
|
26
26
|
//if (cpStart === cpNode || cpStart === cp1 || cpStart === cp2) {
|
|
27
|
-
if (
|
|
27
|
+
if (isOnSameCircle(cpNode, cpStart)) {
|
|
28
28
|
cut = true; // We are at the max disk - cut whole edge
|
|
29
29
|
}
|
|
30
30
|
else if (cpNode.next === cp2) {
|
|
@@ -34,7 +34,7 @@ function cullNonCycles(cpStart) {
|
|
|
34
34
|
cut = true; // Cut whole edge
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
else if (
|
|
37
|
+
else if (isTerminating(cpNode) && !cpNode.isIntersection) {
|
|
38
38
|
cpNodeKept = cpNode;
|
|
39
39
|
return undefined;
|
|
40
40
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cull-non-cycles.js","sourceRoot":"","sources":["../../src/sat/cull-non-cycles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAU,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG7F;;;;;GAKG;AACH,SAAS,aAAa,CAAC,OAAe;IAElC,IAAI,UAAU,GAAG,OAAO,CAAC;IAEzB,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAGlC,OAAO,MAAM,CAAC,MAAM,EAAE;QAClB,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,EAAG,CAAC;QAE3B,mCAAmC;QACnC,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,cAAc,EAAE;YAAE,SAAS;SAAE;QAE5D,IAAI,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,cAAc;QAEtC,OAAO,IAAI,EAAE;YACT,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;YACrB,IAAI,GAAG,GAAG,KAAK,CAAC;YAChB,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC;YAEhC,IAAI,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;gBAC3B,+BAA+B;gBAC/B,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC;gBAEhC,iEAAiE;gBACjE,IAAI,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;oBACjC,GAAG,GAAG,IAAI,CAAC,CAAC,0CAA0C;iBACzD;qBAAM,IAAI,MAAM,CAAC,IAAI,KAAK,GAAG,EAAE;oBAC5B,MAAM,GAAG,GAAG,CAAC;iBAChB;qBAAM,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,EAAE;oBACzB,GAAG,GAAG,IAAI,CAAC,CAAC,iBAAiB;iBAChC;aACJ;iBAAM,IAAI,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE;gBACxD,UAAU,GAAG,MAAM,CAAC;gBACpB,OAAO,SAAS,CAAC;aACpB;YAED,IAAI,GAAG,EAAE;gBACL,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC;gBAClB,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC;gBAElB,UAAU,GAAG,MAAM,CAAC;gBACpB,MAAM;aACT;SACJ;KACJ;IAED,OAAO,UAAU,CAAC;AACtB,CAAC;AAGD,OAAO,EAAE,aAAa,EAAE,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Circle } from '
|
|
2
|
-
import { CpNode } from '
|
|
1
|
+
import { Circle } from '../geometry/circle.js';
|
|
2
|
+
import { CpNode } from '../cp-node/cp-node.js';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @internal
|
|
5
5
|
* Returns the set of Vertices passing the following test: walk the MAT tree and
|
|
6
6
|
* keep all Vertices not in the current cull set and any Vertices that have a
|
|
7
7
|
* non-culled node further down the line toward the tree leaves.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getLeaves } from '
|
|
2
|
-
import {
|
|
1
|
+
import { getLeaves } from './get-leaves.js';
|
|
2
|
+
import { isOnSameCircle } from '../cp-node/cp-node.js';
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @internal
|
|
5
5
|
* Returns the set of Vertices passing the following test: walk the MAT tree and
|
|
6
6
|
* keep all Vertices not in the current cull set and any Vertices that have a
|
|
7
7
|
* non-culled node further down the line toward the tree leaves.
|
|
@@ -39,7 +39,7 @@ function cull(culls, maxCpNode) {
|
|
|
39
39
|
// Cut off the edge once a non-cull has been reached.
|
|
40
40
|
cut = true;
|
|
41
41
|
}
|
|
42
|
-
else if (
|
|
42
|
+
else if (isOnSameCircle(cpNode, maxCpNode)) {
|
|
43
43
|
cut = true; // We are at the max disk - cut whole edge
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cull.js","sourceRoot":"","sources":["../../src/sat/cull.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAU,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG/D;;;;;;;GAOG;AACH,SAAS,IAAI,CACL,KAAkB,EAClB,SAAiB;IAErB,MAAM,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;IAEpC,SAAS,kBAAkB,CAAC,OAAe;QAC7C,IAAI,EAAE,GAAG,OAAO,CAAC;QAEX,MAAM,GAAG,GAAa,EAAE,CAAC;QAC/B,GAAG;YACO,IAAI,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,YAAY,EAAE;gBAC7B,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;aAChB;YACV,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC;SACrB,QAAQ,EAAE,KAAK,OAAO,CAAC,YAAY,EAAC;QAErC,OAAO,GAAG,CAAC;IACT,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,EAAE;QAClB,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,EAAG,CAAC;QAE3B,qBAAqB;QACrB,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,cAAc,EAAE;YAAE,SAAS;SAAE;QAE5D,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YAC5B,SAAS;SACZ;QAED,IAAI,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,cAAc;QAEtC,OAAO,IAAI,EAAE;YACT,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC;YACrB,IAAI,GAAG,GAAG,KAAK,CAAC;YAChB,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC;YAEhC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;gBAC9B,qDAAqD;gBACrD,GAAG,GAAG,IAAI,CAAC;aACd;iBAAM,IAAI,cAAc,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE;gBAC1C,GAAG,GAAG,IAAI,CAAC,CAAC,0CAA0C;aACzD;iBAAM;gBACH,MAAM,GAAG,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;gBAEvC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;oBAClB,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;iBACnB;qBAAM;oBACH,GAAG,GAAG,IAAI,CAAC;iBACd;aACJ;YAED,IAAI,GAAG,EAAE;gBACL,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC;gBAClB,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC;gBAClB,MAAM;aACT;SACJ;KACJ;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqEE;AAGF,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getAllOnLoop, isTerminating } from '../cp-node/cp-node.js';
|
|
2
|
+
/** @internal */
|
|
3
|
+
function getLeaves(cpNode) {
|
|
4
|
+
const leaves = [];
|
|
5
|
+
const cps = getAllOnLoop(cpNode);
|
|
6
|
+
cps.forEach(function (cp) {
|
|
7
|
+
if (isTerminating(cp)) {
|
|
8
|
+
leaves.push(cp);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
return leaves;
|
|
12
|
+
}
|
|
13
|
+
export { getLeaves };
|
|
14
|
+
//# sourceMappingURL=get-leaves.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-leaves.js","sourceRoot":"","sources":["../../src/sat/get-leaves.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG5E,gBAAgB;AAChB,SAAS,SAAS,CAAC,MAAc;IAC7B,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,MAAM,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACjC,GAAG,CAAC,OAAO,CAAC,UAAS,EAAE;QACnB,IAAI,aAAa,CAAC,EAAE,CAAC,EAAE;YACnB,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACnB;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Mat } from '
|
|
2
|
-
/** @
|
|
1
|
+
import { Mat } from '../mat/mat.js';
|
|
2
|
+
/** @internal */
|
|
3
3
|
/**
|
|
4
4
|
* Apply and returns an enhanced version of the Scale Axis Transform (SAT) to
|
|
5
5
|
* the given MAT. The returned SAT is guaranteed to be a subset of the MAT and
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { length } from 'flo-bezier3';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
2
|
+
import { getCpNodesOnCircle } from '../cp-node/cp-node.js';
|
|
3
|
+
import { traverseEdges } from '../cp-node/traverse-edges.js';
|
|
4
|
+
import { traverseVertices } from '../cp-node/traverse-vertices.js';
|
|
5
|
+
import { getLargestVertex } from '../mat/get-largest-vertex.js';
|
|
6
|
+
import { getLeaves } from './get-leaves.js';
|
|
7
|
+
import { cull } from './cull.js';
|
|
8
|
+
import { addDebugInfo } from './add-debug-info.js';
|
|
9
|
+
import { clone } from '../cp-node/clone.js';
|
|
10
|
+
import { getCurveToNext } from '../cp-node/get-curve-to-next.js';
|
|
10
11
|
function linearScale(s) {
|
|
11
12
|
return function (r) {
|
|
12
13
|
return s * r;
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
|
-
/** @
|
|
16
|
+
/** @internal */
|
|
16
17
|
//let len = length([0,1]);
|
|
17
18
|
/**
|
|
18
19
|
* Apply and returns an enhanced version of the Scale Axis Transform (SAT) to
|
|
@@ -55,7 +56,7 @@ function toScaleAxis(mat, s, f = linearScale) {
|
|
|
55
56
|
const r = cpNode_.cp.circle.radius;
|
|
56
57
|
const r_ = f_(r);
|
|
57
58
|
if (R - l > r_) {
|
|
58
|
-
for (const cpNode of
|
|
59
|
+
for (const cpNode of getCpNodesOnCircle(cpNode_)) {
|
|
59
60
|
rMap.set(cpNode, R - l); // Update osculating radii
|
|
60
61
|
}
|
|
61
62
|
culls.add(cpNode_.cp.circle);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-scale-axis.js","sourceRoot":"","sources":["../../src/sat/to-scale-axis.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,OAAO,EAAU,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAGnE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGjE,SAAS,WAAW,CAAC,CAAS;IAC7B,OAAO,UAAS,CAAS;QACxB,OAAO,CAAC,GAAC,CAAC,CAAC;IACZ,CAAC,CAAA;AACF,CAAC;AAGD,gBAAgB;AAChB,0BAA0B;AAG1B;;;;;;;;;;;GAWG;AACH,SAAS,WAAW,CAClB,GAAQ,EACR,CAAS,EACT,IAA0C,WAAW;IAEtD,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QACnC,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACrC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC5C;IAED,6DAA6D;IAC7D,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,gBAAgB,CACf,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EACjB,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CACnC,CAAC;IAEF,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QACnC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC/C;IAED;;;OAGG;IACH,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IAErC,MAAM,IAAI,GAAuB,IAAI,GAAG,EAAE,CAAC;IAE3C,aAAa,CAAC,MAAM,EAAE,UAAS,MAAM;QACpC,qDAAqD;QACrD,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAE1D,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;QAE5B,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;QAEhD,MAAM,CAAC,GAAG,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;QACnC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACjB,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE;YACf,KAAK,MAAM,MAAM,IAAI,kBAAkB,CAAC,OAAO,CAAC,EAAE;gBACjD,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,0BAA0B;aACnD;YACD,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;SAC7B;IACF,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAEpB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QACnC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;KACtD;IAED,uDAAuD;IACvD,gEAAgE;IAChE,MAAM,GAAG,GAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,SAAU,EAAE,CAAC;IAEjD,YAAY,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAE/B,OAAO,GAAG,CAAC;AACZ,CAAC;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|