我想重新创建这两张图(代表电机负载联轴器和具有弹性动力传输的电机负载联轴器):
现在我尝试对第二张图片进行此操作,但没有效果,有什么建议吗?
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, bending, calc, chains, positioning,
shapes,patterns,decorations.pathmorphing,decorations.markings}
\tikzstyle{spring}=[thick,decorate,decoration={zigzag,pre
length=0.3cm,post length=0.3cm,segment length=6}]
\tikzstyle{damper}=[thick,decoration={markings,
mark connection node=dmp,
mark=at position 0.5 with
{
\node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
width=15pt,minimum height=3pt,draw=none] {};
\draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) --
(dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
\draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);
}
}, decorate]
\begin{document}
%\begin{figure}[!h] % when use article \documentclass{article}
%\centering % when use article \documentclass{article}
\begin{tikzpicture}[
node distance = 0mm,
start chain = going right,
box/.style = {draw,
font=\linespread{0.75}\selectfont\small,
align=center, inner sep=2mm, outer sep=0pt,
on chain},
axs/.style = {draw, minimum width=12mm, minimum height=2mm,
inner sep=0pt, outer sep=0pt,
on chain, node contents={}},
arr/.style = {color=#1, line width=0.8mm,
shorten >=-1mm, shorten <=-1mm,
-{Stealth[length=1.6mm,width=3mm,flex=1.2]},
bend angle=60}
]
% blocks (boxes)
\node (n1) [box,label=below:$J_M$] {Motore};
\node (n2) [axs];
\node (n3) [box] {$\tau$};
\node (n34) [axs];
\draw[spring] (n34.east) -- (n4.west);
\draw [damper] (n34.east) -- (n4.west);
\node (n4) [axs];
\node (n5) [box,label=below:$J_C$] {C\\a\\r\\i\\c\\o};
% arrows
\draw[transform canvas={xshift=-2mm}]
(n1.south -| n2) edge[arr=gray,bend right] (n1.north -| n2)
node[below,at={(n1.south -| n2)}] {$C_M$}
(n1.north -| n4) edge[arr=gray,bend left] (n1.south -| n4)
node[below,at={(n1.south -| n4)}] {$C_R$};
\draw[transform canvas={xshift=+2mm}]
(n1.south -| n2) edge[arr=black,bend right] (n1.north -| n2)
node[above,at={(n1.north -| n2)}] {$\theta_M$}
(n1.south -| n4) edge[arr=black,bend right] (n1.north -| n4)
node[above,at={(n1.north -| n4)}] {$\theta_R$};
\end{tikzpicture}
%\end{figure} % when use article \documentclass{article}
\end{document}
答案1
对于第一张图片:
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, bending, calc, chains, positioning, shapes}
\begin{document}
%\begin{figure}[!h] % when use article \documentclass{article}
%\centering % when use article \documentclass{article}
\begin{tikzpicture}[
node distance = 0mm,
start chain = going right,
box/.style = {draw,
font=\linespread{0.75}\selectfont\small,
align=center, inner sep=2mm, outer sep=0pt,
on chain},
axs/.style = {draw, minimum width=12mm, minimum height=2mm,
inner sep=0pt, outer sep=0pt,
on chain, node contents={}},
arr/.style = {color=#1, line width=0.8mm,
shorten >=-1mm, shorten <=-1mm,
-{Stealth[length=1.6mm,width=3mm,flex=1.2]},
bend angle=60}
]
% blocks (boxes)
\node (n1) [box,label=below:$J_M$] {Motore};
\node (n2) [axs];
\node (n3) [box] {$\tau$};
\node (n4) [axs];
\node (n5) [box,label=below:$J_C$] {C\\a\\r\\i\\c\\o};
% arrows
\draw[transform canvas={xshift=-2mm}]
(n1.south -| n2) edge[arr=gray,bend right] (n1.north -| n2)
node[below,at={(n1.south -| n2)}] {$C_M$}
(n1.north -| n4) edge[arr=gray,bend left] (n1.south -| n4)
node[below,at={(n1.south -| n4)}] {$C_R$};
\draw[transform canvas={xshift=+2mm}]
(n1.south -| n2) edge[arr=black,bend right] (n1.north -| n2)
node[above,at={(n1.north -| n2)}] {$\theta_M$}
(n1.south -| n4) edge[arr=black,bend right] (n1.north -| n4)
node[above,at={(n1.north -| n4)}] {$\theta_R$};
\end{tikzpicture}
%\end{figure} % when use article \documentclass{article}
\end{document}