You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

188 lines
6.4KB

  1. %&tex
  2. \documentclass{standalone}
  3. \usepackage{tikz}
  4. \usepackage{siltex}
  5. \usetikzlibrary {calc,arrows.meta,positioning,patterns,math}
  6. %\input{graphics/tics.tikz}
  7. \begin{document}
  8. \begin{tikzpicture}[on grid, x=0.75cm, y=0.75cm]
  9. % Define Drawing Box dimentions
  10. \def \boxheight {5};
  11. \def \boxwidth {6};
  12. \def \boxorigin {(-\boxwidth/2,-1)};
  13. \def \boxsize {(\boxwidth,\boxheight)};
  14. \def \armcolor {gray};
  15. \def \jointred {\draw[fill=orange] (0,0) circle(0.4);}
  16. \def \jointblue {\draw[fill=blue] (0,0) circle(0.4);}
  17. \def \width {0.3};
  18. \def \length {5};
  19. \def \holediameter {0.10};
  20. \def \floorheight {0.5};
  21. \pgfmathsetmacro{\floorwidth}{4};
  22. \def \arm {
  23. \draw[fill=\armcolor] (0,0) ++(0,\width/2) arc[start angle=90, end angle=270, radius=\width/2] -- ++(\length,0) arc[start angle=-90, end angle=90, radius=\width/2] -- cycle;
  24. \draw[fill=white] (0,0) circle (\holediameter/2);
  25. \draw[fill=white] (\length,0) circle (\holediameter/2);
  26. }
  27. \def \doublescara {
  28. \pgfmathsetmacro{\C}{sqrt(pow(\A,2)+pow(\B,2)-2*\A*\B*cos(\c))};
  29. \pgfmathsetmacro{\b}{acos((pow(\A,2) + pow(\C,2) - pow(\B,2))/(2*\A*\C))};
  30. \pgfmathsetmacro{\d}{180-\h-\b};
  31. \pgfmathsetmacro{\D}{sqrt(pow(\C,2)+pow(\B,2)-2*\B*\C*cos(\d))};
  32. \pgfmathsetmacro{\g}{acos(\D/(2*\B))};
  33. \pgfmathsetmacro{\f}{acos((pow(\D,2) + pow(\B,2) - pow(\C,2))/(2*\D*\B))};
  34. \pgfmathsetmacro{\a}{180-\b-\c};
  35. \pgfmathsetmacro{\e}{180-\d-\f};
  36. \pgfmathsetmacro{\k}{180-\f-\g};
  37. \pgfmathsetmacro{\m}{180-\g-\e-\a};
  38. \begin{scope}[shift={(-\A/2,0)}, rotate=\c]
  39. \jointred
  40. \def \length{\B}
  41. \arm
  42. \begin{scope}[shift={(\B,0)}, rotate=-\m]
  43. \def \length{\B}
  44. \arm
  45. \end{scope}
  46. \end{scope}
  47. \begin{scope}[shift={(\A/2,0)}, rotate=\h]
  48. \jointblue
  49. \def \length{\B}
  50. \arm
  51. \begin{scope}[shift={(\B,0)}, rotate=\k]
  52. \def \length{\B}
  53. \arm
  54. \end{scope}
  55. \end{scope}
  56. };
  57. \tikzset{arm/.pic={
  58. \def \length {#1}
  59. \draw[fill=gray] (0,0) ++(0,\width/2) arc[start angle=90, end angle=270, radius=\width/2] -- ++(\length,0) arc[start angle=-90, end angle=90, radius=\width/2] -- cycle;
  60. \draw[fill=white] (0,0) circle (\holediameter/2);
  61. \draw[fill=white] (\length,0) circle (\holediameter/2);
  62. },
  63. floor/.pic={
  64. \def \width {#1/2};
  65. \draw (-\width,0) -- (\width,0);
  66. \fill[pattern=north west lines] (-\width,-\floorheight) rectangle (\width,0);
  67. },
  68. box/.pic={
  69. \draw \boxorigin rectangle ++\boxsize;
  70. }
  71. };
  72. \pgfmathsetmacro{\B}{2.3};
  73. \pgfmathsetmacro{\A}{1};
  74. \def \nodepos {(2.4,3.4)};
  75. %rechts boven
  76. \begin{scope}[shift={(1*\boxwidth,1*\boxheight)}]
  77. \node at \nodepos {2.};
  78. \draw (0,0) pic {box};
  79. \draw (0,0) pic {floor=2};
  80. %\pgfmathsetmacro{\c}{90};
  81. %\pgfmathsetmacro{\h}{40};
  82. %\def \armcolor{lightgray};
  83. %\doublescara;
  84. \pgfmathsetmacro{\c}{130};
  85. \pgfmathsetmacro{\h}{60};
  86. \def \armcolor{gray};
  87. \doublescara;
  88. \end{scope}
  89. % Links boven
  90. \begin{scope}[shift={(0*\boxwidth,\boxheight)}]
  91. \node at \nodepos {1.};
  92. \draw (0,0) pic {box};
  93. \draw (0,0) pic {floor=2};
  94. \begin{scope}[shift={(0,0)}, rotate=120]
  95. \jointred
  96. \def \length{\B}
  97. \arm
  98. \begin{scope}[shift={(\B,0)}, rotate=-100]
  99. \jointblue
  100. \def \length{\B}
  101. \arm
  102. \end{scope}
  103. \end{scope}
  104. \end{scope}
  105. %rechts onder
  106. \begin{scope}[shift={(\boxwidth,0*\boxheight)}]
  107. \node at \nodepos {4.};
  108. \draw (0,0) pic {box};
  109. \draw (0,0) pic {floor=2};
  110. \def \a {105};
  111. \def \b {5};
  112. \def \c {\b-\a};
  113. \def \C {1};
  114. \def \B {2.5};
  115. \def \A {3};
  116. \begin{scope}[shift={(0,0)}, rotate=180+\b]
  117. \jointblue
  118. \def \length{\C}
  119. \begin{scope}[shift={(\length,0)}, rotate=-(180+\c)]
  120. \def \length{\A}
  121. \arm
  122. \begin{scope}[shift={(\length,0)}, rotate=\c]
  123. \def \length{\B+\C}
  124. \arm
  125. \end{scope}
  126. \end{scope}
  127. \arm
  128. \end{scope}
  129. \begin{scope}[shift={(0,0)}, rotate=\a]
  130. \def \length{\A}
  131. \arm
  132. \end{scope}
  133. \begin{scope}[shift={(\C,0)}, rotate=\a]
  134. \jointred
  135. \def \length{\C}
  136. \begin{scope}[shift={(\length,0)}, rotate=-180-\a]
  137. \def \length{\C}
  138. \arm
  139. \end{scope}
  140. \arm
  141. \end{scope}
  142. \end{scope}
  143. % Links onder
  144. \begin{scope}[shift={(0,0)}]
  145. \node at \nodepos {3.};
  146. \draw (0,0) pic {box};
  147. \draw (0,0) pic {floor=2};
  148. \def \a {105};
  149. \def \b {5};
  150. \def \c {\b-\a};
  151. \def \C {1};
  152. \def \B {2.5};
  153. \def \A {3};
  154. \begin{scope}[shift={(0,0)}, rotate=180+\b]
  155. \draw[fill=blue] (0,0) circle(0.5);
  156. \def \length{\C}
  157. \begin{scope}[shift={(\length,0)}, rotate=-(180+\c)]
  158. \def \length{\A}
  159. \arm
  160. \begin{scope}[shift={(\length,0)}, rotate=\c]
  161. \def \length{\B+\C}
  162. \arm
  163. \end{scope}
  164. \end{scope}
  165. \arm
  166. \end{scope}
  167. \begin{scope}[shift={(0,0)}, rotate=\a]
  168. \jointred
  169. \def \length{\A}
  170. \arm
  171. \end{scope}
  172. \end{scope}
  173. \end{tikzpicture}
  174. \end{document}