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
More and more teddy bears
By
Anand Chitipothu
Run
# Something similar to the square limit of escher, but without rotations # Still work in progress # Teddy by Shreyas M Pillai # https://mon.school/sketches/1125326 # Modified it a bit lift one of its hand. e=ellipse(w=55,h=30,fill='white',stroke='none') a=e | translate(y=5) s=ellipse(w=50,h=36,fill='black')+ e + a t=s | translate(y=75) w=t | translate(x=0,y=-45) l1=line(x1=0,y1=0,x2=0,y2=16) l2=l1 | translate(y=15) l3=l2 | translate(x=0.3) o=ellipse(y=35,w=20,h=10,fill='black') q=ellipse(w=30,h=25,fill='black') r=q | translate(x=-5,y=60) p=r | rotate(20) c1=circle(r=8,fill='white',stroke='none') c2= c1 | translate(x=-18.7,y=57) c3=circle(r=4,fill='black') c4= c3 | translate(x=-18,y=57) c5=p+c2+c4 c5=c5 | rotate(-2) c6=c5 | scale(x=-1) d=ellipse(x=35,y=-30,w=25,h=70,fill="black") | rotate(35) e=ellipse(x=-35,y=-30,w=25,h=70,fill="black") | rotate(-90) | translate(x=-30,y=-25) f=ellipse(x=23,y=-75,w=35,h=70,fill="black") g=ellipse(x=-23,y=-75,w=35,h=70,fill="black") c=ellipse(x=0,y=-25,w=90,h=110,fill='black')+ ellipse(x=0,y=-25,w=83,h=103,fill='white')+ellipse(x=0,y=50,w=110,h=100,fill='black')+ellipse(x=0,y=50,w=106,h=96,fill='white') el1=ellipse(w=38,h=30,fill='black') | translate(x=-20,y=103) el=el1 | rotate(12) el2=el | scale(x=-1) teddy = combine([el,el2,d,e,f,g,c,w,l2,l3,o,c5,c6]) def beside(a, b): a1 = a | scale(x=1/2) | translate(x=-75) b1 = b | scale(x=1/2) | translate(x=75) return a1 + b1 def below(a, b): a1 = a | scale(y=1/2) | translate(y=75) b1 = b | scale(y=1/2) | translate(y=-75) return a1 + b1 def grid(a, b, c, d): ab = beside(a, b) cd = beside(c, d) return below(ab, cd) def beside3(a, b, c): a1 = a | scale(x=1/3) | translate(x=-100) b1 = b | scale(x=1/3) c1 = c | scale(x=1/3) | translate(x=100) return a1 + b1 + c1 def below3(a, b, c): a1 = a | scale(y=1/3) | translate(y=100) b1 = b | scale(y=1/3) c1 = c | scale(y=1/3) | translate(y=-100) return a1 + b1 + c1 def grid9( p, q, r, s, t, u, v, w, x): return below3( beside3(p, q, r), beside3(s, t, u), beside3(v, w, x)) blank = circle(stroke="none") def rotate_args(args, n): for i in range(n): a, b, c, d = args args = [c, a, d, b] return args def side(n, shape, rotations=0): rotations = rotations%4 if n == 0: return blank else: args = [ shape, side(n-1, shape, rotations), shape, side(n-1, shape, rotations)] args = rotate_args(args, rotations) return grid(*args) def corner(n, shape, rotations=0): if n == 0: return blank else: args = [ side(n-1, shape, rotations-1), corner(n-1, shape, rotations), shape, side(n-1, shape, rotations)] args = rotate_args(args, rotations) return grid(*args) def with_rotation(func, n, shape, angle): return func(n, shape|rotate(angle)) | rotate(-angle) s = side(4, teddy) shape = grid9( with_rotation(corner, 4, teddy, 270), with_rotation(side, 4, teddy, 270), corner(4, teddy, 0), with_rotation(side, 4, teddy, 180), teddy, s, with_rotation(corner, 4, teddy, 180), with_rotation(side, 4, teddy, 90), with_rotation(corner, 4, teddy, 90)) show(shape)
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login