コード例 #1
0
 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
コード例 #2
0
ファイル: region.py プロジェクト: coallaoh/manim
 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
コード例 #3
0
 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)
コード例 #4
0
ファイル: value_tracker.py プロジェクト: eulertour/manim
 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)
コード例 #5
0
    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)
コード例 #6
0
 def __init__(self, **kwargs):
     digest_config(self, kwargs)
     self.epsilon = 1.0 / self.density
     Mobject.__init__(self, **kwargs)
コード例 #7
0
 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)
コード例 #8
0
ファイル: value_tracker.py プロジェクト: unAlpha/AgManim
 def __init__(self, value=0, **kwargs):
     Mobject.__init__(self, **kwargs)
     self.points = np.zeros((1, 3))
     self.set_value(value)
コード例 #9
0
 def __init__(self, mobject):
     Mobject.__init__(self)
     self.expand(mobject)
コード例 #10
0
ファイル: point_cloud_mobject.py プロジェクト: coallaoh/manim
 def __init__(self, **kwargs):
     digest_config(self, kwargs)
     self.epsilon = 1.0 / self.density
     Mobject.__init__(self, **kwargs)