TikZ의 Seebeck 효과 설명

TikZ의 Seebeck 효과 설명

이 이미지를 재현하려고 합니다(원천) TikZ에서.

여기에 이미지 설명을 입력하세요

저는 이렇게 미미하게 시작했지만 다음에 나올 3D 물체 때문에 약간 겁이 납니다. TikZ 마법사가 이 작업을 수행/접근하는 방법에 대해 조언해 줄 수 있나요?

\documentclass[tikz]{standalone}

\usepackage{circuitikz}
\usetikzlibrary{decorations.markings}

\begin{document}
  \begin{circuitikz}[decoration={%
    markings,%
    mark=at position 0.05 with {\arrow[black]{stealth};},%
    mark=at position 0.4 with {\arrow[black]{stealth};},%
    mark=at position 0.6 with {\arrow[black]{stealth};},%
    mark=at position 0.95 with {\arrow[black]{stealth};}}]
    \draw[postaction={draw,decorate}] (3,0) to (5,0) to (5,-5) to[resistor] (-5,-5) to (-5,0) to (-3,0);
  \end{circuitikz}
\end{document}

답변1

직육면체를 만들기 위해 직사각형을 사용했습니다.

여기에 이미지 설명을 입력하세요

\documentclass[border=3mm]{standalone}
\usepackage{circuitikz}
\usetikzlibrary{3d,positioning,decorations.markings}
\tikzset{
decoration={%
    markings,%
    mark=at position 0.05 with {\arrow[black]{stealth};},%
    mark=at position 0.4 with {\arrow[black]{stealth};},%
    mark=at position 0.6 with {\arrow[black]{stealth};},%
    mark=at position 0.95 with {\arrow[black]{stealth};}},
vert/.style ={bottom color=blue!50, top color=red},
pics/.cd,
  pic a/.style={code={
      \node [fill=orange, shape=circle, inner sep=0pt] (pc) {+};
      \draw[thick,->] (pc)--++(0,-0.5);
  }},
}
\begin{document}
\begin{circuitikz}[scale=0.5,font=\sffamily,>=stealth]

\begin{scope}
% heat sink 1
\draw[fill=blue] (0,0,0) rectangle ++(6,1.5,0)node[midway,color=white]{heat sink};
\draw[fill=blue] (6,0,0) -- ++(0,1.5,0) -- ++(0,0,-3) -- ++(0,-1.5,0) -- cycle;
\draw[fill=blue] (0,1.5,0) -- ++(6,0,0) -- ++(0,0,-3) -- ++(-6,0,0) -- cycle;

\draw[vert,opacity=0.5] (0.5,1.5,-2.8) -- ++(0,10,0);
\draw[vert,opacity=0.5] (0.5,1.5,-2.8) -- ++(5,0,0);
\draw[vert,opacity=0.5] (0.5,1.5,-2.8) -- ++(0,0,2.6);
\fill[vert,opacity=0.7] (0.5,1.5,-0.2) rectangle ++(5,10,0);
\fill[vert,opacity=0.7] (5.5,1.5,-0.2) -- ++(0,10,0) -- ++(0,0,-2.6) -- ++(0,-10,0) -- cycle;
\end{scope}

\begin{scope}[xshift=15cm]
% heat sink 2
\draw[fill=blue] (0,0,0) rectangle ++(6,1.5,0)node[midway,color=white]{heat sink};
\draw[fill=blue] (6,0,0) -- ++(0,1.5,0) -- ++(0,0,-3) -- ++(0,-1.5,0) -- cycle;
\draw[fill=blue] (0,1.5,0) -- ++(6,0,0) -- ++(0,0,-3) -- ++(-6,0,0) -- cycle;

\draw[vert,opacity=0.5] (0.5,1.5,-2.8) -- ++(0,10,0);
\draw[vert,opacity=0.5] (0.5,1.5,-2.8) -- ++(5,0,0);
\draw[vert,opacity=0.5] (0.5,1.5,-2.8) -- ++(0,0,2.6);
\fill[vert,opacity=0.7] (0.5,1.5,-0.2) rectangle ++(5,10,0)node[midway](P){};
\fill[vert,opacity=0.7] (5.5,1.5,-0.2) -- ++(0,10,0) -- ++(0,0,-2.6) -- ++(0,-10,0) -- cycle;
\end{scope}

