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
xachuzz Pookalam
By
xachuzz
Run
c = circle() show(c) def flower(r, colors, stroke="none"): c = circle(r=r*0.5, fill=colors[0], stroke=stroke) petals = ellipse(h=r*0.8, w=r*2, x=r, y=0, fill=colors[1], stroke = stroke) | repeat(10,rotate(36)) return petals + c def flower_ring(r_out, r_in, colors, stroke="none"): ring_width = r_out - r_in ring = circle(r=r_out, fill=colors[0], stroke=stroke) + circle(r=r_in, fill=colors[1], stroke=stroke) flower_radius = ring_width*0.25 n = (int)((r_out**2 - r_in**2) / (ring_width/1.65)**2) angle = 360/n f1 = (flower(flower_radius, colors[2:], stroke)) | translate(x=0, y=r_in+(ring_width/2)) flowers = f1 | repeat(n, rotate(angle)) return ring+flowers colors1 = [ ["white", color(252, 235, 2, 0.8)], ["white", "#ff0066"], ["white", "#800080"], ["white", "#820a0a"] ] colors2 =["#660066", "#cc0000", "#cc0099", "#ffcc00"] colors3 = ["#820a0a", "#ce0606", "#fc9802", "#fceb02"] colors4 = ["#660066", "#cc0000", "#ffcc00", "#ff0066"] n = 4 r = [i for i in range(40, 0, -10)] outer = combine([ rectangle(w=200,h=200,fill="#fceb02",stroke="none")|rotate(15)|repeat(20,rotate(50))|scale(0.98), rectangle(w=180,h=180,fill="#fc9802",stroke="none")|repeat(20,rotate(50)), rectangle(w=170,h=170,fill="#ce0606",stroke="none")|rotate(15)|repeat(20,rotate(50)), rectangle(w=150,h=150,fill="#820a0a",stroke="none")|repeat(20,rotate(50)) ]) f = [flower(r[i], colors1[i], stroke="gold") | repeat(n, rotate(60)| scale(0.8)) for i in range(n)] r1 = flower_ring(100, 75, colors2, "Red") r2 = flower_ring(150, 110, colors4, "brown") show(combine([r2, outer, r1, combine(f)]))
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login