我曾尝试做一个电线横截面:
\documentclass[border=0.2cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[scale=2]
\clip (-2,-1.1) rectangle (1,1.5);
\begin{scope}[rotate=-30]
\fill[orange!50, draw = black] (-3,-1) rectangle (0,1);
\fill[gray!40, draw = black] (0,0) circle(1cm);
\begin{scope}
\clip (0,0) circle(1cm);
\fill[orange!50, draw = black, dashed] (0,0) circle(0.5cm);
\end{scope}
\draw[-stealth,<->] (80:1) -- node[right]{$r_{W}$}(120:0);
\draw[-stealth,<->] (30:0.5) -- node[right]{$\delta_{SC}$}(30:1);
\end{scope}
\end{tikzpicture}
\end{document}
答案1
也许你会喜欢它...
\documentclass[border=3.141592]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usetikzlibrary{arrows.meta,
decorations.pathmorphing,
pgfplots.fillbetween,
quotes}
\begin{document}
\begin{tikzpicture}[scale=2.5, rotate=-30, >=Stealth,
every edge quotes/.style = {font=\footnotesize, anchor=south,
sloped, rotate=-30, },
decoration={snake,
pre =lineto, pre length=4pt,
post=lineto, post length=4pt}
]
meta-segment length
\draw[name path=A, decorate]
(-2,-1) to[bend left=60] (-2,1);
\draw[name path=B] (-2,1) -| (0,-1) -- (-2,-1);
\tikzfillbetween[of=A and B] {fill=orange!50};
%
\filldraw[fill=gray!40] (0,0) circle[x radius=0.5, y radius=1];
\filldraw[fill=orange!50, dashed] (0,0) circle[x radius=0.25, y radius=0.7];
\draw[<->] (0:0) to ["$r_{W}$"] (75:0.91);
\draw[<->] (30:0.27) to ["$\delta_{SC}$"] (30:0.56);
\draw[->, very thick] (0,0) -- (1.2,0) node[below left] {$I$};
\end{tikzpicture}
\end{document}
附录:
正如@Crazymoomin 在他的评论中提出/建议的那样,将管的左端绘制为 可能会更好random steps
。在这种情况下, 的选项tikzpicture
是:
\begin{tikzpicture}[scale=2.5, rotate=-30, >=Stealth,
every edge quotes/.style = {font=\footnotesize, anchor=south,
sloped, rotate=-30, },
decoration={random steps, amplitude=2mm, segment length=3mm, % <--- changed
pre =lineto, pre length=4pt,
post=lineto, post length=4pt}
]
在上面的 MWE 中使用它会产生(管子破裂):
嗯,您可以使用任何decorations.pathmorphing
选项。请参阅章节“*50.3 路径变形装饰”以了解详情。
答案2
\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{decorations.pathmorphing, arrows.meta}
\begin{document}
\begin{tikzpicture}[scale=2, rotate=-30]
\clip[decoration=snake, decorate] (-2.5,-1.4) rectangle (1.5,1.2);
\filldraw[fill=orange!50] (-3,-1) rectangle (0,1);
\filldraw[fill=gray!40] (0,0) circle[radius=1];
\filldraw[fill=orange!50, dashed] (0,0) circle[radius=0.5];
\draw[Stealth-Stealth] (80:1) -- node[right]{$r_{W}$}(120:0);
\draw[Stealth-Stealth] (30:0.5) -- node[below]{$\delta_{SC}$}(30:1);
\draw[-Stealth, very thick] (0,0) -- (1.4,0) node[below left]{$I$};
\end{tikzpicture}
\end{document}
答案3
我根据 hpekristiansen 的回答制作了这个具有椭圆形横截面的:
\documentclass[border=0.2cm]{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{arrows}
\begin{document}
\usetikzlibrary{decorations.pathmorphing, arrows.meta}
\begin{tikzpicture}[scale=2]
\clip[decoration=snake, decorate] (-2,-1.4) rectangle (1.5,1.2);
\filldraw[fill=orange!50] (-3,-1) rectangle (0,1);
\draw [black,fill=gray!40] (0,0) ellipse (0.5 and 1);
\draw [black,fill=orange!50,dashed] (0,0) ellipse (0.25 and 0.5);
\draw[Stealth-Stealth] (90:1) -- node[right]{$r_{W}$}(120:0);
\draw[Stealth-Stealth] (270:0.5) -- node[right]{$\delta_{SC}$}(270:1);
\draw[-Stealth, very thick, red, line width=1mm, font=\large] (0,0) -- node[below]{\textcolor{black}{$I_{SC}$}}(1.4,0);
\end{tikzpicture}
\end{document}