Example #1
0
 def __init__(self, line, count=1, posratio=0.5, length=0.3, space=0.1, **kwargs):
     VMobject.__init__(self, **kwargs)
     if not isinstance(line, VGroup):
         if line.get_length() <= length*5:
             length = min(max(0.15, line.get_length()/5), 0.3)
         hash = self.dimhash(line, length)
         hashmark = VMobject()
         for i in range(count):
             hashmark.append_vectorized_mobject(hash.copy().move_to(
                 i*space*line.get_unit_vector()
             ))
         self.append_vectorized_mobject(hashmark.move_to(
             line.point_from_proportion(posratio)))
     else:
         kwargs["dimhash"] = self.dimhash
         self.add(Hashs(line, count=count, posratio=posratio,
                        length=length, space=space, **kwargs))
Example #2
0
    def __init__(self, *functiongraphs, **kwargs):
        VGroup.__init__(self, **kwargs)
        functionsgraphs = []
        # self.add(exec("FunctionGraph("+functiongraphs[0]+")"))
        [
            exec(
                "functionsgraphs.append(FunctionGraph(" + functiongraph + "))",
                {
                    "functionsgraphs": functionsgraphs,
                    "FunctionGraph": FunctionGraph
                }) for functiongraph in functiongraphs
        ]

        vmobject = VMobject()
        [
            vmobject.append_vectorized_mobject(functionsgraph)
            for functionsgraph in functionsgraphs
        ]
        self.add(vmobject)
Example #3
0
 def __init__(self, start_angle=0, angle=TAU/4, arc_center=None, radius=0.25, count=1, space=0.1, quad=1, ccw=1,  *args, **kwargs):
     VMobject.__init__(self, **kwargs)
     hash = VMobject()
     for i in range(count):
         hash.append_vectorized_mobject(GeomArc(start_angle=start_angle, angle=angle, arc_center=arc_center, radius=self.radius+i*space,  quad=quad,ccw=ccw,  *args, **kwargs))
     self.append_vectorized_mobject(hash)