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
1
warli in 16*16 grid
By
ARJUN
Run
r1 = rectangle(x=0,y=0,w=300,h=300,fill="lightblue") show(r1) def head(d): c = circle(x=0,y=2*d,r=d/2,stroke_width=5,fill="black") return(c) def body(d): p1 = point(x = 0 , y=0) p2 = point(x = d , y=d) p3 = point(x = -d , y=d) b=polygon([p1,p2,p3],stroke_width=5,fill="blue") b1=b|rotate(180) return(b+b1) def hands(d): h= line(x1=d,y1=d,x2=2*d,y2=0,stroke_width=5) + line(x1=2*d,y1=0,x2=3*d,y2=d,stroke_width=5) h1 = h | scale(x=-1) return(h+h1) def legs(d): l=line(x1=d/2,y1=-d,x2=d,y2=-2*d,stroke_width=5) + line(x1=d,y1=-2*d,x2=d/2,y2=-5*d/2,stroke_width=5) l1=line(x1=-d/2,y1=-d,x2=0,y2=-2*d,stroke_width=5)+line(x1=0,y1=-2*d,x2=-d/2,y2=-5*d/2,stroke_width=5) return(l+l1) def warli(d): a = head(d=d)+body(d=d)+hands(d=d)+legs(d=d) return(a) def beside(a, b): a1 = a | scale(x=0.5) | translate(x=-75) b1 = b | scale(x=0.5) | translate(x=75) return a1 + b1 def below(a, b): a1 = a | scale(y=0.5) | translate(y=75) b1 = b | scale(y=0.5) | translate(y=-75) return a1 + b1 def grid(a, b, c, d): return below( beside(a, b), beside(c, d)) def repeat256(shape): a = repeat64(shape) b = repeat4(a) return (b) def repeat64(shape): a = repeat16(shape) b = repeat4(a) return (b) def repeat16(shape): a = repeat4(shape) b = repeat4(a) return (b) def repeat4(shape): return grid(shape,shape,shape,shape) shape = repeat256(warli(50)) show(shape)
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login