VMobject¶
- class VMobject(*native_points: Point, plane: PolarPlane, curvature: float = -1, **kwargs)[source]¶
The foundation for most hyperbolic objects, which acts as a bridge between hyperbolic objects and the Euclidean geometry underlying Manim.
In a sense, it is just a collection of
hmanim.poincare.point.Point
objects (native_points), where consecutive ones are connected by straight lines or geodesics. For aLine
, the correspondingVMobject
consists of the start point and the end point and all the points in between that make up the curved geodesic. Seeset_native_points()
andconnect_native_point()
for more details.- Parameters:
native_points – The
hmanim.poincare.point.Point
objects that make up the hyperbolic object and between which geodesics are drawn.
- Resolution(int)¶
Defines how many points lie on the path that is used to represent the geodesic between two points.
- copy() VMobject [source]¶
Create and return an identical copy of the
Mobject
including allsubmobjects
.- Returns:
The copy.
- Return type:
Mobject
Note
The clone is initially not visible in the Scene, even if the original was.
- static get_native_render_points_for_geodesic(start_point: Point, end_point: Point, curvature: float = -1, smooth_straight_geodesics: bool = False, resolution: int = 100) list[Point] [source]¶
Determines the list of
hmanim.poincare.point.Point
objects that lie on the geodesic line segment between the start_point and end_point.- Parameters:
start_point – The start point of the geodesic.
end_point – The end point of the geodesic.
curvature – The curvature of the hyperbolic plane that the geodesic lives in.
smooth_straight_geodesics – When smooth_straight_geodesics is set to True we do NOT represent a hyperbolic line that happens to be equivalent to a Euclidean straight line with only two points, but rather with as many points as all other geodesic line segments.
resolution – Eventually, a geodesic line segment is represented by a chain of straight line segments. The resolution defines the number of straight line segments that make up the geodesic. The higher, the smoother the drawn geodesic.
- rotated_by(angle: float) VMobject [source]¶
Rotate all points of the
VMobject
around the origin by the passed angle in radians.
- set_center_of_projection(point: Point) VMobject [source]¶
Change the center of projection of the hyperbolic plane that the
VMobject
lives in.Note
Only affects the object itself and not the other objects that are associated with the corresponding hyperbolic plane.
- Parameters:
point (hmanim.native.point.Point) – The new center of projection.
- Returns:
The modified
VMobject
.- Return type:
- set_curvature(curvature: float) VMobject [source]¶
Change the curvature of the hyperbolic plane that the
VMobject
lives in.Note
Only affects the object itself and not the other objects that are associated with the corresponding hyperbolic plane.
- class VMobjectRotate(mobject=None, *args, use_override=True, **kwargs)[source]¶
Rotates all points of the
VMobject
around the origin.Note
This class is not meant to be used directly. See
TranslateAndRotate
instead.
- class VMobjectRotatedTranslate(mobject=None, *args, use_override=True, **kwargs)[source]¶
This translation represents a movement of a point from the origin along an axis (rotated away from the x-axis by the passed angle) by a specified distance. All other points of the
VMobject
, are moved in such a way, that the distance to the moving point remains unchanged.Note
This class is not meant to be used directly. See
RotatedTranslate
instead.- interpolate_mobject(alpha: float)[source]¶
Interpolates the mobject of the
Animation
based on alpha value.- Parameters:
alpha – A float between 0 and 1 expressing the ratio to which the animation is completed. For example, alpha-values of 0, 0.5, and 1 correspond to the animation being completed 0%, 50%, and 100%, respectively.
- class VMobjectSetCurvature(mobject=None, *args, use_override=True, **kwargs)[source]¶
An animation that changes the curvature of the hyperbolic plane that the
VMobject
lives in. However, this change only affects the receivingVMobject
.Note
This class is not meant to be used directly. See
SetCurvature
instead.- interpolate_mobject(alpha: float) None [source]¶
Interpolates the mobject of the
Animation
based on alpha value.- Parameters:
alpha – A float between 0 and 1 expressing the ratio to which the animation is completed. For example, alpha-values of 0, 0.5, and 1 correspond to the animation being completed 0%, 50%, and 100%, respectively.
- class VMobjectTranslate(mobject=None, *args, use_override=True, **kwargs)[source]¶
This translation represents a movement of a point from the origin along the x-axis in positive direction. All other points of the
VMobject
, are moved in such a way, that the distance to the moving point remains unchanged.Note
This class is not meant to be used directly. See
Translate
instead.
- class VMobjectTranslateAndRotate(mobject=None, *args, use_override=True, **kwargs)[source]¶
Represents a movement of a point from the origin along an axis, while that axis is rotating around the origin at the same time. All other points of the
VMobject
, are moved in such a way, that the distance to the moving point remains unchanged.Note
This class is not meant to be used directly. See
TranslateAndRotate
instead.- interpolate_mobject(alpha: float)[source]¶
Interpolates the mobject of the
Animation
based on alpha value.- Parameters:
alpha – A float between 0 and 1 expressing the ratio to which the animation is completed. For example, alpha-values of 0, 0.5, and 1 correspond to the animation being completed 0%, 50%, and 100%, respectively.