[Arc] Error out on zero radius

This commit is contained in:
Jan Petykiewicz 2026-03-31 22:03:42 -07:00
commit 2176d56b4c
2 changed files with 15 additions and 6 deletions

View file

@ -54,8 +54,8 @@ class Arc(PositionableImpl, Shape):
val = numpy.array(val, dtype=float).flatten()
if not val.size == 2:
raise PatternError('Radii must have length 2')
if not val.min() >= 0:
raise PatternError('Radii must be non-negative')
if not val.min() > 0:
raise PatternError('Radii must be positive')
self._radii = val
@property
@ -64,8 +64,8 @@ class Arc(PositionableImpl, Shape):
@radius_x.setter
def radius_x(self, val: float) -> None:
if not val >= 0:
raise PatternError('Radius must be non-negative')
if not val > 0:
raise PatternError('Radius must be positive')
self._radii[0] = val
@property
@ -74,8 +74,8 @@ class Arc(PositionableImpl, Shape):
@radius_y.setter
def radius_y(self, val: float) -> None:
if not val >= 0:
raise PatternError('Radius must be non-negative')
if not val > 0:
raise PatternError('Radius must be positive')
self._radii[1] = val
# arc start/stop angle properties