Skip to content

Commit

Permalink
make circle polygons smoother
Browse files Browse the repository at this point in the history
  • Loading branch information
niksirbi committed Nov 10, 2023
1 parent 4c97bbf commit fb2c26e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wazp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ def _get_points_on_circle(
"""
Returns the coordinates of n points equally spaced on a circle.
The angle between two points is 2*pi/n radians. The number of points n
is at least 8, and is chosen proportional to the mean radius of the circle.
is at least 12, and is chosen proportional to the mean radius of the circle.
Parameters
----------
Expand All @@ -913,7 +913,7 @@ def _get_points_on_circle(
as evidenced by the radius being a tuple of two floats (x-radius, y-radius).
"""
mean_radius = (radius[0] + radius[1]) / 2
n = 2 * math.floor(mean_radius / 200) + 8
n = 2 * math.floor(mean_radius / 150) + 12
angle = 2 * math.pi / n
x, y = center
points = []
Expand Down

0 comments on commit fb2c26e

Please sign in to comment.