diff --git a/cadquery/cq.py b/cadquery/cq.py index ae2c703b0..c8fec8f7b 100644 --- a/cadquery/cq.py +++ b/cadquery/cq.py @@ -1291,7 +1291,7 @@ def rarray( false, the lower left corner will be at the center of the work plane """ - if xSpacing < 1 or ySpacing < 1 or xCount < 1 or yCount < 1: + if xSpacing <= 0 or ySpacing <= 0 or xCount < 1 or yCount < 1: raise ValueError("Spacing and count must be > 0 ") lpoints = [] # coordinates relative to bottom left point diff --git a/tests/test_cadquery.py b/tests/test_cadquery.py index 295a764f3..6abc1d9ae 100644 --- a/tests/test_cadquery.py +++ b/tests/test_cadquery.py @@ -8,7 +8,7 @@ from random import random from random import randrange -from pytest import approx +from pytest import approx, raises # my modules @@ -960,6 +960,9 @@ def testRectArray(self): # 6 faces for the box, 2 faces for each cylinder self.assertEqual(6 + NUMX * NUMY * 2, s.faces().size()) + with raises(ValueError): + Workplane().rarray(0, 0, NUMX, NUMY, True) + def testPolarArray(self): radius = 10