class CyclicReplace(Transform): CONFIG = { "path_arc": 90 * DEGREES, } def __init__(self, *mobjects, **kwargs): self.group = Group(*mobjects) super().__init__(self.group, **kwargs) def create_target(self): target = self.group.copy() cycled_targets = [target[-1], *target[:-1]] for m1, m2 in zip(cycled_targets, self.group): m1.move_to(m2) return target
class CyclicReplace(Transform): CONFIG = { "path_arc": 90 * DEGREES, } def __init__(self, *mobjects, **kwargs): if not hasattr(self, "args"): self.args = serialize_args(mobjects) if not hasattr(self, "config"): self.config = serialize_config({ **kwargs, }) self.group = Group(*mobjects) super().__init__(self.group, **kwargs) def create_target(self): target = self.group.copy() cycled_targets = [target[-1], *target[:-1]] for m1, m2 in zip(cycled_targets, self.group): m1.move_to(m2) return target