I tried unsuccessfully to remove or to make invisible the line connecting the left wall
to the first block $m_1$
. How can I do this ? I think it's an easy thing, but I don't know exactly.
The code is:
\documentclass[11pt]{article}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{
decorations.markings,
decorations.pathmorphing,
calc,
patterns,
positioning
}
\tikzset{
spring/.style={thick,decorate,decoration={zigzag,pre length=0.3cm,post length=0.3cm,segment length=6}},
blank/.style={draw=none,fill=none,pos=0.5},
ground/.style={fill,pattern=north east lines,draw=none,minimum width=0.5cm,minimum height=0.3cm},
damper/.style={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=10pt,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,-3pt)$) -- ($(dmp.north)+(0,3pt)$);
}
}, decorate
},
box/.style={draw,thick,minimum width=1cm, minimum height=1cm}
}
\begin{document}
\begin{figure}[tbp]
\centering
\begin{tikzpicture}[node distance=3cm]
\node (wall) [ground, rotate=-90, minimum width=2cm] {};
\node (M1) [box, right=of wall.north] {$m_1$};
\node (M2) [box,right=of M1,label=below:$f$] {$m_2$};
\draw (wall.north east) -- (wall.north west);
\draw [spring] (wall.north) -- (M1) node[blank,above,yshift=1mm] {};
\draw (wall.20) -- (wall.20 -| M1.west) coordinate (d1);
\draw [spring] (M1) -- (M2) node[blank,above,yshift=1mm] {} ;
\draw [damper] (d1-|M1.east) -- (d1 -| M2.west);
\node (wall2) [ground, right=of M2, anchor=north,rotate=90,minimum width=2cm] {};
\draw [spring] (M2) -- (wall2) node[blank,above,yshift=1mm] {};
\draw [damper] (d1-|M2.east) -- (d1 -| wall2.north);
\end{tikzpicture}
\end{figure}
\end{document}
Best Answer
Replace
\draw
by\path
: