我的代码:
\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}
结果:
球在杆后面。我不知道为什么。它应该在杆前面。如何操纵图片的层次?也欢迎完全不同的解决方案。
提前感谢您的帮助和努力!
答案1
如果您说的是带有 的圆圈m
,它不在杆后面,但也没有填充 - 它由一个带有字母的黑色圆圈组成m
。添加fill=white
到节点设置。
\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
PSTricks 解决方案。
\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}