% heat source
\draw[fill=red] (0,11.5,0) rectangle ++(21,1.5,0)node[midway]{$J\rightarrow$};
\draw[fill=red] (21,11.5,0) -- ++(0,1.5,0) -- ++(0,0,-3) -- ++(0,-1.5,0) -- cycle;
\draw[fill=red] (0,13,0) -- ++(21,0,0) -- ++(0,0,-3) -- ++(-21,0,0) -- cycle;

% resistor
\draw[postaction={decorate}] (21,0.75,-1.5) -- ++ (3,0,0) -- ++(0,-3,0) to[R] ++ (-27,0,0) |- (0,0.75,0);

%arrow
\draw[thick,-stealth] (5.5,10,-1.5) node[right=3mm]{+} -- ++(0,-7,0)node[right=3mm]{-};

% 
\draw (P) node[draw,circle]{P};
\pic[below left=5mm] at (P) {pic a};
\pic[below right=5mm] at (P) {pic a};
\end{circuitikz}
\end{document}

답변2

그래디언트 쉐이딩을 적용한 직육면체를 좀 더 체계적으로 그리는 것을 목표로 빠르게 작성된 제안서입니다. 대부분의 측면은 pgf 키로 제어되며 이름이 설명이 필요하지 않은 경우 사과드립니다. 지그재그 장식은 반드시 필요한 것은 아니므 circuitikz로 회로를 추가하는 것이 오히려 간단할 것이라고 생각합니다.

