What I would like to have is a plot of rectangular cuboids that are made up of boundary points. Here is a visual of the points, and below it, a simple visual of what I want (but with all rectangles, not just one as drawn).
Is there a simple way to either get wireframe connecting each point, or filled in space between the points so that each set of points looks like a cuboid?
I have read this thread, and when I attempt to execute the below code I simply get an empty figure back. However, if I execute the code in the aforementioned thread, I see the same visual that they got. With my code, I simply changed the variables, but aren't seeing anything.
#!/usr/bin/env python3
import meshio
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
import numpy as np
import glob
import matplotlib.cm as cm
import matplotlib.ticker as ticker
import pandas as pd
import glob
files = sorted(glob.glob('/path/to/vtk/files/*.vtk'))
fig = plt.figure(figsize=(16,10)) #create figure entity
ax = Axes3D(fig)
colors = iter(cm.rainbow(np.linspace(0, 1, len(files))))
for fyle in files:
mesh = meshio.read(fyle)
pts = mesh.points.T
xmin, xmax = pts[0].min(), pts[0].max()
ymin, ymax = pts[1].min(), pts[1].max()
zmin, zmax = pts[2].min(), pts[2].max()
xc = [xmin, xmax, xmin, xmax, xmax, xmin, xmin, xmax]
yc = [ymin, ymin, ymax, ymax, ymin, ymin, ymax, ymax]
zc = [zmin, zmin, zmin, zmin, zmax, zmax, zmax, zmax]
verts = [list(zip(xc, yc, zc))]
ax.add_collection3d(Poly3DCollection(verts))
#coords = np.array((xc, yc, zc))
#ax.scatter(*coords, c=[next(colors)]) #plot of x,y,z points
plt.show(