Consider the following:
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[line width = 4]
\coordinate (a) at (0,0);
\coordinate (b) at (1,0);
\coordinate (c) at (1,1);
\draw (a) -- (intersection of a--b and b--c);
\draw (c) -- (intersection of a--b and b--c);
\end{tikzpicture}
\end{document}
Which produces:
How can I fill the corner? Adding [cap=rounded]
didn't solve the issue. I know that I could do something like \draw (a) -- (b) -- (c)
but I need to obtain the same effect using intersection.
Thanks!
EDIT 1: I try to figure out how to handle two independent line segments and their intersection. For example:
\begin{tikzpicture}[scale=4,line width=7]
\coordinate (a1) at (0,0);
\coordinate (b1) at (1,1);
\coordinate (b2) at (1,-1);
\draw (b1) -- (b2);
\foreach \x in {0,20,30,40,45}
{
\coordinate (a2) at (\x:10);
\draw (a1) -- (intersection of a1--a2 and b1--b2);
}
\end{tikzpicture}
Here, I don't know in advance (well I do, but for the sake of the question I don't), where the two segments intersect and whether or not the intersection point is a common end point.
line cap=rect
to make it look right. – Andrew Stacey May 20 '11 at 7:30