\documentclass[tikz,border=3.14mm]{standalone}
\newif\ifcuboidshaded
\cuboidshadedfalse
\usepackage{tikz-3dplot}
\tikzset{get projections/.style={insert path={%
let \p1=(1,0,0),\p2=(0,1,0)  in 
[/utils/exec={\pgfmathtruncatemacro{\xproj}{sign(\x1)}\xdef\xproj{\xproj}
\pgfmathtruncatemacro{\yproj}{sign(\x2)}\xdef\yproj{\yproj}
\pgfmathtruncatemacro{\zproj}{sign(cos(\tdplotmaintheta))}\xdef\zproj{\zproj}}]}},
pics/cuboid/.style={code={\tikzset{cuboid/.cd,#1}
 \path[get projections];
 % bottom face
 \draw let \p1=($(1,0,0)-(0,0,0)$),\n1={atan2(\y1,\x1)} 
  in [/tikz/cuboid/every face,/tikz/cuboid/bottom face]
  \ifcuboidshaded [shading angle=\n1] \fi
     (0,-\cubey/2,0) -- ++(\cubex,0,0) -- ++(0,\cubey,0) --
     ++(-\cubex,0,0) -- cycle;
 \ifnum\yproj=1
  \draw let \p1=($(0,1,0)-(0,0,0)$),\n1={atan2(\y1,\x1)} 
  in [/tikz/cuboid/every face,/tikz/cuboid/yz face] 
  \ifcuboidshaded [shading angle=\n1] \fi
  (0,-\cubey/2,0) -- ++(0,0,\cubez) -- ++(0,\cubey,0) -- ++(0,0,-\cubez) -- cycle;
 \else
  \draw let \p1=($(0,1,0)-(0,0,0)$),\n1={atan2(\y1,\x1)}  
  in [/tikz/cuboid/every face,/tikz/cuboid/yz face]
  \ifcuboidshaded [shading angle=\n1] \fi
  (0+\cubex,-\cubey/2,0) -- ++(0,0,\cubez) -- ++(0,\cubey,0) -- ++(0,0,-\cubez) -- cycle;
 \fi
 \ifnum\xproj=1             
  \draw let \p1=($(1,0,0)-(0,0,0)$),\n1={atan2(\y1,\x1)+180} 
  in [/tikz/cuboid/every face,/tikz/cuboid/xz face]
  \ifcuboidshaded [shading angle=\n1] \fi
     (0,\cubey/2,0) -- ++(\cubex,0,0) -- ++(0,0,\cubez) -- ++(-\cubex,0,0) -- cycle;
 \else
  \draw let \p1=($(1,0,0)-(0,0,0)$),\n1={atan2(\y1,\x1)+180} 
  in  [/tikz/cuboid/every face,/tikz/cuboid/xz face]
  \ifcuboidshaded [shading angle=\n1] \fi
     (0,-\cubey/2,0) -- ++(\cubex,0,0) -- ++(0,0,\cubez) -- ++(-\cubex,0,0) -- cycle;
 \fi
 \ifnum\yproj=-1
  \draw let \p1=($(0,1,0)-(0,0,0)$),\n1={atan2(\y1,\x1)} 
  in [/tikz/cuboid/every face,/tikz/cuboid/yz face]
  \ifcuboidshaded [shading angle=\n1] \fi 
  (0,-\cubey/2,0) -- ++(0,0,\cubez) -- ++(0,\cubey,0) -- ++(0,0,-\cubez) -- cycle;
 \else
  \draw let \p1=($(0,1,0)-(0,0,0)$),\n1={atan2(\y1,\x1)}  
  in [/tikz/cuboid/every face,/tikz/cuboid/yz face]
  \ifcuboidshaded [shading angle=\n1] \fi
  (0+\cubex,-\cubey/2,0) -- ++(0,0,\cubez) -- ++(0,\cubey,0) -- ++(0,0,-\cubez) -- cycle;
 \fi
 \ifnum\xproj=-1             
  \draw let \p1=($(1,0,0)-(0,0,0)$),\n1={atan2(\y1,\x1)+180} 
  in [/tikz/cuboid/every face,/tikz/cuboid/xz face]
  \ifcuboidshaded [shading angle=\n1] \fi
     (0,\cubey/2,0) -- ++(\cubex,0,0) -- ++(0,0,\cubez) -- ++(-\cubex,0,0) -- cycle;
 \else
  \draw let \p1=($(1,0,0)-(0,0,0)$),\n1={atan2(\y1,\x1)+180} 
  in  [/tikz/cuboid/every face,/tikz/cuboid/xz face]
  \ifcuboidshaded [shading angle=\n1] \fi
     (0,-\cubey/2,0) -- ++(\cubex,0,0) -- ++(0,0,\cubez) -- ++(-\cubex,0,0) -- cycle;
 \fi
 \draw let \p1=($(1,0,0)-(0,0,0)$),\n1={atan2(\y1,\x1)} 
  in [/tikz/cuboid/every face,/tikz/cuboid/top face]
  \ifcuboidshaded [shading angle=\n1] \fi
     (0,-\cubey/2,\cubez) -- ++(\cubex,0,0) -- ++(0,\cubey,0) --
     ++(-\cubex,0,0) -- cycle;}},
 cuboid/.cd,x/.estore in=\cubex,y/.estore in=\cubey,z/.estore
 in=\cubez,rounding/.estore in=\rounding,rounding=0.2pt,
 every face/.style={fill=blue},bottom face/.style={},top face/.style={},
 xz face/.style={},yz face/.style={},shaded/.code=\cuboidshadedtrue  
}
%%%%%%%%%%%
\begin{document}

\tdplotsetmaincoords{75}{110}

\begin{tikzpicture}[tdplot_main_coords]
  \pgfmathsetmacro{\cubedist}{4}
  \path[cuboid/.cd,x=2.4,y=4.8,z=1,
  every face/.style={fill=blue}] 
  (0,-\cubedist,-1) pic{cuboid} 
  (0,\cubedist,-1) pic{cuboid};  
  % 
  \path[fill opacity=0.3,cuboid/.cd,shaded,x=2,y=4,z=4,xz face/.style={top color=orange,bottom color=blue},
   yz face/.style={top color=red,bottom color=blue},
   bottom face/.style={fill=blue},top face/.style={fill=red}] 
   (0,-\cubedist,0) pic{cuboid} (0,\cubedist,0) pic{cuboid};  
  \path[cuboid/.cd,x=2.5,y=12.4,z=1,every face/.style={fill=red}] 
  (0,0,4) pic{cuboid};
\end{tikzpicture}
\end{document}

여기에 이미지 설명을 입력하세요

답변3

nidhin과 user121799의 큰 도움 덕분에 이렇게 되었습니다.

여기에 이미지 설명을 입력하세요

\documentclass[border=3mm]{standalone}

\usepackage{circuitikz}
\usetikzlibrary{3d,positioning,decorations.markings}

\tikzset{
decoration={%
  markings,%
  mark=at position 0.05 with {\arrow[black]{stealth};},%
  mark=at position 0.4 with {\arrow[black]{stealth};},%
  mark=at position 0.6 with {\arrow[black]{stealth};},%
  mark=at position 0.95 with {\arrow[black]{stealth};}},
gradient/.style ={bottom color=blue!50, top color=red},
pics/.cd,
  p charge/.style={code={
      \node [fill=orange, shape=circle, inner sep=0pt] (pc) {+};
      \draw[thick,->] (pc)--++(0,-0.5);
  }},
  n charge/.style={code={
      \node [fill=cyan, shape=circle, inner sep=1pt, scale=1.2] (nc) {-};
      \draw[thick,->] (nc)--++(0,-0.5);
  }},
}

\newcommand\heatsink{
  \draw[fill=blue] (0,0,0) rectangle ++(6,1.5,0)node[midway,color=white]{heat sink};
  \draw[fill=blue] (6,0,0) -- ++(0,1.5,0) -- ++(0,0,-3) -- ++(0,-1.5,0) -- cycle;
  \draw[fill=blue] (0,1.5,0) -- ++(6,0,0) -- ++(0,0,-3) -- ++(-6,0,0) -- cycle;

  \draw[gradient,opacity=0.5] (0.5,1.5,-2.8) -- ++(0,10,0);
  \draw[gradient,opacity=0.5] (0.5,1.5,-2.8) -- ++(5,0,0);
}

\begin{document}
\begin{circuitikz}[scale=0.4,font=\sffamily,>=stealth]

  \begin{scope}
  % heat sink 1
  \heatsink
  \draw[gradient,opacity=0.5] (0.5,1.5,-2.8) -- ++(0,0,2.6);
  \fill[gradient,opacity=0.7] (5.5,1.5,-0.2) -- ++(0,10,0) -- ++(0,0,-2.6) -- ++(0,-10,0) -- cycle;
  \fill[gradient,opacity=0.7] (0.5,1.5,-0.2) rectangle ++(5,10,0)node[midway,draw,circle,white](N){N};
  \pic[below left=8mm and 3mm] at (N) {n charge};
  \pic[below right=7mm and 6mm] at (N) {n charge};
  \pic[above left=1cm and 3mm] at (N) {n charge};
  \pic[above right=1cm and 5mm] at (N) {n charge};
  \end{scope}

  \begin{scope}[xshift=15cm]
  % heat sink 2
  \heatsink
  \draw[gradient,opacity=0.5] (0.5,1.5,-2.8) -- ++(0,0,2.6);
  \fill[gradient,opacity=0.7] (5.5,1.5,-0.2) -- ++(0,10,0) -- ++(0,0,-2.6) -- ++(0,-10,0) -- cycle;
  \fill[gradient,opacity=0.7] (0.5,1.5,-0.2) rectangle ++(5,10,0)node[midway,draw,circle,white](P){P};
  \pic[below left=8mm and 3mm] at (P) {p charge};
  \pic[below right=7mm and 6mm] at (P) {p charge};
  \pic[above left=1cm and 3mm] at (P) {p charge};
  \pic[above right=1cm and 5mm] at (P) {p charge};
  \end{scope}

  % heat source
  \draw[fill=red] (0,11.5,0) rectangle ++(21,1.5,0) node[midway,white] (J) {$J\longrightarrow$};
  \draw[fill=red] (21,11.5,0) -- ++(0,1.5,0) -- ++(0,0,-3) -- ++(0,-1.5,0) -- cycle;
  \draw[fill=red] (0,13,0) -- ++(21,0,0) node[color=white,anchor=south,pos=0.5]{heat source} -- ++(0,0,-3) -- ++(-21,0,0) -- cycle;

  % electric field
  \node[below=1cm,scale=1.3] at (11,10) {electric field};
  \draw[thick,-stealth] (6.8,10,-1.5) node[below right=1mm]{+} -- ++(0,-7,0)node[above right=1mm,scale=1.2]{--};
  \draw[thick,-stealth] (14.1,3,-1.5) node[above left=1mm]{+} -- ++(0,7,0)node[below left=1mm,scale=1.2]{--};

  % resistor
  \draw[postaction={decorate}] (21,0.75,-1.5) -- ++ (3,0,0) -- ++(0,-3,0) to[R] ++ (-27,0,0) |- (0,0.75,0);

\end{circuitikz}
\end{document}

관련 정보