manim.mobject.three_dimensions.Line3D

class Line3D(start=array([- 1.0, 0.0, 0.0]), end=array([1.0, 0.0, 0.0]), thickness=0.02, color=None, **kwargs)[source]

Bases: manim.mobject.three_dimensions.Cylinder

A cylindrical line, for use in ThreeDScene.

Examples

Example: ExampleLine3D

../_images/ExampleLine3D-1.png
from manim import *

class ExampleLine3D(ThreeDScene):
    def construct(self):
        axes = ThreeDAxes()
        line = Line3D(start=np.array([0, 0, 0]), end=np.array([2, 2, 2]))
        self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES)
        self.add(axes, line)
Parameters
  • start (numpy.array) – The start position of the line.

  • end (numpy.array) – The end position of the line.

  • thickness (float) – The thickness of the line.

Methods

get_end

Returns the point, where the stroke that surrounds the Mobject ends.

get_start

Returns the point, where the stroke that surrounds the Mobject starts.

pointify

set_start_and_end_attrs

Sets the start and end points of the line.

Attributes

animate

Used to animate the application of a method.

depth

The depth of the mobject.

height

The height of the mobject.

width

The width of the mobject.

get_end()[source]

Returns the point, where the stroke that surrounds the Mobject ends.

get_start()[source]

Returns the point, where the stroke that surrounds the Mobject starts.

set_start_and_end_attrs(start, end, **kwargs)[source]

Sets the start and end points of the line.

If either start or end are Mobjects, this gives their centers.