In TikZ, is it possible to have paths smoothly join a node?

You can clip it with a shape and a circle.

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
\begin{scope}[] % clip is only valid inside this scope
\clip (-0.5,-0.5) rectangle (0.5,0.5) (0,0) circle(2);
\foreach\a in{0,10,...,350}{\draw[ultra thick] (0,0)--+(\a:1);}
\end{scope}
\end{tikzpicture}
\end{document}

enter image description here


Very similar to percusse's answer except that I do not draw the rectangle explicitly, i.e. if the node size changes, one does not have to adjust the dimensions of the rectangle.

\documentclass[tikz,border=2pt]{standalone}
\usetikzlibrary{backgrounds}
\begin{document}
\begin{tikzpicture}
   \node[red,draw=white, line width=1mm] at (0,0) (O) {} ;
   \begin{scope}[on background layer]
   \foreach \a in {0,10,...,360}
     {
     \draw (O.{\a}) to (\a:0.25) ;
     }
   \end{scope}   
\end{tikzpicture}
\end{document}

enter image description here


If you use a circular node, you get some sort of a nicer output

\documentclass[tikz,border=2pt]{standalone}
\begin{document}
\begin{tikzpicture}
   \node[circle] at (0,0) (O) {} ;
   \foreach \a in {0,10,...,360}
     {
     \draw (\a:0.25) to (O);
     }
\end{tikzpicture}
\end{document}

enter image description here

EDIT: The thing is that you are exactly attaching the lines to the node box, see below the with the red lines connecting to the black box.

\documentclass[tikz,border=2pt]{standalone}
\begin{document}
\begin{tikzpicture}
   \node[draw=black,outer sep=0pt] at (0,0) (O) {} ;
   \foreach \a in {0,10,...,360}
     {
     \draw[red] (\a:0.25) -- (O);
     }
\end{tikzpicture}
\end{document}

enter image description here

Tags:

Tikz Pgf