diff --git a/masque/shapes/arc.py b/masque/shapes/arc.py index 7b1cedc..25a9b2e 100644 --- a/masque/shapes/arc.py +++ b/masque/shapes/arc.py @@ -212,8 +212,9 @@ class Arc(Shape): n += [poly_num_points] if poly_max_arclen is not None: n += [perimeter / poly_max_arclen] - thetas_inner = numpy.linspace(a_ranges[0][1], a_ranges[0][0], max(n), endpoint=True) - thetas_outer = numpy.linspace(a_ranges[1][0], a_ranges[1][1], max(n), endpoint=True) + num_points = int(round(max(n))) + thetas_inner = numpy.linspace(a_ranges[0][1], a_ranges[0][0], num_points, endpoint=True) + thetas_outer = numpy.linspace(a_ranges[1][0], a_ranges[1][1], num_points, endpoint=True) sin_th_i, cos_th_i = (numpy.sin(thetas_inner), numpy.cos(thetas_inner)) sin_th_o, cos_th_o = (numpy.sin(thetas_outer), numpy.cos(thetas_outer)) diff --git a/masque/shapes/circle.py b/masque/shapes/circle.py index f7221d5..404aeae 100644 --- a/masque/shapes/circle.py +++ b/masque/shapes/circle.py @@ -81,7 +81,8 @@ class Circle(Shape): n += [poly_num_points] if poly_max_arclen is not None: n += [2 * pi * self.radius / poly_max_arclen] - thetas = numpy.linspace(2 * pi, 0, max(n), endpoint=False) + num_points = int(round(max(n))) + thetas = numpy.linspace(2 * pi, 0, num_points, endpoint=False) xs = numpy.cos(thetas) * self.radius ys = numpy.sin(thetas) * self.radius xys = numpy.vstack((xs, ys)).T diff --git a/masque/shapes/ellipse.py b/masque/shapes/ellipse.py index 9779e69..3288614 100644 --- a/masque/shapes/ellipse.py +++ b/masque/shapes/ellipse.py @@ -139,7 +139,8 @@ class Ellipse(Shape): n += [poly_num_points] if poly_max_arclen is not None: n += [perimeter / poly_max_arclen] - thetas = numpy.linspace(2 * pi, 0, max(n), endpoint=False) + num_points = int(round(max(n))) + thetas = numpy.linspace(2 * pi, 0, num_points, endpoint=False) sin_th, cos_th = (numpy.sin(thetas), numpy.cos(thetas)) xs = r0 * cos_th