drainingtank.yml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. !!omap
  2. - name: tank
  3. - parts:
  4. - name: head
  5. shapes:
  6. libraries: ['from math import sqrt, tan, radians, degrees, sin, cos, atan2, pi', 'import numpy as np', 'from pysketcher import *']
  7. - name: constants
  8. shapes: # MKS system in use
  9. H: 2.0 # Total Tank heigth
  10. l: 1.0 # Tank width
  11. ratio: 0.3 # ratio (elipsis small radius = 30% of big radius)
  12. d_l: 0.2 # draining tub length
  13. d_d: 0.05 # draining tube diameter
  14. d_o: 0.1 # tube offset from tank base
  15. e: 0.01 # for filling effect
  16. g: 9.81 # gravity constant
  17. - name: variables
  18. shapes:
  19. h: 1.0 # Current tank heigth
  20. V: sqrt(2*g*(h-d_o))
  21. X: np.linspace(0.0, 2.0, 20)
  22. Y: -g/2*(X/V)**2
  23. - name: frame
  24. shapes:
  25. setframe:
  26. action: drawing_tool.set_coordinate_system(xmin=-l*1.2, xmax=l*3,
  27. ymin=-H, ymax= H,
  28. axis=False)
  29. - name: scene
  30. shapes:
  31. shell:
  32. formula: Rectangle( point(-(l/2),-(H/2)), l, H)
  33. style:
  34. linecolor: black
  35. linewidth: 2
  36. tube:
  37. formula: Rectangle( point( +(l/2), -(H/2)+d_o), d_l, d_d )
  38. style:
  39. linecolor: black
  40. linewidth: 2
  41. interieur:
  42. formula: Rectangle( point(-(l/2)+e,-(H/2)), l-2*e, h)
  43. style:
  44. linecolor: blue
  45. linewidth: 1
  46. filled_curves:
  47. color: blue
  48. vidange:
  49. formula: Rectangle( point( +(l/2), -(H/2)+d_o+e), d_l, d_d-2*e )
  50. style:
  51. linecolor: blue
  52. linewidth: 2
  53. filled_curves:
  54. color: blue
  55. hauteur:
  56. formula: Distance_wText(Point(-(l/2)*1.3,-(H/2)),Point(-(l/2)*1.3,H/2),r'$H$', alignment = 'right', text_spacing=-0.03)
  57. style:
  58. linecolor: 'black'
  59. linewidth: 1
  60. hc:
  61. formula: Distance_wText(Point(-(l/2)*2,-(H/2)),Point(-(l/2)*2,h-(H/2)),r'$h$', alignment = 'right', text_spacing=-0.05)
  62. style:
  63. linecolor: 'black'
  64. linewidth: 1
  65. largeur:
  66. formula: Distance_wText(Point(-(l/2),+(H/2)*1.2),Point((l/2),(H/2)*1.2),r'$l$', alignment = 'left', text_spacing=1/60)
  67. style:
  68. linecolor: 'black'
  69. linewidth: 1
  70. jet:
  71. formula: Curve(X+(l/2+d_l),Y-(H/2)+d_o+d_d/2)
  72. style:
  73. linecolor: 'blue'
  74. linewidth: 2
  75. contenu: |
  76. Composition({ 'interieur': interieur, 'vidange': vidange})
  77. frame: |
  78. Composition({ 'shell':shell, 'tube': tube })
  79. dim: |
  80. Composition({ 'hauteur': hauteur, 'hc': hc, 'largeur': largeur})
  81. tank: |
  82. Composition({ 'frame':frame, 'contenu': contenu, 'dim':dim, 'jet':jet })