discussion_716.py 299 B

1234567891011121314151617
  1. from vedo import *
  2. msh = Polygon(nsides=5)
  3. pts = utils.pack_spheres(msh, radius=0.1)
  4. # optionally add some noise:
  5. jitter = np.random.randn(len(pts),3)/1000
  6. jitter[:,2] = 0
  7. pts += jitter
  8. pts = Points(pts)
  9. pts.cut_with_line(msh.vertices) # needs an ordered set of points
  10. show(msh, pts, axes=1)