I have an example to explain my problem but if the code compiles and if I get a good result, I don't understand why !
The idea is to split a circle node like in this question . I want to fill the node with two colors.
It's not possible to use the same code but perhaps I'm wrong.
1) first with insert path, I think I can't use \tikzlastnode because this macro is not defined. \pgf@node@name seems to be defined only for multipart node.
2) I try with append after command but the code is strange. I need to use a scope with the background layer. But
\node[ circle,
draw=blue,
text=white,
font=\bfseries,
append after command={
\pgfextra{%
\pgfpointdiff{\pgfpointanchor{\tikzlastnode}{center}}%
{\pgfpointanchor{\tikzlastnode}{east}}%
\pgfmathsetmacro\insiderad{\pgf@x}
\begin{scope}[on background layer]
\fill[orange] (\tikzlastnode.center)
([xshift=\pgflinewidth]\tikzlastnode.west) arc
(180:360:\insiderad-\pgflinewidth);
\fill[red] (\tikzlastnode.center)
([xshift=-\pgflinewidth]\tikzlastnode.east) arc
(0:180:\insiderad-\pgflinewidth);
\end{scope}
}
},text opacity=1] (last name) {big label};
gives

and if I remove the scope environment, the same code
\fill[orange] (\tikzlastnode.center)
([xshift=\pgflinewidth]\tikzlastnode.west) arc
(180:360:\insiderad-\pgflinewidth);
\fill[red] (\tikzlastnode.center)
([xshift=-\pgflinewidth]\tikzlastnode.east) arc
(0:180:\insiderad-\pgflinewidth);
give a bad result too :

The only code correct seems to be :
\documentclass[11pt]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{shapes,backgrounds,calc}
\begin{document}
\makeatletter
\begin{tikzpicture}[line width=3mm]
\node[ circle,
draw=blue,
text=white,
font=\bfseries,
append after command={
\pgfextra{%
\pgfpointdiff{\pgfpointanchor{\tikzlastnode}{center}}%
{\pgfpointanchor{\tikzlastnode}{east}}%
\pgfmathsetmacro\insiderad{\pgf@x}
\fill[orange] (\tikzlastnode.center)
([xshift=\pgflinewidth]\tikzlastnode.west) arc
(180:360:\insiderad-\pgflinewidth);
\begin{scope}[on background layer]
\fill[red] (\tikzlastnode.center)
([xshift=-\pgflinewidth]\tikzlastnode.east) arc
(0:180:\insiderad-\pgflinewidth);
\end{scope}
}
},text opacity=1] (last name) {big label};
\end{tikzpicture}
\end{document}
and I get :

My question is why I need to use like this the scope. A second question is to know if there is another way to get the name of the last node than \pgf@node@name and \tikzlastnode.
Perhaps someone knows another method to get the same result.
Remark :
In the link (multipart node given above) I realized at the end that I could remove the environment scopebut it was a surprise for me. It seems that the text is placed at the end of the construction of the shape.


\behindbackgroundpath{}code – percusse May 14 '12 at 02:32\begin{scope}[on background layer]inside theappend after command. It's not satisfactory to have a code and do not understand. – Alain Matthes May 14 '12 at 06:56