44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
import math
|
|
|
|
cx, cy = 250, 250
|
|
R_in = 52
|
|
R_out = 188
|
|
|
|
A_left_in = -10
|
|
A_left_out = -16
|
|
A_right_in = 14
|
|
A_right_out = 34
|
|
|
|
color = "#ffffff"
|
|
|
|
|
|
def get_pt(r, angle_deg):
|
|
rad = math.radians(angle_deg)
|
|
return cx + r * math.sin(rad), cy - r * math.cos(rad)
|
|
|
|
|
|
il_x, il_y = get_pt(R_in, A_left_in)
|
|
ol_x, ol_y = get_pt(R_out, A_left_out)
|
|
or_x, or_y = get_pt(R_out, A_right_out)
|
|
ir_x, ir_y = get_pt(R_in, A_right_in)
|
|
|
|
cpl_x, cpl_y = get_pt(120, -50)
|
|
cpr_x, cpr_y = get_pt(120, -5)
|
|
|
|
|
|
svg = f'''<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500" width="500" height="500">
|
|
<circle cx="250" cy="250" r="215" stroke="{color}" stroke-width="18" fill="none"/>
|
|
<circle cx="250" cy="250" r="40" fill="{color}"/>
|
|
<g fill="{color}">'''
|
|
|
|
for i in range(6):
|
|
svg += f'''
|
|
<path transform="rotate({i*60}, 250, 250)" d="M {il_x:.2f} {il_y:.2f} Q {cpl_x:.2f} {cpl_y:.2f} {ol_x:.2f} {ol_y:.2f} A {R_out} {R_out} 0 0 1 {or_x:.2f} {or_y:.2f} Q {cpr_x:.2f} {cpr_y:.2f} {ir_x:.2f} {ir_y:.2f} A {R_in} {R_in} 0 0 0 {il_x:.2f} {il_y:.2f} Z"/>'''
|
|
|
|
svg += '''
|
|
</g>
|
|
</svg>'''
|
|
|
|
with open("logo.svg", "w") as f:
|
|
f.write(svg)
|