tet_cut1.py 411 B

1234567891011121314151617
  1. """Cut a TetMesh with an arbitrary polygonal Mesh"""
  2. from vedo import *
  3. sphere = Sphere(r=500).x(400)
  4. sphere.color('green5', 0.2).wireframe()
  5. tmesh = TetMesh(dataurl + 'limb.vtu')
  6. print(tmesh)
  7. ugrid = tmesh.cut_with_mesh(sphere, invert=True).cmap("Reds_r")
  8. print(ugrid)
  9. # We may cast the output to a new TetMesh:
  10. # tmesh_cut = TetMesh(ugrid)
  11. # print(tmesh_cut)
  12. show(ugrid, sphere, __doc__, axes=1).close()