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¶
通过旋转和缩放,使得物件的起点和终点被置于
start和end
- 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: 线段两端的空余量,默认为0path_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'>)}¶