Make sure linspace gets an integer number of points
This commit is contained in:
parent
89bd1e6abe
commit
0fa073b488
3 changed files with 7 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue