points¶
- class janim.items.points.Points(*points: Vect, **kwargs)¶
Bases:
ItemPoint 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:
PointsA point
You can use
.locationto get the current positionA 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:
PointsItem with marked points
For example,
TextChar,TextLine,Arc, andRegularPolygonall use this class as their base class, enablingGet marked point positions via
.mark.get(...), which will be synchronously updated whenpointschangesMove marked point positions via
.mark.set(...), which will causepointsto 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