Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass[tikz,border=3mm]{standalone}
- \usepackage{adjustbox}
- \usepackage[american, siunitx , RPvoltages]{circuitikz}
- \usetikzlibrary{3d,arrows.meta,bending,calc,decorations.markings,patterns.meta,positioning,shapes.geometric}
- \pgfdeclarepattern{name=Bricks,
- parameters={\brickwidth,\brickheight,\brickangle,\bricklinewidth},
- bottom left={\pgfpoint{-.1pt}{-.1pt}},
- top right={\pgfpoint{\brickwidth+.1pt}{\brickheight+.1pt}},
- tile size={\pgfpoint{\brickwidth}{\brickheight}},
- tile transformation={\pgftransformrotate{\brickangle}},
- code={
- \pgfsetlinewidth{\bricklinewidth}
- \pgfpathmoveto{\pgfpoint{-.1pt}{0pt}}
- \pgfpathlineto{\pgfpoint{\brickwidth+.1pt}{0pt}}
- \pgfpathmoveto{\pgfpoint{-.1pt}{0.5*\brickheight}}
- \pgfpathlineto{\pgfpoint{\brickwidth+.1pt}{0.5*\brickheight}}
- \pgfpathmoveto{\pgfpoint{0.25*\brickwidth}{0pt}}
- \pgfpathlineto{\pgfpoint{0.27*\brickwidth}{0.5*\brickheight}}
- \pgfpathmoveto{\pgfpoint{0.75*\brickwidth}{0.5*\brickheight}}
- \pgfpathlineto{\pgfpoint{0.75*\brickwidth}{\brickheight}}
- \pgfusepath{stroke}
- } }
- \tikzset{/pgf/pattern keys/.cd,
- brick width/.store in=\brickwidth,
- brick height/.store in=\brickheight,
- brick angle/.store in=\brickangle,
- brick line width/.store in=\bricklinewidth,
- brick width=1em,
- brick height=1em,
- brick angle=0pt,
- brick line width=.5pt,
- }
- \makeatletter
- \tikzset{brick fill/.style={path picture={%
- \tikzset{brick fill keys/.cd,#1}%
- \edef\pgfutil@tmpp{path picture bounding box}
- \edef\pgfutil@tmpw{\pgfkeysvalueof{/tikz/brick fill keys/width}}
- \edef\pgfutil@tmph{\pgfkeysvalueof{/tikz/brick fill keys/height}}
- \path[brick fill keys/style] let \p1=($(\pgfutil@tmpp.north east)-(\pgfutil@tmpp.south west)$),
- \n1={scalar(int(\x1/\pgfutil@tmpw))},
- \n2={scalar(int(\y1/\pgfutil@tmph))+1} in
- foreach \YY in {0,...,\n2}
- {([yshift=(\YY-0.5)*\pgfutil@tmph]\pgfutil@tmpp.south west) -- ([yshift=(\YY-0.5)*\pgfutil@tmph]\pgfutil@tmpp.south east)
- ([yshift=\YY*\pgfutil@tmph]\pgfutil@tmpp.south west) -- ([yshift=\YY*\pgfutil@tmph]\pgfutil@tmpp.south east)
- foreach \XX in {0,...,\n1} {
- ([yshift=(\YY-0.5)*\pgfutil@tmph,xshift=(\XX-0.5)*\pgfutil@tmpw]\pgfutil@tmpp.south west)
- --([yshift=\YY*\pgfutil@tmph,xshift=(\XX-0.5)*\pgfutil@tmpw]\pgfutil@tmpp.south west)
- ([yshift=(\YY+0.5)*\pgfutil@tmph,xshift=\XX*\pgfutil@tmpw]\pgfutil@tmpp.south west)
- --([yshift=\YY*\pgfutil@tmph,xshift=\XX*\pgfutil@tmpw]\pgfutil@tmpp.south west)
- }};}},
- brick fill keys/.cd,width/.initial=1em,height/.initial=1em,style/.style={draw}}
- \makeatother
- \tikzset{pics/rotarrow/.style={code={\path (160:0.4) coordinate (tmpex);
- \begin{scope}[local bounding box=tmp,x={(tmpex)},
- canvas is xy plane at z=0]
- \clip (-0.41,-0.41) rectangle (0.41,0.41);
- \pgflowlevelsynccm
- \draw[thick,-{Stealth[bend]}] (-150:0.4) arc[start angle=-150,end
- angle=150,radius=0.4];
- \end{scope}
- \path (tmp.north) node [above] {\tikzpictext};
- }},pics/bar/.style={code={\draw[pic actions] (0,-#1) -- (0,#1);}},
- pics/bar/.default=0.5}
- % https://topanswers.xyz/transcript?room=1618&id=85298#c85298
- \pgfmathsetmacro{\oriex}{1ex}% store the height of an x in normalsize
- \pgfmathsetmacro{\oriem}{1em}
- \tikzset{every picture/.append style={%
- execute at begin picture={\pgfmathsetmacro{\myscale}{1ex/\oriex}%
- \ctikzset{bipoles/thickness=1,
- resistors/scale=\myscale, capacitors/scale=\myscale,
- diodes/scale=\myscale, transistors/scale=\myscale,
- grounds/scale=\myscale, csources/scale=\myscale,
- sources/scale=\myscale, batteries/scale=\myscale,
- instruments/scale=\myscale, inductors/scale=\myscale,
- electromechanicals/scale=\myscale,
- %current arrow scale=16*\myscale*\myscale,%<-?
- mechanicals/scale=\myscale, use fpu reciprocal}%
- \tikzset{line width= {\myscale*0.4pt}, x=1cm*1em/\oriem, y=1cm*1ex/\oriex}}}}
- \begin{document}
- \tiny
- %\begin{adjustbox}{width=1\linewidth} % don't use with standalone
- \begin{tikzpicture}[
- line width = 0.175ex,% thick
- x=3em, y=3em, %<- this scales with the font size
- %scale = 0.5, transform shape,
- damper/.style={very thick,
- decorate,
- decoration={markings,
- mark connection node=dmp,
- mark=at position 0.5 with
- {
- \node (dmp) [very thick, inner sep=0pt,
- transform shape,
- minimum width=2em,
- minimum height=1.5em, draw=none,
- #1] {};
- \draw [very thick] ([xshift=0.5em]dmp.north east) --
- (dmp.north west) -- (dmp.south west) --
- ([xshift=0.5em]dmp.south east)
- ([yshift=-0.25em]dmp.north east) --
- ([yshift=0.25em]dmp.south east);
- }}},]
- %
- \draw[line width = 0.15ex] (0,2) coordinate[label={[yshift=-0.2ex]below:{$+$}}] (TL)to[ R=$R_a$, o-] ++(2,0)
- to[short,f=$i_a$] ++(0.1,0)
- to[L,cute inductor, l=$L_a$,-.] ++(2,0)
- to[Telmech=M, name=M1] ++(0,-2)
- to[short,.-o] (0,0) coordinate[label={[yshift=-0.2ex]above:{$-$}}] (ML);
- \path (TL) -- node[midway]{$E_a$} (ML);
- %
- \path (M1) ++ (2,0) coordinate (N1);
- \draw[very thick] (M1) -- pic[pic text={$T_m,\theta_m$}]{rotarrow} (N1) pic[very thick]{bar};
- %
- \draw[very thick] ([yshift=-4.5em]N1) coordinate (N2) pic[very thick]{bar=0.90}
- -- ++ (-1,0) coordinate (N3) pic[very thick]{bar=0.45};
- %
- \draw[very thick] ([yshift=-4em]N3) pic[very thick]{bar=0.775}
- -- pic[pic text={$\theta_L$}, pos=0.5 ]{rotarrow} % xscale=-1 to reflect
- ++ (-1,0) node[anchor=top, cylinder, black, shape border rotate=0, draw, minimum height=4em, minimum width=2em, aspect=0.4,
- cylinder uses custom fill, cylinder end fill = gray!20,
- path picture={\draw($(c.before top)!0.5!(c.after top)$) -- (c.top);}]
- (c) {$J_L$};
- %
- \path (TL|-c) node[draw, rectangle, minimum height=5em, minimum width = 1.5em, anchor=west, preaction = {fill=gray!10},
- brick fill={height=1.0em, width=1.0em, style/.style={draw=black}}
- %pattern={Bricks[brick width=1.01em, brick height=1.01em]}
- ](bricks) {};
- %
- \draw [damper={label={below:{$D_L$}}}] (c.west) -- (bricks);
- %
- \end{tikzpicture}
- %\end{adjustbox}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement