extrude.py 561 B

12345678910111213141516
  1. """Extruding a polygon along the z-axis"""
  2. from vedo import Star, show
  3. # Create a yellow star and rotate it around the x-axis
  4. star = Star().color('y')
  5. # Extrude the star along the z-axis, with a shift of 1,
  6. # a rotation of 10 degrees, a decrease in radius of 0.2,
  7. epol = star.extrude(zshift=1, rotation=10, dr=-0.2, cap=False, res=1)
  8. # Set the back color of the extruded polygon to violet
  9. epol.bc('violet').lighting("default")
  10. # Show the extruded polygon, the script docstring, axes,
  11. # then close the window
  12. show(epol, __doc__, axes=1, viewup='z').close()