points

class janim.items.points.Points(*points: Vect, **kwargs)

Bases: Item

Point set

A data item that does not participate in rendering

Base class for most items

points
is_null() bool
property distance_sort_reference_point: ndarray | None
class janim.items.points.Point(location: Vect, **kwargs)

Bases: Points

A point

You can use .location to get the current position

A pure data item that does not participate in rendering; to render a point in the scene, see Dot

property location: ndarray
class janim.items.points.MarkedItem(*args, **kwargs)

Bases: Points

Item with marked points

For example, TextChar, TextLine, Arc, and RegularPolygon all use this class as their base class, enabling

  • Get marked point positions via .mark.get(...), which will be synchronously updated when points changes

  • Move marked point positions via .mark.set(...), which will cause points to move synchronously

Custom item example:

class MarkedSquare(MarkedItem, Square):
    def __init__(self, side_length: float = 2.0, **kwargs) -> None:
        super().__init__(side_lenght, **kwargs)
        self.mark.set_points([RIGHT * side_length / 4])

In this code, self.mark.set_points([RIGHT * side_length / 4]) sets a marked point at 75% along the x-axis. This marked point will automatically track the item’s coordinate transformations. For details, refer to the corresponding code in Basic Examples

mark
init_connect() None
class janim.items.points.DotCloud(*args, **kwargs)

Bases: Points

color
radius
glow
renderer_cls

alias of DotCloudRenderer

init_connect() None
apply_style(color: JAnimColor | ColorArray | None = None, alpha: float | Iterable[float] | None = None, radius: float | Iterable[float] | None = None, glow_color: JAnimColor | None = None, glow_alpha: Alpha | None = None, glow_size: float | None = None, **kwargs) Self

Set the item’s own style, does not affect child items

See also: set()

classmethod align_for_interpolate(item1: DotCloud, item2: DotCloud) AlignedData[DotCloud]

Perform data alignment for interpolation

class janim.items.points.GlowDot(*args, glow_alpha=0.5, **kwargs)

Bases: DotCloud