fix bounds

This commit is contained in:
jan 2023-04-12 22:40:08 -07:00
commit 22e1c6ae1d
2 changed files with 7 additions and 4 deletions

View file

@ -236,8 +236,8 @@ class Grid(Repetition):
Returns:
`[[x_min, y_min], [x_max, y_max]]` or `None`
"""
a_extent = self.a_vector * self.a_count
b_extent = self.b_vector * self.b_count if (self.b_vector is not None) else 0 # type: NDArray[numpy.float64] | float
a_extent = self.a_vector * (self.a_count - 1)
b_extent = self.b_vector * ((self.b_count - 1) if (self.b_vector is not None) else 0) # type: NDArray[numpy.float64] | float
corners = numpy.stack(((0, 0), a_extent, b_extent, a_extent + b_extent))
xy_min = numpy.min(corners, axis=0)