예제 #1
0
    def __init__(self, mob, **kwargs):
        digest_locals(self)
        VMobject.__init__(self, **kwargs)

        buff = float(self.spacing) / self.dashes_num

        for i in range(self.dashes_num):
            a = ((1 + buff) * i) / self.dashes_num
            b = 1 - ((1 + buff) * (self.dashes_num - 1 - i)) / self.dashes_num
            dash = VMobject(color=self.color)
            dash.pointwise_become_partial(mob, a, b)
            self.submobjects.append(dash)
예제 #2
0
파일: geometry.py 프로젝트: hengfun/manim
    def __init__(self, mob, **kwargs):
        digest_locals(self)
        VMobject.__init__(self, **kwargs)

        segment_len = (1 - float(self.spacing)) / self.dashes_num

        for i in range(self.dashes_num):
            a = float(i) / self.dashes_num
            b = a + segment_len
            dash = VMobject(color=self.color)
            dash.pointwise_become_partial(mob, a, b)
            self.submobjects.append(dash)