mesh_smoother2.py 534 B

1234567891011121314151617181920
  1. """Smoothing a mesh"""
  2. from vedo import dataurl, Mesh, show
  3. s1 = Mesh(dataurl+'panther.stl').lw(1)
  4. s2 = s1.clone().x(50) # place at x=50
  5. s2.subdivide(3).smooth().compute_normals()
  6. s2.c('light blue').lw(0).lighting('glossy').phong()
  7. # other useful filters to combine are
  8. # mesh.decimate(), clean(), smooth()
  9. cam = dict(
  10. position=(113, -189, 62.1),
  11. focal_point=(18.3, 4.39, 2.41),
  12. viewup=(-0.0708, 0.263, 0.962),
  13. distance=223,
  14. )
  15. show(s1, s2, __doc__,
  16. bg='black', bg2='lightgreen', axes=11, camera=cam).close()