A \node does understand a kind of a clip of its path, the path picture (which actually exists for every path).
This is great if you want to create a node shape without defining a new shape.
The path picture key provides a path picture bounding box pseudo-node that is installed only for the path picture and has the properties of a rectangular node (it is a node of the shape rectangle).
Both a blessing and a curse, it inherits every property of the parental node.
It is a blessing for defining variations of the diamond shape that simply inherits the color information of its parent.
It is a curse for such complexity that you would have with the last example of percusse’s answer. The line width as well as the minimum width and height do need to be reset. The additional \pgftransformreset is needed as the local coordinate system has its center in the center of the path picture/node.
Code
\documentclass[tikz,convert=false]{standalone}
\usetikzlibrary{shapes.callouts,shapes.geometric}
\tikzset{
left diamond/.style={shape=diamond,
path picture={\fill[#1] (path picture bounding box.south west) rectangle
(path picture bounding box.north);}},
right diamond/.style={shape=diamond,
path picture={\fill[#1] (path picture bounding box.south east) rectangle
(path picture bounding box.north);}},
square diamond/.style={shape=diamond,
path picture={
\path (path picture bounding box.south west) --
(path picture bounding box.north east) coordinate[pos=.15] (@aux1)
coordinate[pos=.85] (@aux2);
\fill[#1] (@aux1) rectangle (@aux2);}},
stripe diamond/.style={shape=diamond,
path picture={
\path (path picture bounding box.south west) --
(path picture bounding box.north west) coordinate[near start] (@aux1)
coordinate[near end] (@aux2);
\fill[#1] (@aux1) rectangle (path picture bounding box.north east |- @aux2);}}}
\begin{document}
\begin{tikzpicture}[every diamond node/.append style={draw,minimum size=+1cm}]
\matrix[row sep=.5cm,column sep=.5cm] {
\node[diamond] {}; & \node[left diamond] {}; \\
\node[left diamond, green] {}; & \node[right diamond=red, blue] {}; \\
\node[square diamond] {}; & \node[stripe diamond] {}; \\
};
\end{tikzpicture}
\begin{tikzpicture}
\draw[top color= black!50] (-2,-2) rectangle (5,4);
\node[
shape=cloud callout,
draw,
fill=white,
minimum width=5cm,
minimum height=3cm,
line width=1mm,
anchor=center,
path picture={
\pgftransformreset
\fill[red] (0cm,0cm) rectangle (1.5cm, 1.5cm);
\fill[yellow] (2cm,2cm) circle (1cm);
\node[fill=blue,rotate=90,isosceles triangle,draw,
thin,minimum width=0pt,minimum height=1.5cm] at (2.5cm,1cm) {};
}
] (nodename) at (1.5cm, 1.5cm) {};
\node[align=center,draw,anchor=north west] (a) at (nodename.pointer) {Geometric\\Thinker};
\end{tikzpicture}
\end{document}
Output


\pgf...commands to build the node but the rest can keep TikZ syntax. Is it the rectangle's position relative to the diamond that you want to change or you want to shift the scope ? – percusse Apr 26 '12 at 08:00(1.5,1.5). But the content of the clip is still on the original coordinate system. – percusse Apr 26 '12 at 11:04\drawclip (x,y) diamond (r)(if you used\drawclip (3,5) diamond (3) and \drawclip (3,5) circle (3)you would get a diamond shape(the diamond clip will clip the circle making a diamond)) The drawclip radius would be the maximum radius of the shape or just some scale parameter. – Uiy Apr 26 '12 at 20:17\documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes.callouts,shapes.geometric} \begin{document} \begin{tikzpicture} \draw[top color= black!50] (-2,-2) rectangle (5,4); \begin{scope} \pgfset{minimum width=1.5cm,minimum height=1.5cm} \pgftransformshift{\pgfpoint{2cm}{2cm}} \pgfnode{diamond}{center}{}{}{\pgfusepath{clip}} \pgftransformreset % Back to drawing \fill[yellow] (2cm,2cm) circle (0.65cm); \end{scope} \end{tikzpicture} \end{document}– Uiy Apr 26 '12 at 20:50