-
Notifications
You must be signed in to change notification settings - Fork 0
/
Wsectionplot.py
44 lines (39 loc) · 1.47 KB
/
Wsectionplot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
def WSSectionPlot(secID, matID, d, bf, tf, tw, nfdw, nftw, nfbf, nftf, orient="Strong"):
if (orient == "Weak"):
dw = d-2*tf
z1 = -d/2
z2 = -dw/2
z3 = dw/2
z4 = d/2
y1 = bf/2
y2 = tw/2
y3 = -tw/2
y4 = -bf/2
fib_sec_1 = [['section', 'Fiber', 1],
['patch', 'quad',matID, nfbf, nftf, *[y1,z3], *[y1,z4], *[y4,z4], *[y4,z3]],
['patch', 'quad',matID, nftw, nfdw, *[y2,z3], *[y3,z3], *[y3,z2], *[y2,z2]],
['patch', 'quad',matID, nfbf, nftf, *[y1,z1], *[y1,z2], *[y4,z2], *[y4,z1]],
]
matcolor = ['r', 'lightgrey', 'gold', 'w', 'w', 'w']
opsv.plot_fiber_section(fib_sec_1, matcolor=matcolor)
plt.axis('equal')
plt.show()
else:
dw = d-2*tf
y1 = -d/2
y2 = -dw/2
y3 = dw/2
y4 = d/2
z1 = -bf/2
z2 = -tw/2
z3 = tw/2
z4 = bf/2
fib_sec_1 = [['section', 'Fiber', 1],
['patch', 'quad',matID, nfbf, nftf, *[y1,z4], *[y1,z1], *[y2,z1], *[y2,z4]],
['patch', 'quad',matID, nftw, nfdw, *[y2,z3], *[y2,z2], *[y3,z2], *[y3,z3]],
['patch', 'quad',matID, nfbf, nftf, *[y3,z4], *[y3,z1], *[y4,z1], *[y4,z4]],
]
matcolor = ['r', 'lightgrey', 'gold', 'w', 'w', 'w']
opsv.plot_fiber_section(fib_sec_1, matcolor=matcolor)
plt.axis('equal')
plt.show()