-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplotCuboct.py
More file actions
53 lines (36 loc) · 967 Bytes
/
plotCuboct.py
File metadata and controls
53 lines (36 loc) · 967 Bytes
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
45
46
47
48
49
50
51
52
53
# plots one cuboct as a 3d line graph. Not sure how to integrate this with buildRectangles code for visualizations
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d.axes3d as p3
## node_locs is taken from Daniel Celluci's code pfea/src/cuboct.py
#Geometric Properties
#The location of nodes within a cubic unit cell
#Units are relative to the voxel pitch
'''node_locs = [[0.0,0.5,0.5],
[0.5,0.0,0.5],
[0.5,0.5,0.0],
[1.0,0.5,0.5],
[0.5,1.0,0.5],
[0.5,0.5,1.0]]'''
cuboct_verts = [(0.5,0.5,0.0),
(0.5,0.0,0.5),
(0.5,0.5,1.0),
(0.5,1.0,0.5),
(0.5,0.5,0.0),
(1.0,0.5,0.5),
(0.5,0.5,1.0),
(0.0,0.5,0.5),
(0.5,1.0,0.5),
(1.0,0.5,0.5),
(0.5,0.0,0.5),
(0.0,0.5,0.5),
(0.5,0.5,0.0)]
fig = plt.figure()
ax = p3.Axes3D(fig)
xs,ys,zs=[],[],[]
for (x,y,z) in cuboct_verts:
xs.append(x)
ys.append(y)
zs.append(z)
ax.plot(xs, ys, zs, zdir='z', c='b')
plt.show()