ugrid2.py 397 B

12345678910
  1. """Cut an UnstructuredGrid with a plane"""
  2. from vedo import UnstructuredGrid, dataurl, show
  3. ug = UnstructuredGrid(dataurl+'ugrid.vtk').cmap("jet")
  4. ug = ug.cut_with_plane(origin=(5,0,1), normal=(1,1,5))
  5. show(repr(ug), ug, axes=1, viewup='z').close()
  6. # Shrink the UnstructuredGrid and create a Mesh
  7. msh = ug.shrink(0.9).tomesh().color('gold', 0.2)
  8. show(repr(msh), msh, axes=1, viewup='z').close()