3

I am going to draw a balance with a pivot (the triangle) and two pans (the T bars), as shown in the figure below. However, I was only able to draw the triangle, following this post.

How to draw the slope line with a certain angle?
How to draw the pans and the texts above them in right angles?

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}

\tikzset{
  pivot/.style={
    draw, 
    regular polygon, 
    regular polygon sides = 3, 
    fill = red, 
    node distance = 1cm, 
    minimum height = 2em
  }
}

\begin{document}
\begin{tikzpicture}
  \node () [pivot] {};
\end{tikzpicture}
\end{document}

balance

hengxin
  • 2,371

1 Answers1

5

Quick and dirty:

output of code

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}

\tikzset{
  pivot/.style={
    draw, 
    regular polygon, 
    regular polygon sides = 3, 
    fill = red, 
    node distance = 1cm, 
    minimum height = 2em,
    at = {(0,0)}
  }
}

\begin{document}
\begin{tikzpicture}
  \node [pivot] (a) {};

  \begin{scope}[rotate around={5:(a.corner 1)}]
   \draw (a.corner 1) -| ++(-3cm,5mm) node[transform shape,above] (t1) {Text 1};
   \draw (a.corner 1) -| ++(3cm,5mm) node[transform shape,above] (t2) {Text 2};
   \draw (t1.south east) -- (t1.south west);
   \draw (t2.south east) -- (t2.south west);
  \end{scope}
\end{tikzpicture}
\end{document}
Torbjørn T.
  • 206,688