#Drawing 3D hemisphere on a plate

1 messages · Page 1 of 1 (latest)

brittle nymph
#

Hi! I'm wondering if somebody can save this situation haha. I'm just eyeballing stuff to make it look decent but I realize this method is probably not the way to go. Anybody know how to make this more workable? I have a plate that I want to draw a hemisphere on but the perspective stuff is making it super wonky. Thanks in advance.

\documentclass[tikz,border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{3d}

\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,x={(1cm,0cm)},y={(0.5cm,0.5cm)},z={(0cm,1cm)}]
    \def\thickness{0.2}
    \def\plateLength{4}
    \def\plateWidth{3}
    \def\plateCenterX{\plateLength * 0.5}
    \def\plateCenterY{\plateWidth * 0.5}

    % Top face
    \filldraw[fill=gray!20,opacity=0.5] (0,0,0) -- (\plateLength,0,0) -- (\plateLength,\plateWidth,0) -- (0,\plateWidth,0) -- cycle;
    % Front face
    \filldraw[fill=gray!30,opacity=0.5] (0,0,0) -- (\plateLength,0,0) -- (\plateLength,0,-\thickness) -- (0,0,-\thickness) -- cycle;
    % Side face
    \filldraw[fill=gray!40,opacity=0.5] (\plateLength,0,0) -- (\plateLength,\plateWidth,0) -- (\plateLength,\plateWidth,-\thickness) -- (\plateLength,0,-\thickness) -- cycle;

    % Draw normal
    \draw[->, thick, black] (\plateCenterX, \plateCenterY, 0) -- node[pos=1.1]{$\vec{n}$} (\plateCenterX, \plateCenterY, \thickness+2);

    \fill[black] (\plateCenterX, \plateCenterY, 0) circle (1.5pt);
    \node[left] at (\plateCenterX, \plateCenterY, 0) {\(\vec{x}\)};

    \shade[ball color=gray!10!white,opacity=0.2] (\plateCenterX+1.5,\plateCenterY) arc (0:-180:1.5cm and 5mm) arc (180:0:1.5cm and 1.5cm);

    \begin{scope}[canvas is xy plane at z=0]
    \draw (\plateCenterX, \plateCenterY) ellipse (1.5cm and 0.8cm);
    \end{scope}
\end{tikzpicture}
\end{document}
gusty sandBOT
#

Victor H
Compile Error! Click the errors reaction for more information.
(You may edit your message to recompile.)

brittle nymph
#

You know what, I actually got something working

#
\documentclass[tikz,border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{3d}

\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,x={(1cm,0cm)},y={(0.5cm,0.5cm)},z={(0cm,1cm)}]
    \def\thickness{0.2}
    \def\plateLength{4}
    \def\plateWidth{3}
    \def\plateCenterX{\plateLength * 0.5}
    \def\plateCenterY{\plateWidth * 0.5}

    % Top face
    \filldraw[fill=gray!20,opacity=0.5] (0,0,0) -- (\plateLength,0,0) -- (\plateLength,\plateWidth,0) -- (0,\plateWidth,0) -- cycle;
    % Front face
    \filldraw[fill=gray!30,opacity=0.5] (0,0,0) -- (\plateLength,0,0) -- (\plateLength,0,-\thickness) -- (0,0,-\thickness) -- cycle;
    % Side face
    \filldraw[fill=gray!40,opacity=0.5] (\plateLength,0,0) -- (\plateLength,\plateWidth,0) -- (\plateLength,\plateWidth,-\thickness) -- (\plateLength,0,-\thickness) -- cycle;

    % Draw normal
    \draw[->, thick, black] (\plateCenterX, \plateCenterY, 0) -- node[pos=1.1]{$\vec{n}$} (\plateCenterX, \plateCenterY, \thickness+2);

    \fill[black] (\plateCenterX, \plateCenterY, 0) circle (1.5pt);
    \node[left] at (\plateCenterX, \plateCenterY, 0) {\(\vec{x}\)};

    \shade[ball color=gray!20!white,opacity=0.2] (\plateCenterX+1.2,\plateCenterY) arc (0:-180:1.2cm and 5mm) arc (180:0:1.2cm and 1.2cm);
    \draw[dashed] (\plateCenterX+1.2,\plateCenterY) arc(0:180:1.2cm and 5mm);
    \draw (\plateCenterX+1.2,\plateCenterY) arc(0:-180:1.2cm and 5mm);
\end{tikzpicture}
\end{document}
gusty sandBOT
#

Victor H
Compile Error! Click the errors reaction for more information.
(You may edit your message to recompile.)