How do i add curvature to the vertices and edges of polygons.
I'm trying to create some curved polygons such as these curved vertices, curved edge shapes or even both
How would you go generating these shapes. I've looked into Bezier curves but they seem quite involving, I want to know if there are any simpler solution before I commit to this method.
Here's my code for generating polygons if anyone needs a starting point.
def gen_poly(sides, radius=1, rotation=0):
seg = math.pi * 2 / sides
x_list = []
y_list = []
for i in range(sides):
x = math.sin(seg * i + rotation) * radius
y = math.cos(seg * i + rotation) * radius
x_list.append(x)
y_list.append(y)
x_list.append(x_list[0])
y_list.append(y_list[0])
return x_list,y_list
x,y=polygon(5)
fig = plt.figure()
ax = plt.subplot(111)
ax.plot(x, y, marker='.')
plt.xlabel('x')
plt.ylabel('y')
plt.show()