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
Shape Manipulation Programs
By
Srikar
Run
def beside(s1, s2): s1 = s1|scale(x=0.5)|translate(x=-75) s2 = s2|scale(x=0.5)|translate(x=75) return s1+s2 def below(s1, s2): s1 = s1|scale(y=0.5)|translate(y=75) s2 = s2|scale(y=0.5)|translate(y=-75) return s1+s2 def grid(s1, s2, s3, s4): top = beside(s1, s2) bottom = beside(s3, s4) whole = below(top, bottom) return whole def repeat4(shape): return grid(shape, shape, shape, shape) def repeat16(shape): return repeat4(repeat4(shape)) def cycle(shape): return grid(shape|rotate(90), shape, shape|rotate(180), shape|rotate(270)) # c = circle() # r = rectangle() # e = ellipse() # l = line() #s=repeat4(repeat4(repeat4(c))) #show(s) # shape = circle()+ellipse()+circle(r=25, x=75) # anand = cycle(shape) # show(anand) show(repeat16(cycle(line(stroke_width=4))))
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login