File indexing completed on 2026-04-09 07:48:49
0001
0002 """
0003 CAUTION: this approach to 3d plotting is horribly slow
0004 and should only be used for very small geometries. For
0005 much better performance::
0006
0007 grep pyvista *.py
0008
0009 """
0010 import numpy as np
0011 import matplotlib.pyplot as plt
0012 from mpl_toolkits.mplot3d import Axes3D
0013 from mpl_toolkits.mplot3d.art3d import Poly3DCollection, Line3DCollection
0014
0015 def polyplot(ax, verts, faces):
0016 pcoll = Poly3DCollection(faces, linewidths=1, edgecolors='k')
0017 pcoll.set_facecolor((0,0,1,0.1))
0018 ax.add_collection3d(pcoll)
0019 ax.scatter(verts[:,0], verts[:,1], verts[:,2], s=0)
0020
0021 pass
0022
0023