25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

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