Plotting meshΒΆ

[1]:
import pyvista as pv
from pyvista import examples

from pyvirtualdisplay import Display
import os
display = Display(visible=0, size=(1280, 1024))
display.start()
[1]:
<pyvirtualdisplay.display.Display at 0x7f8dac50ff40>
[2]:
mesh = examples.download_bunny_coarse()
cpos = [(0.2, 0.3, 0.9), (0, 0, 0), (0, 1, 0)]
mesh.plot(cpos=cpos, show_edges=True, color=True)
_images/bunny_2_0.png
[2]:
[(0.2, 0.3, 0.9),
 (0.0, 0.0, 0.0),
 (0.0, 1.0, 0.0)]
[3]:
mesh = pv.Sphere()
shrunk_mesh = mesh.shrink(shrink_factor=0.8)
p = pv.Plotter(shape=(1, 2))
p.subplot(0, 0)
p.add_text("Before Shrink")
p.add_mesh(mesh, color="tan", show_edges=True)
p.subplot(0, 1)
p.add_text("After Shrink")
p.add_mesh(shrunk_mesh, color="tan", show_edges=True)
p.show()
_images/bunny_3_0.png
[3]:
[(2.8332709368378763, 2.8332709368378763, 2.8332709368378763),
 (0.0, 0.0, 0.0),
 (0.0, 0.0, 1.0)]
[ ]: