clone2d.py 688 B

12345678910111213141516171819202122
  1. """Make a static 2D clone copy of a mesh
  2. and place it in the rendering window"""
  3. from vedo import Mesh, dataurl, show
  4. man3d = Mesh(dataurl+'man.vtk')
  5. man3d.rotate_z(20).rotate_x(-70).scale(0.2)
  6. man3d.c('darkgreen').lighting('glossy')
  7. # Make a 2D snapshot of a 3D mesh
  8. # The coordinate system options are
  9. # 0. Displays
  10. # 1. Normalized Display
  11. # 2. Viewport (origin is the bottom-left corner of the window)
  12. # 3. Normalized Viewport
  13. # 4. View (origin is the center of the window)
  14. # 5. World (anchor the 2d image to mesh)
  15. # (returns a Actor2D)
  16. man2d = man3d.clone2d().coordinate_system(4).pos([0.4,0.4])
  17. man2d.c('red4')
  18. show(man3d, man2d, __doc__, axes=1).close()