Explore
Courses
Batches
Sketches
Statistics
Code a Pookkalam
Jobs
Devsprint
People
Course Creation
Create a Course
Guidelines
Resources
Support
Blogs
My Profile
About Us
Login
Sketches
0
Christmas
By
K S ABHISHEK
Run
#Background for i in range(160): red=color(r=i+40,g=i+50,b=i+160) c=circle(x=0, y=0, fill=red, r=220-i, stroke="none") show(c) #Tree def tree(): n=polygon((point(-150,-135),point(-50,-135),point(-100,50)),fill='#006400',stroke='none') n1=polygon((point(-150,-135),point(-50,-135),point(-100,50)),fill='#8B4513',stroke='none') | scale(0.2) | translate(-80,-130) return combine((n1,n)) y=tree() show(y) #Star e=ellipse(w=5,h=19,fill='white',stroke='none')|repeat(3,rotate(60))|translate(-100,45) for i in range(5): e1=e|translate(y=-i*40) show(e1) #Snowman h= ellipse(-36,-115,h=5,w=20,fill='black')|rotate(-10) h1= rectangle(x=-47,y=-104,h=10,w=9,fill='black')|rotate(-4) c = circle(r=15,y=-75,fill='black') +circle(r=12,y=-72,x=2,fill='white') c1=c|translate(-60,-60) c2 = c1|translate(x=-17,y=-20)|scale(3/4) show(c1,c2,h,h1) r1=0.5 y1=-130 for i in range(1,4): c4 = circle(r=r1,y=y1,x=-58,fill='black') r1+=0.5 y1+=-5 show(c4) x1=-27 for i in range(1,3): c5=circle(r=1,x=x1,y=-123,fill='black')|rotate(-15) x1+=6 show(c5) #Gift def gift(): q=rectangle(w=25,h=25,stroke_width=1,fill='#DC143C') + rectangle(y=15,h=6,w=33,stroke_width=1,fill='#DC143C') + rectangle(y=3,h=30,w=7,stroke_width=2,fill='#00CED1',stroke='none') q1=q | translate(-130,-139) q2=ellipse(w=5,h=19,fill='#00CED1',stroke='none')|rotate(80)|translate(-140,-117) q3=q2|scale(x=-1)|translate(x=-263) return combine((q1,q2,q3)) x=gift() show(x) l=polygon((point(-150,130),point(150,130))) show(l) l1=polygon((point(-130,130),point(-130,105))) for i in range(7): l2=l1|translate(x=i*43) show(l2) def gift1(): q=rectangle(w=20,h=20,stroke_width=1,fill='green') + rectangle(y=13,h=5,w=26,stroke_width=1,fill='green') + rectangle(y=2,h=26,w=5,stroke_width=2,fill='red',stroke='none') q1=q | translate(-130,90) q2=ellipse(w=4,h=12,fill='red',stroke='none')|rotate(80)|translate(-137,108) q3=q2|scale(x=-1)|translate(x=-260) return combine((q1,q2,q3)) z=gift1() for i in range(7): z1=z|translate(x=i*43) show(z1) #ball for i in range(40): f=color(r=i+220,g=i+20,b=i+60) c=circle(x=0, y=0, fill=f, r=25-i/2, stroke="none") c1=c|translate(y=88) show(c1) #White ball j=circle(-130,130,r=6,fill='white',stroke='none') for i in range(7): j1=j|translate(i*43) show(j1) #Candles v=rectangle(w=20,h=25,fill='red',stroke_width=1.5)+ellipse(y=20,w=6,h=15,fill='yellow',stroke='none') v1=v|translate(y=-138) for i in range(5): v2=v1|translate(x=i*30) show(v2) def bell(): n=polygon((point(-25,-10),point(-25,-50),point(-40,-60),point(-40,-80),point(40,-80),point(40,-60),point(25,-50),point(25,-10)),fill='gold',stroke_width=2) n1=ellipse(w=80,h=20,fill='orange',stroke_width=2)+circle(y=3,r=7,fill='#FF8C00',stroke_width=2) n2=n1|translate(y=-80) n3=rectangle(-19,-31,w=6,h=34,stroke='none',fill='white') n4=ellipse(y=-9,h=30,w=20,stroke_width=2,fill='gold')+ellipse(y=-10,h=20,w=10,stroke_width=2,fill='white',stroke='none') return n4+n+n2+n3 n5=bell() n6=n5|scale(0.8)|rotate(-30)|translate(48,-2) n7=n6|scale(x=-1)|translate(x=99) show(n6,n7)
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login