我是 Latex 的新手。这是我想画的图形。为了画出变形梁,我创建了一个节点 (O) 并画了两个平行圆弧。我的问题是如何在不删除此节点的情况下移除空白区域。或者有没有更好的方法来画这个图形。谢谢你的帮助。
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{calc,angles,quotes}
\begin{document}
\begin{tikzpicture}
\node (O) at (2.5,2) {O}; %%node O
\path (O) ++(-60:5) coordinate (ee);
\path (O) ++(-120:5) coordinate (oo);
\draw[dashed][line width=.3pt] (oo) arc (-120:-60:5);
\path (O) ++(-60:4.5) coordinate (eeu);
\path (O) ++(-120:4.5) coordinate (oou);
\draw[dashed][line width=.3pt] (oou) arc (-120:-60:4.5);
\path (O) ++(-60:5.5) coordinate (eed);
\path (O) ++(-120:5.5) coordinate (ood);
\draw[dashed][line width=.3pt] (ood) arc (-120:-60:5.5);
\draw[dashed][line width=.3pt] (ood) -- (oou);
\draw[dashed][line width=.3pt] (eed) -- (eeu);
\draw[-latex] (oo) -- ++(0:1) coordinate [label=below:$x$] (xx);
\draw[-latex] (oo) -- ++(90:1) coordinate [label=right:$y$] (yy);
\path (O) ++(-63:4.5) coordinate (eeuT);
\path (O) ++(-117:4.5) coordinate (oouT);
\draw[solid][line width=.5pt] (oouT) arc (-117:-63:4.5);
\path (O) ++(-57.5:5.5) coordinate (eedT);
\path (O) ++(-122.5:5.5) coordinate (oodT);
\draw[solid][line width=.5pt] (oodT) arc (-122.5:-57.5:5.5);
\draw[solid][line width=.5pt] (oodT) -- (oouT);
\draw[solid][line width=.5pt] (eedT) -- (eeuT);
\draw[solid][line width=.3pt] (ee) -- ++(90:1.2) coordinate(vert);
\draw[solid][line width=.3pt] (ee) -- ++(120:1.2) coordinate(w);
\draw[solid][line width=.3pt] (ee) -- ++(145:1.2) coordinate(phi);
\pic [draw, ->, "$w'$", angle eccentricity=1.5] {angle = vert--ee--w};
\pic [draw, <-, "$\gamma$", angle eccentricity=1.5] {angle = w--ee--phi};
\pic [draw, ->, "$\phi=w'-\gamma$", angle eccentricity=1.3,angle radius=1.2cm] {angle = vert--ee--phi};
\end{tikzpicture}
\end{document}
答案1
也许您正在寻找以下overlay
选项:
\node[overlay] (O) at (2.5,2) {O};
代码:
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{calc,angles,quotes}
\begin{document}
\begin{tikzpicture}
\node[overlay] (O) at (2.5,2) {O}; %%node O
\path (O) ++(-60:5) coordinate (ee);
\path (O) ++(-120:5) coordinate (oo);
\draw[dashed][line width=.3pt] (oo) arc (-120:-60:5);
\path (O) ++(-60:4.5) coordinate (eeu);
\path (O) ++(-120:4.5) coordinate (oou);
\draw[dashed][line width=.3pt] (oou) arc (-120:-60:4.5);
\path (O) ++(-60:5.5) coordinate (eed);
\path (O) ++(-120:5.5) coordinate (ood);
\draw[dashed][line width=.3pt] (ood) arc (-120:-60:5.5);
\draw[dashed][line width=.3pt] (ood) -- (oou);
\draw[dashed][line width=.3pt] (eed) -- (eeu);
\draw[-latex] (oo) -- ++(0:1) coordinate [label=below:$x$] (xx);
\draw[-latex] (oo) -- ++(90:1) coordinate [label=right:$y$] (yy);
\path (O) ++(-63:4.5) coordinate (eeuT);
\path (O) ++(-117:4.5) coordinate (oouT);
\draw[solid][line width=.5pt] (oouT) arc (-117:-63:4.5);
\path (O) ++(-57.5:5.5) coordinate (eedT);
\path (O) ++(-122.5:5.5) coordinate (oodT);
\draw[solid][line width=.5pt] (oodT) arc (-122.5:-57.5:5.5);
\draw[solid][line width=.5pt] (oodT) -- (oouT);
\draw[solid][line width=.5pt] (eedT) -- (eeuT);
\draw[solid][line width=.3pt] (ee) -- ++(90:1.2) coordinate(vert);
\draw[solid][line width=.3pt] (ee) -- ++(120:1.2) coordinate(w);
\draw[solid][line width=.3pt] (ee) -- ++(145:1.2) coordinate(phi);
\pic [draw, ->, "$w'$", angle eccentricity=1.5] {angle = vert--ee--w};
\pic [draw, <-, "$\gamma$", angle eccentricity=1.5] {angle = w--ee--phi};
\pic [draw, ->, "$\phi=w'-\gamma$", angle eccentricity=1.3,angle radius=1.2cm] {angle = vert--ee--phi};
\end{tikzpicture}
\end{document}