Christmas tree with lights

In [1]:
var('t k')
from sage.plot.plot3d.shapes import *
In [2]:
# n = number of wraps
n=4
num_lights=30
c=rainbow(num_lights)
f(t) = ( (1-t)*cos(2*pi*t*n), (1-t)*sin(2*pi*t*n),t)
lights=add([point(f(1/(num_lights)*(k+1)),color=c[k],size=50) for k in range(0,num_lights)])

S = Cone(1, 1, color='green')
S += parametric_plot3d(f(t),(t,0,1),thickness=3  )
S += lights
In [3]:
S.show(frame=False)
In [ ]:
 
In [ ]: