Paths¶
The film's code
import manimgx as m
class PathsHero(m.Scene):
def construct(self) -> None:
path = m.VMobject(color=m.YELLOW, stroke_width=6)
path.start_new_path([-5, -1, 0])
path.add_line_to([-3, 2, 0])
path.add_smooth_curve_to([0, 0, 0])
path.add_cubic_bezier_curve_to([1, 3, 0], [3, -3, 0], [5, 1, 0])
anchors = m.VGroup(
*[m.Dot(point, color=m.BLUE) for point in path.get_anchors()]
)
dot = m.Dot(color=m.RED).move_to(path.get_start())
self.play(m.Create(path), run_time=2)
self.play(m.FadeIn(anchors))
self.play(m.MoveAlongPath(dot, path), run_time=2)
self.wait()
A shape is a path: curves, each from one point to the next. A curve starts at an anchor, bends toward two handles, and ends at the next anchor. The stroke follows the curves, and the fill closes each part of the path back to its start. Circles, polygons, text and graphs are all paths, so all of this works on them too.
To draw a path of your own, make an empty m.VMobject(), then give it its points: as
corners, as a smooth curve through them, or one line and curve at a time.
VMobject ¶
Code
import manimgx as m
class VMobjectExample(m.Scene):
def construct(self) -> None:
path = m.VMobject(color=m.BLUE, fill_opacity=0.5, stroke_width=8)
path.set_points_as_corners([[-3, -2, 0], [-3, 2, 0], [0, 2, 0]])
path.add_cubic_bezier_curve_to([3, 2, 0], [3, -2, 0], [0, -2, 0])
path.close_path()
self.play(m.Create(path, run_time=2))
A path: cubic Bézier curves, stroked in white and unfilled unless styled.
Each curve has four control points: it starts at an anchor, bends toward two handles and ends at the next anchor. The path's points are its curves' control points, four by four, and a new subpath starts wherever a curve does not begin where the one before it ends. The stroke follows the curves; the fill closes each subpath with a straight line back to its start, and where subpaths overlap, a point is filled unless their windings around it cancel: a subpath inside another that runs the other way cuts a hole.
Circles, polygons, text and graphs are all paths. A plain VMobject has no points
until it is given a shape: set its points as corners, or start it at a point and add
lines and curves.
colorThe color of both fill and stroke (default white); None for the class's default.
fill_colorThe fill's color;
colorif not given. Several colors make a gradient alongsheen_direction.fill_opacityThe fill's opacity, from 0 to 1 (default 0: no fill).
stroke_colorThe stroke's color;
colorif not given. Several colors make a gradient.stroke_opacityThe stroke's opacity, from 0 to 1 (default 1).
stroke_widthThe stroke's width, in hundredths of a scene unit (default 4; 0: no stroke).
background_stroke_colorThe color of an outline drawn behind the fill (default black).
background_stroke_opacityThe outline's opacity, from 0 to 1 (default 1).
background_stroke_widthThe outline's width, in hundredths of a scene unit (default 0: none).
sheen_factorHow much the colors lighten toward
sheen_direction, from -1 to 1 (default 0); a negative factor darkens.sheen_directionThe direction the colors lighten toward (default
UL).joint_typeHow the stroke is joined where its path turns: round, beveled or mitered, as a two-dimensional scene draws it (see LineJointType; default AUTO: mitered).
cap_styleHow the stroke ends, at each end it shows (an open path's, a dash's): round, butt or square, as a two-dimensional scene draws it (see CapStyleType; default AUTO: butt).
shade_in_3dWhether a three-dimensional scene's light shades the mobject.
materialHow its surface reflects the scene's lights in a three-dimensional scene (see Material); None: Manim's shading (default).
nameA name for the mobject; its class's name if not given.
z_indexIts place in the drawing order: a higher index is drawn over a lower one (default 0).
targetThe state
MoveToTargetmoves the mobject to.
It also takes the style keywords.
Source
src/manimgx/mobject.py
Draw a path¶
set_points_as_corners ¶

Code
import manimgx as m
class VMobjectSetPointsAsCornersExample(m.Scene):
def construct(self) -> None:
zigzag = m.VMobject(color=m.YELLOW, stroke_width=8)
zigzag.set_points_as_corners(
[[-3, -1.5, 0], [-1.5, 1.5, 0], [0, -1.5, 0], [1.5, 1.5, 0]]
)
triangle = m.VMobject(color=m.BLUE, fill_opacity=0.5)
triangle.set_points_as_corners(
[[-2, -1.5, 0], [0, 2, 0], [2, -1.5, 0], [-2, -1.5, 0]]
)
self.add(m.VGroup(zigzag, triangle).arrange(buff=2))
Give the path new points, in place of its own: straight lines through the given points in turn.
The path is open: to close it, end with its first point again.
pointsThe corners, in scene coordinates, in order.
Source
src/manimgx/mobject.py
set_points_smoothly ¶
Code
import manimgx as m
class VMobjectSetPointsSmoothlyExample(m.Scene):
def construct(self) -> None:
points = [[-5, -1, 0], [-3, 2, 0], [-1, -2, 0], [1, 2, 0]]
points += [[3, -1, 0], [5, 1, 0]]
corners = m.VMobject(color=m.GREY).set_points_as_corners(points)
curve = m.VMobject(color=m.YELLOW, stroke_width=8)
curve.set_points_smoothly(points)
self.add(corners, *(m.Dot(p, radius=0.12) for p in points))
self.play(m.Create(curve, run_time=2))
Give the path new points, in place of its own: a smooth curve through the given points in turn.
The curve passes through each point, bending smoothly there, with no change of curvature (a cubic spline); if the last point is the first, it closes smoothly.
pointsThe points it passes through, in scene coordinates, in order.
Source
src/manimgx/mobject.py
start_new_path ¶
Start a new subpath at a point: the next curve added begins there, not where the path ends.
A curve left unfinished (a subpath started and given no curve yet) is completed with copies of its first point, as a curve of no length. Started where the path ends, the subpath just goes on.
pointWhere the new subpath starts, in scene coordinates.
Source
src/manimgx/mobject.py
add_line_to ¶
Code
import manimgx as m
class VMobjectAddLineToExample(m.Scene):
def construct(self) -> None:
stairs = m.VMobject(color=m.BLUE, stroke_width=8)
stairs.start_new_path([-5, -3, 0])
for _ in range(5):
stairs.add_line_to(stairs.get_end() + 1.2 * m.UP)
stairs.add_line_to(stairs.get_end() + 2 * m.RIGHT)
self.play(m.Create(stairs, run_time=3))
Add a straight line from where the path ends to a point.
The path must have a point to start from.
pointWhere the line ends, in scene coordinates.
Source
src/manimgx/mobject.py
add_points_as_corners ¶
Add straight lines from where the path ends through each point in turn.
The path must have a point to start from.
pointsThe corners, in scene coordinates, in order: the path then ends at the last.
Source
src/manimgx/mobject.py
add_smooth_curve_to ¶
Code
import manimgx as m
class VMobjectAddSmoothCurveToExample(m.Scene):
def construct(self) -> None:
wave = m.VMobject(color=m.YELLOW, stroke_width=8)
wave.start_new_path([-6, 0, 0])
wave.add_cubic_bezier_curve_to([-6, 2, 0], [-4, 2, 0], [-4, 0, 0])
for x in (-2, 0, 2, 4, 6):
wave.add_smooth_curve_to([x, 0, 0])
self.play(m.Create(wave, run_time=3))
Add a curve that continues the path smoothly: it leaves where the path ends in the direction the path arrives there.
Its first handle is the path's last handle mirrored through the path's end. Given only the anchor, the curve arrives there as the mirror image of how it leaves (mirrored across the perpendicular bisector of the line between its ends); given a second handle first, it arrives heading away from that. With no curve to continue, after start_new_path, it is a straight line to the anchor.
*pointsThe anchor where the curve ends, or the second handle and then the anchor, in scene coordinates.
Source
src/manimgx/mobject.py
add_cubic_bezier_curve_to ¶
Code
import manimgx as m
class VMobjectAddCubicBezierCurveToExample(m.Scene):
def construct(self) -> None:
start, h1, h2, end = [-4, -2, 0], [-2, 3, 0], [2, 3, 0], [4, -2, 0]
path = m.VMobject(color=m.YELLOW, stroke_width=8)
path.start_new_path(start).add_cubic_bezier_curve_to(h1, h2, end)
handles = m.VGroup(m.Line(start, h1), m.Line(h2, end))
dots = [m.Dot(p, radius=0.12) for p in (start, h1, h2, end)]
self.add(handles.set_color(m.GREY), *dots)
self.play(m.Create(path, run_time=2))
Add a curve from where the path ends to anchor, bending toward two handles.
The curve leaves the path's last point heading toward handle1, and arrives at
anchor heading away from handle2. The path must have a point to start from.
handle1The first handle, in scene coordinates.
handle2The second handle.
anchorWhere the curve ends.
Source
src/manimgx/mobject.py
add_quadratic_bezier_curve_to ¶
Code
import manimgx as m
class VMobjectAddQuadraticBezierCurveToExample(m.Scene):
def construct(self) -> None:
start, handle, end = [-4, -2, 0], [0, 3, 0], [4, -2, 0]
path = m.VMobject(color=m.TEAL, stroke_width=8)
path.start_new_path(start)
path.add_quadratic_bezier_curve_to(handle, end)
handles = m.VGroup(m.Line(start, handle), m.Line(handle, end))
dots = [m.Dot(p, radius=0.12) for p in (start, handle, end)]
self.add(handles.set_color(m.GREY), *dots)
self.play(m.Create(path, run_time=2))
Add a quadratic Bézier curve from where the path ends to anchor, bending
toward one handle.
It is added as the cubic curve of the same shape. The path must have a point to start from.
handleThe handle, in scene coordinates: the curve leaves the path's last point heading toward it, and arrives at
anchorheading away from it.anchorWhere the curve ends.
Source
src/manimgx/mobject.py
add_cubic_bezier_curve ¶
Add a curve from anchor1 to anchor2, bending toward two handles: a new
subpath, unless anchor1 is where the path ends.
Its four points are appended as they are, so the path's curves must all be whole: after start_new_path, use add_cubic_bezier_curve_to.
anchor1Where the curve starts, in scene coordinates.
handle1The handle it leaves
anchor1heading toward.handle2The handle it arrives at
anchor2heading away from.anchor2Where it ends.
Source
src/manimgx/mobject.py
add_cubic_bezier_curves ¶
Add curves after the path's own, given by their control points, four per curve: anchor, handle, handle, anchor.
curvesThe curves' control points, in scene coordinates: an (n, 4, 3) array, or the points one after another.
Source
src/manimgx/mobject.py
add_subpath ¶
Add curves after the path's own, by their control points, four per curve: a new subpath, unless they start where the path ends.
pointsThe curves' control points, in scene coordinates.
Source
src/manimgx/mobject.py
append_vectorized_mobject ¶
Add another path's curves after this path's own: its points, not its submobjects.
A subpath just started and given no curve yet (see start_new_path) is dropped for them.
vmobjectThe path whose points to add.
Source
src/manimgx/mobject.py
close_path ¶

Code
import manimgx as m
class VMobjectClosePathExample(m.Scene):
def construct(self) -> None:
corners = [[-2, -1.5, 0], [0, 1.5, 0], [2, -1.5, 0]]
style = {"fill_opacity": 0.5, "stroke_width": 8}
open_path = m.VMobject(color=m.GREEN, **style)
closed_path = m.VMobject(color=m.YELLOW, **style)
open_path.set_points_as_corners(corners)
closed_path.set_points_as_corners(corners).close_path()
self.add(m.VGroup(open_path, closed_path).arrange(buff=2))
Close the path: add a straight line from where it ends back to where its last subpath starts, unless it ends where it starts.
The fill closes every subpath anyway; closing one makes its stroke go all the way around.
Source
src/manimgx/mobject.py
is_closed ¶
Whether the path ends where it starts: its first and last points coincide, within a millionth of a unit.
Smooth or sharp¶
make_smooth ¶
Make every subpath in the family a smooth curve through its anchors, with no change of curvature at any (a cubic spline); a closed subpath closes smoothly.
The anchors stay and the handles move: a polygon becomes a rounded loop through its corners.
Source
src/manimgx/mobject.py
make_jagged ¶
Make every subpath in the family straight lines between its anchors: a curve through points becomes the polygon through them.
insert_n_curves ¶
Divide the path's curves into more curves, its shape unchanged.
Each curve is split into equal stretches of its parameter, the new curves spread among the curves as evenly as can be (curve i of m gets the new curves j of n with j·m // n = i): the way a transform gives two paths as many curves as each other.
nHow many curves to add.
Source
src/manimgx/mobject.py
Along a path¶
get_start ¶
The mobject's first point: where a path starts.
Raises an exception if the mobject has no points of its own.
Returns The point, in scene coordinates.
Source
src/manimgx/mobject.py
get_end ¶
The mobject's last point: where a path ends.
Raises an exception if the mobject has no points of its own.
Returns The point, in scene coordinates.
Source
src/manimgx/mobject.py
get_midpoint ¶
The point halfway along the mobject: for a path, half its length from its start.
Returns The point, in scene coordinates.
point_from_proportion ¶

Code
import manimgx as m
class VMobjectPointFromProportionExample(m.Scene):
def construct(self) -> None:
points = [[-5, -2, 0], [-2, 2, 0], [1, -1, 0], [5, 2, 0]]
curve = m.VMobject(color=m.BLUE, stroke_width=6)
curve.set_points_smoothly(points)
self.add(curve)
for alpha in (0, 0.25, 0.5, 0.75, 1):
point = curve.point_from_proportion(alpha)
dot = m.Dot(point, radius=0.15, color=m.YELLOW)
label = m.Text(str(alpha), font_size=32).next_to(dot, m.DOWN)
self.add(dot, label)
The point a proportion of the way along the path, by length: 0 is its start, 1 its end.
The length is the path's own measure, the one a reveal draws by (nine straight
pieces per curve), so it is where a Create at that proportion
has drawn to, and a MoveAlongPath moves at a steady
speed. Raises an exception if alpha is outside [0, 1] or the path has no
points.
alphaThe proportion, from 0 to 1.
Returns The point, in scene coordinates.
Source
src/manimgx/mobject.py
proportion_from_point ¶
How far along the path a point on it lies, by length: the inverse of point_from_proportion.
The first curve the point lies on counts. Raises an exception if the point is not on the path.
pointThe point, in scene coordinates.
toleranceHow near the path the point must be: within 100 times this, in scene units, along each axis.
Returns The proportion, from 0 (the path's start) to 1 (its end).
Source
src/manimgx/mobject.py
get_arc_length ¶
The path's length: the sum of its curves' lengths, each measured along straight pieces between points on it.
sample_points_per_curveHow many points each curve is measured through, its ends included; None for 10, the path's own measure.
Returns The length, in scene units.
Source
src/manimgx/mobject.py
get_subcurve ¶
A copy of the path cut down to its part from proportion a of the way along
it to proportion b.
The proportions go by the path's curves, each an equal share whatever its length, and along each curve by its parameter (point_from_proportion goes by length). The copy's submobjects are copied whole.
aWhere the part starts, from 0 to 1.
bWhere it ends, from
ato 1.
Returns A new path.
Source
src/manimgx/mobject.py
Which way it runs¶
get_direction ¶
Which way the path turns: "CW" (clockwise) or "CCW" (counterclockwise), by the sign of the area its curves' start anchors enclose.
Returns "CW" or "CCW".
Source
src/manimgx/mobject.py
reverse_direction ¶

Code
import manimgx as m
class VMobjectReverseDirectionExample(m.Scene):
def construct(self) -> None:
outer, inner = m.Square(side_length=4), m.Square(side_length=2)
same = m.VMobject(color=m.BLUE, fill_opacity=0.8)
same.append_vectorized_mobject(outer)
same.append_vectorized_mobject(inner)
opposite = m.VMobject(color=m.YELLOW, fill_opacity=0.8)
opposite.append_vectorized_mobject(outer)
opposite.append_vectorized_mobject(inner.reverse_direction())
self.add(m.VGroup(same, opposite).arrange(buff=2))
Reverse the order of the path's own points, so it runs the other way: from its end to its start.
Its submobjects stay as they are. A drawing animation then draws it the other way, and a subpath inside another cuts a hole in the fill only if the two run opposite ways.
Source
src/manimgx/mobject.py
force_direction ¶
Make the path run clockwise or counterclockwise: reverse it if it runs the other way (see get_direction).
target_direction"CW" for clockwise, "CCW" for counterclockwise.
Source
src/manimgx/mobject.py
Its points¶
points ¶
The mobject's own points, in scene coordinates: an (n, 3) array, read-only.
A path's are the control points of its cubic Bézier curves, four per curve. Assign an array to reshape the mobject; its submobjects keep theirs. Assigning the points it has changes nothing (it keeps its geometry, and all that was derived from it), unless they are a blend of shapes, as mid-morph, which become one; assigning them with more after them grows it.
Source
src/manimgx/mobject.py
set_points ¶
Give the mobject new points of its own, in place of its present ones.
pointsThe points, in scene coordinates: an (n, 3) array.
Source
src/manimgx/mobject.py
reset_points ¶
has_points ¶
append_points ¶
Add control points after the path's own: taken four by four, the path's points are its curves.
new_pointsThe points, in scene coordinates: an (n, 3) array.
Source
src/manimgx/mobject.py
get_anchors ¶
The path's anchors, curve by curve: each curve's start, then its end, so an anchor two curves share is listed twice.
Returns An array of points, in scene coordinates; for a path of one point, that point.
Source
src/manimgx/mobject.py
get_subpaths ¶
The path's subpaths: a subpath starts wherever a curve does not begin where the one before it ends.
Returns The subpaths, each an array of its control points, four per curve.
Source
src/manimgx/mobject.py
get_num_curves ¶
How many curves the path has: its points, four per curve.
Returns The number of curves.
bezier ¶
A cubic Bézier curve as a function: from its first control point at 0 to its last at 1.
pointsIts four control points: anchor, handle, handle, anchor.
Returns A function of the curve's parameter, from 0 to 1, giving its point there.
Source
src/manimgx/drawing/geometry.py
Paths made from paths¶
CubicBezier ¶
Code
import manimgx as m
class CubicBezierExample(m.Scene):
def construct(self) -> None:
start, end = [-5, -2, 0], [5, -2, 0]
handle1, handle2 = [-3, 3, 0], [6, 3, 0]
curve = m.CubicBezier(start, handle1, handle2, end, color=m.YELLOW)
levers = m.VGroup(m.Line(start, handle1), m.Line(end, handle2))
levers.set_stroke(m.GREY, width=2)
anchors = m.VGroup(m.Dot(start), m.Dot(end)).set_color(m.BLUE)
handles = m.VGroup(m.Dot(handle1), m.Dot(handle2)).set_color(m.RED)
self.add(levers, anchors, handles)
self.play(m.Create(curve, run_time=2))
A cubic Bézier curve: from one anchor to another, pulled toward two handles; white unless styled.
The curve leaves its start heading toward start_handle and comes into its end
from the direction of end_handle; the farther a handle, the longer the curve
keeps to its direction. It passes through neither handle.
start_anchorWhere the curve starts.
start_handleThe handle of its start.
end_handleThe handle of its end.
end_anchorWhere the curve ends.
colorThe color of both fill and stroke (default white); None for the class's default.
fill_colorThe fill's color;
colorif not given. Several colors make a gradient alongsheen_direction.fill_opacityThe fill's opacity, from 0 to 1 (default 0: no fill).
stroke_colorThe stroke's color;
colorif not given. Several colors make a gradient.stroke_opacityThe stroke's opacity, from 0 to 1 (default 1).
stroke_widthThe stroke's width, in hundredths of a scene unit (default 4; 0: no stroke).
background_stroke_colorThe color of an outline drawn behind the fill (default black).
background_stroke_opacityThe outline's opacity, from 0 to 1 (default 1).
background_stroke_widthThe outline's width, in hundredths of a scene unit (default 0: none).
sheen_factorHow much the colors lighten toward
sheen_direction, from -1 to 1 (default 0); a negative factor darkens.sheen_directionThe direction the colors lighten toward (default
UL).joint_typeHow the stroke is joined where its path turns: round, beveled or mitered, as a two-dimensional scene draws it (see LineJointType; default AUTO: mitered).
cap_styleHow the stroke ends, at each end it shows (an open path's, a dash's): round, butt or square, as a two-dimensional scene draws it (see CapStyleType; default AUTO: butt).
shade_in_3dWhether a three-dimensional scene's light shades the mobject.
materialHow its surface reflects the scene's lights in a three-dimensional scene (see Material); None: Manim's shading (default).
nameA name for the mobject; its class's name if not given.
z_indexIts place in the drawing order: a higher index is drawn over a lower one (default 0).
targetThe state
MoveToTargetmoves the mobject to.
It also takes the style keywords.
Source
src/manimgx/mobjects/shapes.py
DashedVMobject ¶
Code
import manimgx as m
class DashedVMobjectExample(m.Scene):
def construct(self) -> None:
circle = m.Circle(radius=1.5, color=m.BLUE, stroke_width=6)
square = m.Square(side_length=3, color=m.GREEN, stroke_width=6)
arc = m.Arc(radius=2, angle=m.PI, color=m.YELLOW, stroke_width=6)
shapes = m.VGroup(
m.DashedVMobject(circle, num_dashes=12),
m.DashedVMobject(square, num_dashes=16, dashed_ratio=0.7),
m.DashedVMobject(arc, num_dashes=7, dashed_ratio=0.3),
).arrange(buff=1)
self.play(m.Create(shapes, run_time=2))
A path drawn in dashes: evenly spaced dashes along another path, in its style.
An open path starts and ends with a dash; a closed one has as many gaps as dashes,
all the way around. Each dash ends as the path's cap_style says, and an arrow's
tips are drawn whole.
vmobjectThe path to draw in dashes.
num_dashesHow many dashes; 0 draws none.
dashed_ratioThe fraction of the path the dashes cover, from 0 to 1; the gaps take the rest.
dash_offsetHow far the dashes are moved along the path, toward its end, as a fraction of a dash and the gap after it.
equal_lengthsWhether the dashes are equally long; if False they are equal stretches of the path's parameter, longer where the path runs faster.
colorThe color of both fill and stroke (default white); None for the class's default.
fill_colorThe fill's color;
colorif not given. Several colors make a gradient alongsheen_direction.fill_opacityThe fill's opacity, from 0 to 1 (default 0: no fill).
stroke_colorThe stroke's color;
colorif not given. Several colors make a gradient.stroke_opacityThe stroke's opacity, from 0 to 1 (default 1).
stroke_widthThe stroke's width, in hundredths of a scene unit (default 4; 0: no stroke).
background_stroke_colorThe color of an outline drawn behind the fill (default black).
background_stroke_opacityThe outline's opacity, from 0 to 1 (default 1).
background_stroke_widthThe outline's width, in hundredths of a scene unit (default 0: none).
sheen_factorHow much the colors lighten toward
sheen_direction, from -1 to 1 (default 0); a negative factor darkens.sheen_directionThe direction the colors lighten toward (default
UL).joint_typeHow the stroke is joined where its path turns: round, beveled or mitered, as a two-dimensional scene draws it (see LineJointType; default AUTO: mitered).
cap_styleHow the stroke ends, at each end it shows (an open path's, a dash's): round, butt or square, as a two-dimensional scene draws it (see CapStyleType; default AUTO: butt).
shade_in_3dWhether a three-dimensional scene's light shades the mobject.
materialHow its surface reflects the scene's lights in a three-dimensional scene (see Material); None: Manim's shading (default).
nameA name for the mobject; its class's name if not given.
z_indexIts place in the drawing order: a higher index is drawn over a lower one (default 0).
targetThe state
MoveToTargetmoves the mobject to.
It also takes the style keywords.
Source
src/manimgx/mobjects/shapes.py
3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 | |
CurvesAsSubmobjects ¶
Code
import numpy as np
import manimgx as m
class CurvesAsSubmobjectsExample(m.Scene):
def construct(self) -> None:
curve = m.ParametricFunction(
lambda t: [2 * t, 2 * np.sin(t), 0], t_range=(-3, 3, 0.1)
)
parts = m.CurvesAsSubmobjects(curve.set_stroke(width=12))
parts.set_color_by_gradient(m.BLUE, m.YELLOW, m.RED)
self.play(m.Create(parts, run_time=2))
A path split into its curves: a group of one path per curve, each styled as the path is.
Each part can then be styled or animated on its own: a gradient across the parts colors the path along its length. Only the path's own curves are taken, not its submobjects'.
vmobjectThe path to split.
colorThe color of both fill and stroke (default white); None for the class's default.
fill_colorThe fill's color;
colorif not given. Several colors make a gradient alongsheen_direction.fill_opacityThe fill's opacity, from 0 to 1 (default 0: no fill).
stroke_colorThe stroke's color;
colorif not given. Several colors make a gradient.stroke_opacityThe stroke's opacity, from 0 to 1 (default 1).
stroke_widthThe stroke's width, in hundredths of a scene unit (default 4; 0: no stroke).
background_stroke_colorThe color of an outline drawn behind the fill (default black).
background_stroke_opacityThe outline's opacity, from 0 to 1 (default 1).
background_stroke_widthThe outline's width, in hundredths of a scene unit (default 0: none).
sheen_factorHow much the colors lighten toward
sheen_direction, from -1 to 1 (default 0); a negative factor darkens.sheen_directionThe direction the colors lighten toward (default
UL).joint_typeHow the stroke is joined where its path turns: round, beveled or mitered, as a two-dimensional scene draws it (see LineJointType; default AUTO: mitered).
cap_styleHow the stroke ends, at each end it shows (an open path's, a dash's): round, butt or square, as a two-dimensional scene draws it (see CapStyleType; default AUTO: butt).
shade_in_3dWhether a three-dimensional scene's light shades the mobject.
materialHow its surface reflects the scene's lights in a three-dimensional scene (see Material); None: Manim's shading (default).
nameA name for the mobject; its class's name if not given.
z_indexIts place in the drawing order: a higher index is drawn over a lower one (default 0).
targetThe state
MoveToTargetmoves the mobject to.
It also takes the style keywords.
Source
src/manimgx/mobjects/shapes.py
VectorizedPoint ¶
A path of one point: unseen, a place to put things by, or to grow them from.
It is black, with no stroke and no fill. Its width and height are numbers of its own, not measured from its point.
m.VectorizedPoint(location=ORIGIN, artificial_width=0.01, artificial_height=0.01, **kwargs)
locationWhere the point is, in scene coordinates.
artificial_widthThe width it reports, in scene units.
artificial_heightThe height it reports, in scene units.
colorThe color of both fill and stroke (default white); None for the class's default.
fill_colorThe fill's color;
colorif not given. Several colors make a gradient alongsheen_direction.fill_opacityThe fill's opacity, from 0 to 1 (default 0: no fill).
stroke_colorThe stroke's color;
colorif not given. Several colors make a gradient.stroke_opacityThe stroke's opacity, from 0 to 1 (default 1).
stroke_widthThe stroke's width, in hundredths of a scene unit (default 4; 0: no stroke).
background_stroke_colorThe color of an outline drawn behind the fill (default black).
background_stroke_opacityThe outline's opacity, from 0 to 1 (default 1).
background_stroke_widthThe outline's width, in hundredths of a scene unit (default 0: none).
sheen_factorHow much the colors lighten toward
sheen_direction, from -1 to 1 (default 0); a negative factor darkens.sheen_directionThe direction the colors lighten toward (default
UL).joint_typeHow the stroke is joined where its path turns: round, beveled or mitered, as a two-dimensional scene draws it (see LineJointType; default AUTO: mitered).
cap_styleHow the stroke ends, at each end it shows (an open path's, a dash's): round, butt or square, as a two-dimensional scene draws it (see CapStyleType; default AUTO: butt).
shade_in_3dWhether a three-dimensional scene's light shades the mobject.
materialHow its surface reflects the scene's lights in a three-dimensional scene (see Material); None: Manim's shading (default).
nameA name for the mobject; its class's name if not given.
z_indexIts place in the drawing order: a higher index is drawn over a lower one (default 0).
targetThe state
MoveToTargetmoves the mobject to.
It also takes the style keywords.
Source
src/manimgx/mobject.py