DashedLine#
Qualified name: manim.mobject.geometry.line.DashedLine
- class DashedLine(*args, dash_length=0.05, dashed_ratio=0.5, **kwargs)[source]#
Bases:
Line
A dashed
Line
.- Parameters:
See also
Examples
Example: DashedLineExample ¶
from manim import * class DashedLineExample(Scene): def construct(self): # dash_length increased dashed_1 = DashedLine(config.left_side, config.right_side, dash_length=2.0).shift(UP*2) # normal dashed_2 = DashedLine(config.left_side, config.right_side) # dashed_ratio decreased dashed_3 = DashedLine(config.left_side, config.right_side, dashed_ratio=0.1).shift(DOWN*2) self.add(dashed_1, dashed_2, dashed_3)
class DashedLineExample(Scene): def construct(self): # dash_length increased dashed_1 = DashedLine(config.left_side, config.right_side, dash_length=2.0).shift(UP*2) # normal dashed_2 = DashedLine(config.left_side, config.right_side) # dashed_ratio decreased dashed_3 = DashedLine(config.left_side, config.right_side, dashed_ratio=0.1).shift(DOWN*2) self.add(dashed_1, dashed_2, dashed_3)
Methods
Returns the end point of the line.
Returns the point of the first handle.
Returns the point of the last handle.
Returns the start point of the line.
Attributes
animate
Used to animate the application of any method of
self
.animation_overrides
color
depth
The depth of the mobject.
fill_color
If there are multiple colors (for gradient) this returns the first one
height
The height of the mobject.
n_points_per_curve
sheen_factor
stroke_color
width
The width of the mobject.
- _calculate_num_dashes()[source]#
Returns the number of dashes in the dashed line.
Examples
>>> DashedLine()._calculate_num_dashes() 20
- Return type:
int
- _original__init__(*args, dash_length=0.05, dashed_ratio=0.5, **kwargs)#
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
dash_length (float) –
dashed_ratio (float) –
- Return type:
None
- get_end()[source]#
Returns the end point of the line.
Examples
>>> DashedLine().get_end() array([1., 0., 0.])
- Return type:
Point3D
- get_first_handle()[source]#
Returns the point of the first handle.
Examples
>>> DashedLine().get_first_handle() array([-0.98333333, 0. , 0. ])
- Return type:
Point3D