xxxxxxxxxx
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)
w = warli(d=30) | scale(0.35) | translate(y=120) | repeat(100, rotate(30) | scale(0.96))
show(w)