I have drawn a blob using hobby following this question and would like to add an arrow denoting the span of my blob. I have tried following the answer to this question to no avail because the bounding box created by scope appears to include the construction of the blob. My current workaround is to eyeball it and use intersections based on this question but this is clearly a scrappy approach and something more repeatable would be better. Thank you for any help.
Here are my first two attempts:
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows, positioning, shapes.misc, arrows.meta}
\usepackage{amsmath, xcolor}
\usetikzlibrary{backgrounds}
\usetikzlibrary{bending, decorations.markings}
\usetikzlibrary{hobby, calc, intersections}
\begin{document}
\begin{tikzpicture}[scale=1, line width=2pt]
% range 1, first attempt with bounding box
\node (r1-1) at (4,5) {.};
\node (r1-2) at (1,4) {.};
\node (r1-3) at (1,6) {.};
\node (r1-4) at (3,9) {.};
\node (r1-5) at (7,10) {.};
\node (r1-6) at (8,7) {.};
\begin{scope}[local bounding box=foo]
\draw[fill=gray, opacity=0.15] (r1-1) to [closed, curve through = {(r1-2) (r1-3) (r1-4) (r1-5) (r1-6)}] (r1-1);
\end{scope}
\draw[color=blue, line width=1pt] (foo.north east) rectangle (foo.south west);
% range 2, scrappy workaround
\node (r2-1) at (14,5) {.};
\node (r2-2) at (11,4) {.};
\node (r2-3) at (11,6) {.};
\node (r2-4) at (13,9) {.};
\node (r2-5) at (17,10) {.};
\node (r2-6) at (18,7) {.};
\node[orange] (top) at (20,10.21) {};
\node[orange] (bottom) at (20,3.8) {};
\draw[fill=gray, opacity=0.15, name path=range] (r2-1) to [closed, curve through = {(r2-2) (r2-3) (r2-4) (r2-5) (r2-6)}] (r2-1);
\path[name path=AA,overlay] (top) -- +(-20,0);
\draw[name intersections={of=range and AA},orange] (intersection-2) -- (top);
\path[name path=BB,overlay] (bottom) -- +(-20,0);
\draw[name intersections={of=range and BB},orange] (intersection-2) -- (bottom);
\end{tikzpicture}
\end{document}
bbox
library can help find the proper bounding box or curves which doesn't contain the control points.find bb touches
method so have accepted that answer. (and you were correct about my wanting the lines to be tangential)