line

class janim.items.geometry.line.Cmpt_VPoints_LineImpl(*args, **kwargs)

基类:Cmpt_VPoints, Generic

在线段中,对 Cmpt_VPoints 的进一步实现

copy() Self
become(other: Cmpt_VPoints_LineImpl) Self
not_changed(other) bool
put_start_and_end_on(start: Vect, end: Vect) Self

通过旋转和缩放,使得物件的起点和终点被置于 startend

update_points_by_attrs(start: ndarray | None = None, end: ndarray | None = None, buff: float | None = None, path_arc: float | None = None) Self
set_buff(buff: float) Self
set_path_arc(path_arc: float) Self
set_start_and_end(start: SupportsPointify, end: SupportsPointify) Self
static pointify_start_and_end(start: SupportsPointify, end: SupportsPointify) tuple[ndarray, ndarray]
static pointify(item_or_data_or_point: SupportsPointify, direction: Vect | None = None) ndarray

Take an argument passed into Line (or subclass) and turn it into a 3d point.

property vector: ndarray
property unit_vector: ndarray
property angle: float
get_projection(point: Vect) ndarray

Return projection of a point onto the line

get_slope() float
set_angle(angle: float, about_point: Vect | None = None) Self
set_length(length: float, **kwargs)
property length: float
property arc_length: float
class janim.items.geometry.line.Line(start: Vect | Points = array([-1., 0., 0.]), end: Vect | Points = array([1., 0., 0.]), *, buff: float = 0, path_arc: float = 0, **kwargs)

基类:VItem

线段

传入 start, end 为线段起点终点

  • buff: 线段两端的空余量,默认为 0

  • path_arc: 表示线段的弯曲角度

points
cmpt_init_datas = {'color': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>), 'depth': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.item.Item'>), 'fill': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>), 'glow': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>), 'points': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.points.Points'>), 'radius': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>), 'stroke': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>)}
class janim.items.geometry.line.TangentLine(vitem: VItem, alpha: float, length: float = 1, *, d_alpha: float = 1e-06, **kwargs)

基类:Line

切线

  • 传入 vitem 表示需要做切线的物件,alpha 表示切点在 vitem 上的比例

  • length: 切线长度

  • d_alpha: 精细程度,越小越精细(默认 1e-6

cmpt_init_datas = {'color': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>), 'depth': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.item.Item'>), 'fill': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>), 'glow': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>), 'points': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.points.Points'>), 'radius': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>), 'stroke': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>)}
class janim.items.geometry.line.Elbow(width: float = 0.2, angle: float = 0, **kwargs)

基类:VItem

折线(一般用作直角符号)

  • width 表示宽度

  • angle 表示角度

cmpt_init_datas = {'color': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>), 'depth': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.item.Item'>), 'fill': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>), 'glow': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>), 'points': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.points.Points'>), 'radius': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>), 'stroke': _ItemMeta._CmptInitData(info=<janim.components.component.CmptInfo object>, decl_cls=<class 'janim.items.vitem.VItem'>)}