def __init__(self, condition=(lambda x, y: True), **kwargs): """ Condition must be a function which takes in two real arrays (representing x and y values of space respectively) and return a boolean array. This can essentially look like a function from R^2 to {True, False}, but & and | must be used in place of "and" and "or" """ Mobject.__init__(self, **kwargs) self.condition = condition
def __init__(self, **kwargs): if not hasattr(self, "args"): self.args = serialize_args([]) if not hasattr(self, "config"): self.config = serialize_config({ **kwargs, }) digest_config(self, kwargs) self.epsilon = 1.0 / self.density Mobject.__init__(self, **kwargs)
def __init__(self, value=0, **kwargs): if not hasattr(self, "args"): self.args = serialize_args([]) if not hasattr(self, "config"): self.config = serialize_config({ 'value': value, **kwargs, }) Mobject.__init__(self, **kwargs) self.points = np.zeros((1, 3)) self.set_value(value)
def __init__(self, filename, **kwargs): digest_config(self, kwargs) Mobject.__init__(self, **kwargs) path = get_full_video_path(filename) self.cap = cv2.VideoCapture(path) self.is_start = False self.fps = self.cap.get(cv2.CAP_PROP_FPS) # Total frame num of the video self.frame_count = int(self.cap.get(cv2.CAP_PROP_FRAME_COUNT)) self.duration = self.frame_count / self.fps self.start_time = 0 self.current_time = 0 self.offset = 0 r, i = self.cap.read() self.img = ImageMobject(i, **kwargs) self.add_updater(lambda v, dt: v.update_pixel()) self.add(self.img)
def __init__(self, **kwargs): digest_config(self, kwargs) self.epsilon = 1.0 / self.density Mobject.__init__(self, **kwargs)
def __init__(self, filename, **kwargs): path = get_full_raster_image_path(filename) self.image = Image.open(path) self.texture_path = path Mobject.__init__(self, **kwargs)
def __init__(self, value=0, **kwargs): Mobject.__init__(self, **kwargs) self.points = np.zeros((1, 3)) self.set_value(value)
def __init__(self, mobject): Mobject.__init__(self) self.expand(mobject)