tikzlibraryangles.code.tex
contains
\def\tikz@lib@rightangle@background#1--#2--#3\pgf@stop{%
\path [name prefix ..] [pic actions, draw=none] (#2.center)
-- ++(\tikz@start@angle@temp:\tikz@lib@angle@rad pt)
-- ++(\tikz@end@angle@temp:\tikz@lib@angle@rad pt)
-- ++(\tikz@start@angle@temp:-\tikz@lib@angle@rad pt)
-- cycle;
}%
from which you see that it attaches .center
to the second coordinate #2
. This does not work if #2
is already an anchor. To work around this problem (rather than redefining \tikz@lib@rightangle@background
and the other commands that attach .center
), you may just define auxiliary coordinates.
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{angles}
\usetikzlibrary{shapes}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
\node[name=S,regular polygon,
regular polygon sides=9, draw, minimum width=6cm] at (0,0) {};
\path foreach \X in {1,...,9} {(S.corner \X) coordinate (corner \X)};
\pic [draw, angle radius=.6cm] {angle = corner 1--corner 6--corner 5};
\end{tikzpicture}
\end{document}
\pic
command, but\draw (S.corner 1) -- (S.corner 6);
works fine with your example.