This question does not aim to explore something meaningful, but just for some interest.
Is there a way to use a pic
as a "tree node" directly? It means that I can reference the named node or coordinate in pic after the tree has been draw.
Consider following pic just for example:
\documentclass[tikz, border=1cm]{standalone}
\makeatletter
\tikzset{
test n/.store in=\test@n,
test n=3,
test/.pic={
\foreach \x [evaluate=\x as \ang using (\x-1)*360/\test@n] in {1, ..., \test@n} {
\draw (0, 0) -- (\ang:5mm) coordinate (-\x);
}
}
}
\makeatother
\begin{document}
\begin{tikzpicture}
\pic (a) [test n=6] {test};
\draw[red] (a-1) -- (a-2);
\end{tikzpicture}
\end{document}
I'd like to use this pic in several nodes of the tree and reference the coordinates such as (a-1)
after, is there a possible way to make it?