DashedLine¶
Qualified name: manim.mobject.geometry.line.DashedLine
- class DashedLine(*args, dash_length=0.05, dashed_ratio=0.5, **kwargs)[source]¶
Bases:
LineA 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
alwaysCall a method on a mobject every frame.
animateUsed to animate the application of any method of
self.animation_overridescolordepthThe depth of the mobject.
fill_colorIf there are multiple colors (for gradient) this returns the first one
heightThe height of the mobject.
n_points_per_curvesheen_factorstroke_colorwidthThe 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:
args (Any)
dash_length (float)
dashed_ratio (float)
kwargs (Any)
- Return type:
None
- get_end()[source]¶
Returns the end point of the line.
Examples
>>> DashedLine().get_end() array([1., 0., 0.])
- Return type:
- get_first_handle()[source]¶
Returns the point of the first handle.
Examples
>>> DashedLine().get_first_handle() array([-0.98333333, 0. , 0. ])
- Return type: