I've been able to use the lewiner marching cubes algorithm in python. It outputs vertices, faces, and other attributes. I want to be sure that it is working correctly, so I'd like to plot a 3D image of what the function returns. However, I have not had any success so far. I have tried the following:
Successful retrieval of necessary fields:
verts, faces, normals, values = skimage.measure.marching_cubes_lewiner(var,20,spacing=(0.5,0.5,0.5))
And unsuccessful plots of the retrieved values:
fig = plt.figure(figsize=(10, 10))
ax = fig.add_subplot(projection='3d')
mesh = Poly3DCollection(verts[faces])
mesh.set_edgecolor('k')
ax.add_collection3d(mesh)
And also:
vv.mesh(np.fliplr(verts), faces, normals, values) # doctest: +SKIP
Hypothetically, I would like to use the verts, faces, etc in a machine-learning algorithm, but I'd like to be sure that the returned values are reliable. Any one have experience with anything like this?