I would like to draw a relatively thick Bézier curve that goes all the way to the edge of a rectangle. In the MWE below, the eventual clipping boundary is represented by the drawn rectangle.
I like the shape of the curve from (0,10) to (20,30), but I want that small remaining triangle to be filled in as well. I found the ([turn]...) syntax which works well for the end of the curve, but can't work for the start of the curve.
My kludgy solution is to draw the curve twice, once starting from the top and once starting from the bottom, but seems like there must be a better way.
In actual use, these curves aren't simply from points like in the MWE but are parameterized relative to other dimensions of the image, which is why I don't want to manually calculate the tangent line and hardcode the numbers in.
EDIT: I realize I may be asking for a particular solution to the problem instead of just the easiest. If there is a way to "straight" extend a path that doesn't involve ([turn]...) or tangents, I'm open to that solution as well. (Although the original question is interesting to me even so.)
\documentclass[tikz, margin=1cm]{standalone}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\draw (0, 0) rectangle (30, 30);
\draw[line width=1.333cm, line cap=rect] (0, 10) .. controls ($(0, 10)!0.333!(20, 30) + (-1, 1)$) and ($(0, 10)!0.666!(20, 30) + (-1, 1)$) .. (20, 30);
\draw[green, opacity=0.25, line width=1.333cm, line cap=rect] (0, 10) .. controls ($(0, 10)!0.333!(20, 30) + (-1, 1)$) and ($(0, 10)!0.666!(20, 30) + (-1, 1)$) .. (20, 30) -- ([turn]0:2);
\draw[blue, opacity=0.25, line width=1.333cm, line cap=rect] (20, 30) .. controls ($(0, 10)!0.666!(20, 30) + (-1, 1)$) and ($(0, 10)!0.333!(20, 30) + (-1, 1)$) .. (0, 10) -- ([turn]0:2);
\draw[red] (0, 10) -- ($(0, 10)!0.333!(20, 30) +(-1, 1)$) -- ($(0, 10)!0.666!(20, 30) + (-1, 1)$) -- (20, 30);
\end{tikzpicture}
\end{document}
EDIT 2: added arrows for clarity (sorry, I used Preview.app to add them, not TeX :P )
I would like the black line to extend far enough so it gets clipped "flat" by the rectangle and doesn't leave that small internal triangle.






[tangent=0, tangent=1], necessitating[tangent=0, tangent=0.99999]. As mentioned in the second link, adding one more "9" brings back the bug. – Scott Colby Nov 29 '18 at 00:41