Changeset 2385
- Timestamp:
- Feb 13, 2006, 3:04:04 PM (19 years ago)
- Location:
- development/momentum_sink
- Files:
-
- 8 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
development/momentum_sink/rotate_buildings.py
r2379 r2385 18 18 19 19 # Boundary of problem 20 WidtH = 100 # width of boudary in metres20 WidtH = 200 # width of boudary in metres 21 21 #W = WidtH/8 22 22 #L = W … … 28 28 depth = 15 # depth of building side to oncoming wave 29 29 whs = depth/2 30 breadth = 20# breadth of building30 breadth = 15 # breadth of building 31 31 lhs = breadth/2 32 32 33 33 # Sample rotation Matrix 34 Thd = 30 # Degrees 35 Th = Thd * 3.14259/180 # Deg to Rad. 34 #Thd = 30 # Degrees 35 #Th = Thd * 3.14259/180 # Deg to Rad. 36 Th = (30 *(3.142/180)) 37 #wh1 = (-whs) * math.cos(Th) + (-lhs) * math.sin(Th) 38 #lh1 = (-lhs) * math.cos(Th) - (-whs) * math.sin(Th) 36 39 37 wh1 = (-whs) * math.cos(Th) + (-lhs) * math.sin(Th)38 lh1 = (-lhs) * math.cos(Th) - (-whs) * math.sin(Th)40 #wh2 = (+whs) * math.cos(Th) + (-lhs) * math.sin(Th) 41 #lh2 = (-lhs) * math.cos(Th) - (+whs) * math.sin(Th) 39 42 40 wh2 = (+whs) * math.cos(Th) + (-lhs) * math.sin(Th)41 lh2 = (-lhs) * math.cos(Th) - (+whs) * math.sin(Th)43 #wh3 = (+whs) * math.cos(Th) + (+lhs) * math.sin(Th) 44 #lh3 = (+lhs) * math.cos(Th) - (+whs) * math.sin(Th) 42 45 43 wh3 = (+whs) * math.cos(Th) + (+lhs) * math.sin(Th) 44 lh3 = (+lhs) * math.cos(Th) - (+whs) * math.sin(Th) 45 46 wh4 = (-whs) * math.cos(Th) + (+lhs) * math.sin(Th) 47 lh4 = (+lhs) * math.cos(Th) - (-whs) * math.sin(Th) 46 #wh4 = (-whs) * math.cos(Th) + (+lhs) * math.sin(Th) 47 #lh4 = (+lhs) * math.cos(Th) - (-whs) * math.sin(Th) 48 48 49 49 print "building footprint" … … 64 64 #Breadths = Breadths + BL/2 65 65 for B in Breadths: 66 wh1 = (-whs) * math.cos(Th) + (-lhs) * math.sin(Th) 67 lh1 = (-lhs) * math.cos(Th) - (-whs) * math.sin(Th) 68 wh2 = (+whs) * math.cos(Th) + (-lhs) * math.sin(Th) 69 lh2 = (-lhs) * math.cos(Th) - (+whs) * math.sin(Th) 70 wh3 = (+whs) * math.cos(Th) + (+lhs) * math.sin(Th) 71 lh3 = (+lhs) * math.cos(Th) - (+whs) * math.sin(Th) 72 wh4 = (-whs) * math.cos(Th) + (+lhs) * math.sin(Th) 73 lh4 = (+lhs) * math.cos(Th) - (-whs) * math.sin(Th) 66 74 polygon = [[D+wh1,B+lh1],[D+wh2,B+lh2],[D+wh3,B+lh3],[D+wh4,B+lh4]] 67 75 m.add_hole_from_polygon(polygon, tags={'wall':[0,1,2,3]})# Adds holes with reflective boundaries. 68 76 Th = Th + (37.3 *(3.142/180)) 77 69 78 70 79 #print polygon
Note: See TracChangeset
for help on using the changeset viewer.