답변1
이것은 당신에게 시작을 제공하기 위한 것입니다. 그림을 완전히 다시 그리려는 시도는 아닙니다. 그러나 그것은 대부분의 내용을 제공하고 나머지는 IMHO 반복입니다.
더 자세하게,
- 3D 뷰를 설치하기 위해
perspective
라이브러리를 사용합니다. (IMHO 이 진술은isometric view
3D 공간에서 원통의 방향을 추가로 지정하는 경우에만 의미가 있습니다.) - 길이는 를 통해 "함수"에 저장됩니다
declare function
. - 이건 티야케이Z이므로 다양한 면을 적절한 순서로 그려야 합니다. 이것이 마음에 들지 않으면 로 전환하십시오
asymptote
.
코드 및 결과:
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{perspective}
\begin{document}
\begin{tikzpicture}[>=stealth,semithick,line cap=round,
declare function={R=20;d=9;dd=1.5;rr=5;L=10;l=1;},%<- d/2efine some lengths
scale=0.15]
\begin{scope}[3d view={30}{10}]%<- install 3d view and set view angles
\path[fill=gray!80] plot[variable=\t,domain=60:110,smooth]
({R*cos(\t)},{d/2},{R*sin(\t)})
-- plot[variable=\t,domain=110:60,smooth]
({R*cos(\t)},{-d/2},{R*sin(\t)}) -- cycle;
\path[fill=gray!40] plot[variable=\t,domain=120:240,smooth]
({R*cos(\t)},{-d/2},{R*sin(\t)})
-- plot[variable=\t,domain=240:120,smooth]
({rr*cos(\t)},{-d/2},{rr*sin(\t)}) --cycle;
\path[fill=black] plot[variable=\t,domain=120:240,smooth]
({rr*cos(\t)},{-d/2},{rr*sin(\t)})
-- ({rr*cos(240)},{d/2},{rr*sin(240)})
-- ({(rr+dd)*cos(240)},{d/2},{(rr+dd)*sin(240)})
-- plot[variable=\t,domain=240:120,smooth]
({(rr+dd)*cos(\t)},{-d/2},{(rr+dd)*sin(\t)}) -- cycle;
\path[fill=brown!40] plot[variable=\t,domain=120:60,smooth]
({rr*cos(\t)},{d/2+l},{rr*sin(\t)}) --
plot[variable=\t,domain=60:120,smooth]
({rr*cos(\t)},{-d/2-L},{rr*sin(\t)}) --
cycle;
\path[fill=gray!40] plot[variable=\t,domain=60:120,smooth]
({R*cos(\t)},{-d/2},{R*sin(\t)})
-- plot[variable=\t,domain=120:60,smooth]
({rr*cos(\t)},{-d/2},{rr*sin(\t)}) --cycle;
\path[fill=black] plot[variable=\t,domain=120:60,smooth]
({rr*cos(\t)},{-d/2},{rr*sin(\t)})
-- ({rr*cos(60)},{d/2},{rr*sin(60)})
-- ({(rr+dd)*cos(60)},{d/2},{(rr+dd)*sin(60)})
-- plot[variable=\t,domain=60:120,smooth]
({(rr+dd)*cos(\t)},{-d/2},{(rr+dd)*sin(\t)}) -- cycle;
\path[fill=gray!60]
({(rr+dd)*cos(60)},{-d/2},{(rr+dd)*sin(60)})
-- ({(rr+dd)*cos(60)},{d/2},{(rr+dd)*sin(60)})
-- ({R*cos(60)},{d/2},{R*sin(60)})
-- ({R*cos(60)},{-d/2},{R*sin(60)}) -- cycle;
\path[fill=brown!60] plot[variable=\t,domain=240:60,smooth]
({rr*cos(\t)},{-d/2-L},{rr*sin(\t)}) --cycle;
\path[fill=brown]
({rr*cos(240)},{-d/2-L},{rr*sin(240)})
-- ({rr*cos(60)},{-d/2-L},{rr*sin(60)})
-- ({rr*cos(60)},{d/2+l},{rr*sin(60)})
-- ({rr*cos(240)},{d/2+l},{rr*sin(240)})
--cycle;
\path[fill=gray!60]
({(rr+dd)*cos(240)},{-d/2},{(rr+dd)*sin(240)})
-- ({(rr+dd)*cos(240)},{d/2},{(rr+dd)*sin(240)})
-- ({R*cos(240)},{d/2},{R*sin(240)})
-- ({R*cos(240)},{-d/2},{R*sin(240)}) -- cycle;
\end{scope}
%
\begin{scope}[xshift=35cm]
\draw (-d/2,-R) rectangle (d/2,-rr-dd) (-d/2,R) rectangle (d/2,rr+dd)
(-d/2-L,-rr) rectangle (d/2+l,rr);
\draw[fill] (-d/2,-rr) rectangle (d/2,-rr-dd)
(-d/2,rr) rectangle (d/2,rr+dd);
\draw[dashed] (d/2,R) -- ++ (5,0) coordinate (rt)
(d/2,-R) -- ++ (5,0) coordinate (rb);
\draw[<->] (rt) -- (rb) node[midway,rotate=90,anchor=north]
{\pgfmathparse{2*R}\pgfmathprintnumber\pgfmathresult\,mm};
\draw[<->] (-d/2,R+1) -- (d/2,R+1) node[midway,rotate=90,anchor=west]
{\pgfmathparse{d}\pgfmathprintnumber\pgfmathresult\,mm};
\end{scope}
\end{tikzpicture}
\end{document}