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
2
Angolan Flag
By
Samrudh N
Run
#Country: Republic of Angola #Description: Representing Angolan Flag. #version: 1.0.0 #Status: Completed #Comments: Need to arrange the code neatly. #Co-ordinate points for the star. p1 = point(x=0,y=30) p2 = point(x=-10,y=0) p3 = point(x=10,y=0) #Masking - adding colored background masks to cover extra portions or parts of shapes that are not needed. red_upper_mask = rectangle(x=-75,y=75,w=142, h=150, fill="#C8102E",stroke="none") black_lower_mask = rectangle(x=-75,y=-16,w=150, h=32, fill="#000000",stroke="none") black_sword_mask = rectangle(x=30,y=-20,w=95, h=18, fill="#000000",stroke="none") | rotate(328) sword_tip_red_circle_mask = circle(fill="#C8102E", stroke="none") |scale(0.12) |translate(-23,11.5) #Individual components of the Angolan flag. red_rectangle = rectangle(y=75,w=300, h=150, fill="#C8102E",stroke="none") black_rectangle = rectangle(y=-75,w=300, h=150, fill="#000000",stroke="none") #base flag color base_flag_color = red_rectangle + black_rectangle #yellow emblem outer circle yellow_circle = circle(r=50, stroke="#FFCD00", stroke_width=9) yellow_ridge = rectangle(x=5,y=53,w=14,h=12,fill="#FFCD00",stroke="none") | repeat(15, rotate(30)) | scale(0.99) yellow_circle_emblem = yellow_circle + yellow_ridge #components of the sword emblem. yellow_sword_rectangle = rectangle(x=20,y=-20,w=110, h=11,fill="#FFCD00",stroke="none") | rotate(328) yellow_sword_handle_rectangle = rectangle(x=91,y=-22,w=20, h=10,fill="#FFCD00",stroke="none") | rotate(329) yellow_sword_handle_knob = ellipse(w=100,h=80,fill="#FFCD00", stroke="none") |scale(0.17) | rotate(300) | translate(x=76,y=-74) #yellow sword handle components combined yellow_sword_handle = yellow_sword_handle_rectangle + yellow_sword_handle_knob | translate(-2,2) yellow_sword_tip_circle = circle(fill="#FFCD00", stroke="none") |scale(0.12) |translate(-35,6) #yellow_sword components combined yellow_sword = yellow_sword_rectangle + yellow_sword_handle + yellow_sword_tip_circle #yellow star triangle = polygon([p1,p2,p3], fill="#FFCD00", stroke="none") |repeat(5, rotate(72)) star = triangle |scale(0.7) |translate(0,20) #black lining on the sword sword_line = line(stroke_width=5) | rotate(329.5) | scale(0.4) |translate(24,-35) #combine all the various shapes and assign them to a single variable. angolan_flag = base_flag_color + yellow_circle_emblem + red_upper_mask + black_lower_mask + black_sword_mask + yellow_sword + sword_tip_red_circle_mask + star + sword_line #display the flag. show(angolan_flag)
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login