2

I would like to recreate these two pictures (representing a motor load coupling and a motor load coupling with elastic power transmission):

Motor Load rigid coupling

Motor Load elastic coupling

Now i tried this for the second image but doesn't work, suggestions?

\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}
it8
  • 1,210
  • Sorry but these are 2D examples, i am searching for something 3D if possible – it8 May 17 '17 at 07:09
  • (1) The picture in your question is 2D. (2) 3D drawings in TikZ are non-trivial and not really supported. (3) You haven't provided any code yourself, so we have no idea what you want. Try something yourself first and come back with a specific question and a minimal working example (MWE). – Henri Menke May 17 '17 at 07:11
  • Well, i provided the following. As i said i don't know from where i should start to do what i am trying to have. Basically i would iterate the following code to get a 3D version of the figure in my example. https://tex.stackexchange.com/questions/60822/drawing-a-motor-shaft-in-tikz/60825#60825 – it8 May 17 '17 at 07:12
  • You didn't provide anything. You linked to someone else's answer. – Henri Menke May 17 '17 at 07:14
  • Ok, i reported what i tried before posting here. Of course it is awful. – it8 May 17 '17 at 08:00
  • 2
    Maybe related: https://tex.stackexchange.com/questions/12020/ Apart from that I would agree with Henri and wouldn't go for 3D. It's much more complicated, not really supported and often does not have a benefit over 2D (opinion). – Dr. Manuel Kuehner May 17 '17 at 08:13
  • Leaving aside the question of whether or not one should do this in 3D, maybe Asymptote or pst-solides3d would be a better fit than TikZ? – alpenwasser May 17 '17 at 09:07

1 Answers1

1

for the first image:

enter image description here

\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}
Zarko
  • 296,517