cut_and_cap.py 422 B

12345678910111213
  1. """Cut a mesh with an other mesh and cap the holes"""
  2. from vedo import dataurl, Plotter, Mesh, Sphere
  3. msh1 = Mesh(dataurl+'motor.byu')
  4. cutmesh = Sphere().y(-0.4).scale(0.4).wireframe().alpha(0.1)
  5. msh2 = msh1.clone().cut_with_mesh(cutmesh)
  6. redcap = msh2.cap(return_cap=True).color("r4")
  7. plt = Plotter(N=2, axes=1)
  8. plt.at(0).show(msh1, cutmesh, __doc__)
  9. plt.at(1).show(msh2, redcap, viewup="z")
  10. plt.interactive().close()