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
random balls
By
Salman Nazeer
Run
def grid(n): c_width = 300 width = 300 / n xstart = -150 + width/2 ystart = -150 + width/2 shapes = [] for i in range(n): for j in range(n): x = xstart + width * i y = ystart + width * j s = spheroid(300//n) | translate(x=x, y=y) | rotate(random(180)) shapes.append(s) return combine(shapes) def spheroid(r): shapes = [] col = random(0, 256) for i in range(r): shapes.append(circle(r=100*i/256, stroke=color(col-i, 256-i, 0))) return combine(shapes) show(grid(6))
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login