beam1-checkpoint.py 991 B

123456789101112131415161718192021222324252627282930313233
  1. """A very simple beam."""
  2. from pysketcher import *
  3. L = 8.0
  4. H = 1.0
  5. xpos = 2.0
  6. ypos = 3.0
  7. drawing_tool.set_coordinate_system(xmin=0, xmax=xpos+1.2*L,
  8. ymin=0, ymax=ypos+5*H,
  9. axis=True)
  10. drawing_tool.set_linecolor('blue')
  11. drawing_tool.set_grid(True)
  12. drawing_tool.set_fontsize(22)
  13. P0 = point(xpos,ypos)
  14. main = Rectangle(P0, L, H)
  15. h = L/16 # size of support, clamped wall etc
  16. support = SimplySupportedBeam(P0, h)
  17. clamped = Rectangle(P0 + point(L, 0) - point(0,2*h), h, 6*h).set_filled_curves(pattern='/')
  18. F_pt = point(P0[0]+L/2, P0[1]+H)
  19. force = Force(F_pt + point(0,2*H), F_pt, '$F$').set_linewidth(3)
  20. L_dim = Distance_wText((xpos,P0[1]-3*h), (xpos+L,P0[1]-3*h), '$L$')
  21. beam = Composition({'main': main, 'simply supported end': support,
  22. 'clamped end': clamped, 'force': force,
  23. 'L': L_dim})
  24. beam.draw()
  25. beam.draw_dimensions()
  26. drawing_tool.display()
  27. #test_Dashpot(xpos+2*W)
  28. input()