Mobject

class manimlib.mobject.mobject.Mobject(**kwargs)

数学对象

align_on_border(direction, buff=0.5)

Direction just needs to be a vector pointing towards side or corner in the 2d plane.

align_to(mobject_or_point, direction=array([0.0, 0.0, 0.0]), alignment_vect=array([0.0, 1.0, 0.0]))

Examples: mob1.align_to(mob2, UP) moves mob1 vertically so that its top edge lines ups with mob2's top edge.

mob1.align_to(mob2, alignment_vect = RIGHT) moves mob1 horizontally so that it's center is directly above/below the center of mob2

become(mobject, copy_submobjects=True)

Edit points, colors and submobjects to be idential to another mobject

become_partial(mobject, a, b)

Set points in such a way as to become only part of mobject. Inputs 0 <= a < b <= 1 determine what portion of mobject to become.

digest_mobject_attrs()

Ensures all attributes which are mobjects are included in the submobjects list.

get_coord(dim, direction=array([0.0, 0.0, 0.0]))

Meant to generalize get_x, get_y, get_z

get_critical_point(direction)

Picture a box bounding the mobject. Such a box has 9 'critical points': 4 corners, 4 edge center, the center. This returns one of them.

get_point_mobject(center=None)

The simplest mobject to be transformed to or from self. Should by a point of the appropriate type

interpolate(mobject1, mobject2, alpha, path_func=<function straight_path>)

Turns self into an interpolation between mobject1 and mobject2.

null_point_align(mobject)

If a mobject with points is being aligned to one without, treat both as groups, and push the one with points into its own submobjects list.

repeat(count)

This can make transition animations nicer

scale(scale_factor, **kwargs)

Default behavior is to scale about the center of the mobject. The argument about_edge can be a vector, indicating which side of the mobject to scale about, e.g., mob.scale(about_edge = RIGHT) scales about mob.get_right().

Otherwise, if about_point is given a value, scaling is done with respect to that point.

set_color(color='#FFFF00', family=True)

Condition is function which takes in one arguments, (x, y, z). Here it just recurses to submobjects, but in subclasses this should be further implemented based on the the inner workings of color

class manimlib.mobject.mobject.Group(*mobjects, **kwargs)