beam1.py 969 B

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