def __init__(self, division, lower_left, upper_right=None, *args, **kwargs): ndim = len(division) cv.check_iterable_type("division", division, int) cv.check_length("division", division, 2, 3) cv.check_length("lower_left", lower_left, ndim) if upper_right is not None: cv.check_length("upper_right", upper_right, ndim) self.lower_left = np.array(lower_left) if upper_right is None: self.upper_right = -self.lower_left else: self.upper_right = np.array(upper_right) self.division = division self.ndim = ndim super().__init__(*args, **kwargs)
def width(self, width): cv.check_type('mesh width', width, Iterable, Real) cv.check_length('mesh width', width, 2, 3) self._width = width
def upper_right(self, upper_right): cv.check_type('mesh upper_right', upper_right, Iterable, Real) cv.check_length('mesh upper_right', upper_right, 2, 3) self._upper_right = upper_right
def lower_left(self, lower_left): cv.check_type('mesh lower_left', lower_left, Iterable, Real) cv.check_length('mesh lower_left', lower_left, 2, 3) self._lower_left = lower_left
def dimension(self, dimension): cv.check_type('mesh dimension', dimension, Iterable, Integral) cv.check_length('mesh dimension', dimension, 2, 3) self._dimension = dimension