# How to draw hemisphere over cube accurately in tikz?

MWE

\documentclass[border=3mm]{standalone}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[thick]
\draw[](0,0,0)
-- ++(3,0,0)
-- ++(0,3,0)
-- ++(-3,0,0)
-- cycle;
\draw[dashed] (0,0,-3) -- ++(3,0,0);
\draw[dashed] (0,0,-3) -- ++(0,3,0);
\draw[] (3,0,-3) -- ++(0,3,0);
\draw[] (0,3,-3) -- ++(3,0,0);
\draw[dashed] (0,0,0) -- ++(0,0,-3);
\draw[] (0,3,0) -- ++(0,0,-3);
\draw[] (3,0,0) -- ++(0,0,-3);
\draw[] (3,3,0) -- ++(0,0,-3);

\begin{scope}[shift={(45:1)},yshift=3cm]
\draw [thick,dashed] (0,0) arc (180:360:1.5cm and -0.45cm);
\draw [thick] (0,0) arc (180:360:1.5cm and 0.45cm);
\draw [thick] (0,0) arc (180:360:1.5cm and -1.5cm);
\end{scope}

\end{tikzpicture}
\end{document}


Using tikz-3dplot, following output can be generated.

\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}

\begin{document}
\tdplotsetmaincoords{60}{110}

\pgfmathsetmacro{\thetavec}{0}
\pgfmathsetmacro{\phivec}{0}

\begin{tikzpicture}[scale=3,tdplot_main_coords]
\tdplotsetthetaplanecoords{\phivec}
\draw[](0,0,0)
-- cycle;