@@ -2705,7 +2705,7 @@ def construct(self):
2705
2705
2706
2706
# Alignment
2707
2707
def align_data (self , mobject : Mobject , skip_point_alignment : bool = False ) -> None :
2708
- """Aligns the data of this mobject with another mobject.
2708
+ """Aligns the family structure and data of this mobject with another mobject.
2709
2709
2710
2710
Afterwards, the two mobjects will have the same number of submobjects
2711
2711
(see :meth:`.align_submobjects`), the same parent structure (see
@@ -2719,6 +2719,31 @@ def align_data(self, mobject: Mobject, skip_point_alignment: bool = False) -> No
2719
2719
skip_point_alignment
2720
2720
Controls whether or not the computationally expensive
2721
2721
point alignment is skipped (default: False).
2722
+
2723
+
2724
+ .. note::
2725
+
2726
+ This method is primarily used internally by :meth:`.become` and the
2727
+ :class:`~.Transform` animation to ensure that mobjects are structurally
2728
+ compatible before transformation.
2729
+
2730
+ Examples
2731
+ --------
2732
+ ::
2733
+
2734
+ >>> from manim import Rectangle, Line, ORIGIN, RIGHT
2735
+ >>> rect = Rectangle(width=4.0, height=2.0, grid_xstep=1.0, grid_ystep=0.5)
2736
+ >>> line = Line(start=ORIGIN,end=RIGHT)
2737
+ >>> line.align_data(rect)
2738
+ >>> len(line.get_family()) == len(rect.get_family())
2739
+ True
2740
+ >>> line.get_num_points() == rect.get_num_points()
2741
+ True
2742
+
2743
+ See also
2744
+ --------
2745
+ :class:`~.Transform`, :meth:`~.Mobject.become`, :meth:`~.VMobject.align_points`, :meth:`~.Mobject.get_family`
2746
+
2722
2747
"""
2723
2748
self .null_point_align (mobject )
2724
2749
self .align_submobjects (mobject )
@@ -2943,6 +2968,11 @@ def construct(self):
2943
2968
>>> result = rect.copy().become(circ, match_center=True)
2944
2969
>>> np.allclose(rect.get_center(), result.get_center())
2945
2970
True
2971
+
2972
+ See also
2973
+ --------
2974
+ :meth:`~.Mobject.align_data`, :meth:`~.VMobject.interpolate_color`
2975
+
2946
2976
"""
2947
2977
mobject = mobject .copy ()
2948
2978
if stretch :
0 commit comments