MCPcopy
hub / github.com/ManimCommunity/manim / move_to

Method move_to

manim/mobject/mobject.py:1880–1893  ·  view source on GitHub ↗

Move center of the :class:`~.Mobject` to certain Point3D.

(
        self,
        point_or_mobject: Point3DLike | Mobject,
        aligned_edge: Vector3DLike = ORIGIN,
        coor_mask: Vector3DLike = np.array([1, 1, 1]),
    )

Source from the content-addressed store, hash-verified

1878 return self
1879
1880 def move_to(
1881 self,
1882 point_or_mobject: Point3DLike | Mobject,
1883 aligned_edge: Vector3DLike = ORIGIN,
1884 coor_mask: Vector3DLike = np.array([1, 1, 1]),
1885 ) -> Self:
1886 """Move center of the :class:`~.Mobject` to certain Point3D."""
1887 if isinstance(point_or_mobject, Mobject):
1888 target = point_or_mobject.get_critical_point(aligned_edge)
1889 else:
1890 target = point_or_mobject
1891 point_to_align = self.get_critical_point(aligned_edge)
1892 self.shift((target - point_to_align) * coor_mask)
1893 return self
1894
1895 def replace(
1896 self, mobject: Mobject, dim_to_match: int = 0, stretch: bool = False

Callers 15

arrange_in_gridMethod · 0.95
constructMethod · 0.45
constructMethod · 0.45
test_DataFunction · 0.45
test_coords_to_pointFunction · 0.45
test_MoveToFunction · 0.45
test_ImageInterpolationFunction · 0.45
test_get_lines_to_pointFunction · 0.45

Calls 2

get_critical_pointMethod · 0.95
shiftMethod · 0.95

Tested by 15

test_DataFunction · 0.36
test_coords_to_pointFunction · 0.36
test_MoveToFunction · 0.36
test_ImageInterpolationFunction · 0.36
test_get_lines_to_pointFunction · 0.36
test_MovingVerticesFunction · 0.36
test_unionFunction · 0.36