6

My code:

\documentclass{scrartcl}
\usepackage{stanli}
\begin{document}

  \begin{tikzpicture}
    %the points
    \point{above}{0}{5};
    \point{above_middle}{0}{4};
    \point{below_middle}{0}{1};
    \point{below}{0}{0};
    %the rod
    \beam{2}{above}{above_middle};
    \beam{2}{below}{below_middle};
    %the support
    \support{1}{above}[180];
    \hinge{1}{above};
    %the mass
    \node at (below) [circle, draw] {$m$};
    %the free body diagram (for the rod)
    %S
    \point{S}{0}{3};
    \load{1}{S}[90];
    \notation{1}{S}{$S$};
    %-S
    \point{-S}{0}{2};
    \load{1}{-S}[-90];
    \notation{1}{-S}{$S$}[below right];
  \end{tikzpicture}

\end{document}

The result:

result

The ball is behind the rod. I don't know why. It should be in front of the rod. How can one manipulate the layers of the pictures? A completely different solution is welcome too.

Thank you for your help and effort in advance!

2 Answers 2

7

If you're talking about the circle with the m in it, it is not behind the rod, but it isn't filled either -- it consists of a black circle with the letter m in it. Add fill=white to the node settings.

output of code

\documentclass{scrartcl}
\usepackage{stanli}
\begin{document}

  \begin{tikzpicture}
    %the points
    \point{above}{0}{5};
    \point{above_middle}{0}{4};
    \point{below_middle}{0}{1};
    \point{below}{0}{0};
    %the rod
    \beam{2}{above}{above_middle};
    \beam{2}{below}{below_middle};
    %the support
    \support{1}{above}[180];
    \hinge{1}{above};
    %the mass
    \node at (below) [circle, draw,fill=white] {$m$}; % <----- added fill=white
    %the free body diagram (for the rod)
    %S
    \point{S}{0}{3};
    \load{1}{S}[90];
    \notation{1}{S}{$S$};
    %-S
    \point{-S}{0}{2};
    \load{1}{-S}[-90];
    \notation{1}{-S}{$S$}[below right];
  \end{tikzpicture}
2
  • What does stanli do? I've never heard of it. Presumably, a TikZ-based package for something?
    – cfr
    Dec 2, 2017 at 21:21
  • 3
    @cfr texdoc stanli -> "TikZ library for structural analysis". Dec 2, 2017 at 21:22
2

A PSTricks solution.

\documentclass[pstricks]{standalone}
\usepackage{pst-node}

\begin{document}
\begin{pspicture}(-1,.2)(1,-4.4)
    % top part
    \psframe[fillstyle=vlines,hatchsep=1pt,linestyle=none](-1,.2)(1,0)
    \psline(-1,0)(1,0)
    \pnode(-.5,0){L}
    \pnode(.5,0){R}
    \pnode(0,-2){S}
    \rput(0,-1){\Cnode[radius=5pt]{C}}
    \ncline{L}{C}
    \ncline{C}{R}
    \ncline{->}{C}{S}
    \naput[npos=1]{$S$}
    % bottom part
    \pnode(0,-3){S'}
    \rput(0,-4){\Circlenode[radius=10pt]{m}{$m$}}
    \ncline{->}{m}{S'}\nbput[npos=1]{$S$}
\end{pspicture}
\end{document}

enter image description here

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.