# pgfdeclareshape cannot access the north, east, west, south anchors

I am trying to declare a custom pgf shape. I have a problem that I cannot access the east, west, north, south anchors. This works:

\pgfdeclareshape{mixer}{%
\inheritsavedanchors[from=circle]
\inheritanchorborder[from=circle]
\inheritanchor[from=circle]{center}
\inheritanchor[from=circle]{north}
\inheritanchor[from=circle]{south}
\inheritanchor[from=circle]{west}
\inheritanchor[from=circle]{east}
\backgroundpath{%
\centerpoint \pgf@xa=\pgf@x \pgf@ya=\pgf@y
}
}


However, as soon as I try to use something like:

\northeast \pgf@xa=\pgf@x \pgf@ya=\pgf@y


or

\north \pgf@xa=\pgf@x \pgf@ya=\pgf@y


I get undefined command. Why is that?

• because circle shape doesn't have those saved anchors. They are just anchors that are calculated upon call. Dec 1 '16 at 18:49
• @percusse is there a way to access them from within \pgfdeclareshape? Dec 1 '16 at 22:15
• No because they don't exist until they are called. You have to define them yourself if need be Dec 1 '16 at 23:06
• @user110971 Suggestion: have you looked at TikZ pics? They are kinda like shapes, but much more simple. Declaring new shapes are (I'd say) not for the end-user, but pics are. You can set coordinates inside the pic which behave like node anchors... Maybe it's what you looking for: check this link. Dec 5 '16 at 15:21

You still have a chance: the definition of those anchors are hidden in

\pgf@anchor@⟨shape name⟩@⟨anchor name⟩


So \north can be retrieved by

\pgf@anchor@mixer@north


# Full code

\documentclass{article}
\usepackage{tikz}

\begin{document}
\makeatletter
\pgfdeclareshape{mixer}{%
\inheritsavedanchors[from=circle]
\inheritanchorborder[from=circle]
\inheritanchor[from=circle]{center}
\inheritanchor[from=circle]{north}
\inheritanchor[from=circle]{south}
\inheritanchor[from=circle]{west}
\inheritanchor[from=circle]{east}
\backgroundpath{%
\centerpoint