cut_with_mesh1.py 569 B

1234567891011121314151617
  1. """Cut a mesh with another mesh"""
  2. from vedo import dataurl, settings, Plotter, Volume, Ellipsoid
  3. settings.tiff_orientation_type = 4 # data origin is bottom-left
  4. vol = Volume(dataurl + "embryo.tif")
  5. iso = vol.isosurface(30, flying_edges=False).normalize().pos(0,0,0)
  6. emsh = Ellipsoid().scale(0.4).pos(2.8, 1.5, 1.5).wireframe()
  7. # make a working copy and cut it with the ellipsoid
  8. cut_iso = iso.clone().cut_with_mesh(emsh).c("gold").bc("t")
  9. plt = Plotter(N=2, axes=1)
  10. plt.at(0).show(iso, emsh, __doc__)
  11. plt.at(1).show(cut_iso, viewup="z")
  12. plt.interactive().close()