From b188589b6034ff8fe234eecd81292d85ace388d0 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Wed, 8 Jun 2022 21:00:56 -0700 Subject: [PATCH] Fix / simplify some cases where the arc is a sector --- masque/shapes/arc.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/masque/shapes/arc.py b/masque/shapes/arc.py index b928981..6bb234b 100644 --- a/masque/shapes/arc.py +++ b/masque/shapes/arc.py @@ -245,7 +245,7 @@ class Arc(Shape, metaclass=AutoSlots): num_points = int(round(max(n))) wh = self.width / 2.0 - if wh == r0 and r0 == r1: + if wh == r0 or wh == r1: thetas_inner = numpy.zeros(1) # Don't generate multiple vertices if we're at the origin else: thetas_inner = numpy.linspace(a_ranges[0][1], a_ranges[0][0], num_points, endpoint=True) @@ -288,6 +288,12 @@ class Arc(Shape, metaclass=AutoSlots): rx = self.radius_x + wh ry = self.radius_y + wh + if rx == 0 or ry == 0: + # Single point, at origin + mins.append([0, 0]) + maxs.append([0, 0]) + continue + a0, a1 = a a0_offset = a0 - (a0 % (2 * pi))