
% root set
\DeclareDocumentCommand{\rs}{ O{1.1cm} O{->} m m O{0} O{0}} {
	\def \radius {#1}
	\def \inputPoints{#3}
	\def \excludeRoots{#4}
	\def \style {#2}
	\def \initialRotation {#5}
	\def \extraStyle {#6}
	
	
	% Number of points
	\pgfmathtruncatemacro{\points}{\inputPoints * 2}
	\pgfmathsetmacro{\degrees}{360 / \points}
	
	\coordinate (0) at (0,0);
	
	% setup the coordinates
	\foreach \x in {1,...,\points}{%
		% Where our node is going to be
		\pgfmathsetmacro{\location}{(\points+(\x-1))*\degrees + \initialRotation}
		
		\coordinate (\x) at (\location:\radius);
	}
	
	
	%setup the vertices
	\ifthenelse{\equal{\excludeRoots}{}}{
		\foreach \x in {1,...,\points}{%
			\ifthenelse{\equal{\extraStyle}{0}}{
				\draw[\style] (0) -- (\x);
			}{
			\draw[\style, \extraStyle] (0) -- (\x);
		}
	}
}{
\foreach \x in {1,...,\points}{%
	\edef \showPoint {1};
	
	\foreach \y in \excludeRoots {
		\ifthenelse{\equal{\x}{\y}}{
			\xdef \showPoint {0};
		}{}
	}
	
	\ifthenelse{\equal{\showPoint}{1}}{
		\ifthenelse{\equal{\extraStyle}{0}}{
			\draw[\style] (0) -- (\x);
		}{
		\draw[\style, \extraStyle] (0) -- (\x);
	}
}{}
}
}  
}


\centerline{
    \begin{tikzpicture}
	    [
	    fdomain/.style={fill=blue!15!white,color=blue!15!white,opacity=0.3},
	    vdomain/.style={color=blue!85!white},
	    face/.style={draw=red!95!black,fill=red!95!black,color=red!95!black,ultra thick, -},
	    vertex/.style={inner sep=1pt,circle,draw=green!85!white,fill=green!85!white,thick},
	    vtext/.style={color=green!55!black},
	    ]
	    %
	    %
	    %
	    % Add hyperplanes
        \rs[3.5][ultra thick]{4}{}[22.5]
	    \node[above left] at (2) {$H_{2}$};
	    \node[above right] at (3) {$H_{1}$};
        \rs[3][dashed]{4}{}[22.5]
        \draw[face] (0) -- (7) node[right] {$Y$};
        \draw[face] (0) -- (6) node[left] {$X$};
	    %
	    %
	    % Add fundamental domain
	    \fill[fdomain] (0) -- (6) -- (7) -- cycle {};
%        \node[vdomain] at (90:2.2) {$W^{(2)}$};
	    \node[] at (180:2.2) {$\vdots$};
	    \node[] at (0:2.2) {$\vdots$};
	     \node[vdomain] at (270:2.2) {$B=Z$};
	    %
	    \node[vertex] at (0) {};
        \node[vtext] at (0:1.2) {$0 = X \cap Y$};
    \end{tikzpicture}
}
