vitem¶
- class janim.items.vitem.VItem(*points: Vect, fill_alpha=0, **kwargs)¶
Bases:
PointsBezier curve spliced item, for details refer to the documentation of
Cmpt_VPoints- points¶
- radius¶
- stroke¶
- fill¶
- glow¶
- color¶
- renderer_cls¶
alias of
VItemRenderer
- init_connect() None¶
- apply_style(stroke_radius: float | Iterable[float] | None = None, stroke_color: JAnimColor | ColorArray | None = None, stroke_alpha: Alpha | AlphaArray | None = None, stroke_background: bool | None = None, fill_color: JAnimColor | ColorArray | None = None, fill_alpha: Alpha | AlphaArray | None = None, color: JAnimColor | ColorArray | None = None, alpha: Alpha | AlphaArray | None = None, glow_color: JAnimColor | None = None, glow_alpha: Alpha | None = None, glow_size: float | None = None, shade_in_3d: bool | None = None, **kwargs) Self¶
Sets the style of the item itself, does not affect child items
See also:
set()
- set_stroke_background(flag: bool = True, *, root_only: bool = False) Self¶
Adjusts the drawing order of stroke and fill
flag=Truemakes the stroke covered by fill,flag=Falsemakes the fill covered by stroke
- shade_in_3d(flag: bool = True, *, root_only: bool = False) Self¶
Toggle 3D shading
When enabled, the color intensity is adjusted based on the position relative to the light source (timeline’s
self.light_source)
- add_tip(at_alpha: float = 1.0, reverse: bool = False, angle: float | None = None, colorize: bool = True, fill_color: JAnimColor | None = None, stroke_color: JAnimColor | None = None, color: JAnimColor | None = None, d_alpha: float = 1e-06, **tip_kwargs)¶
Create an arrow at
at_alphaBy default, the arrow points in the same direction as the path; if
reverse=Trueis passed, it points in the opposite directionIf
colorize=Trueis passed (default), the arrow’s color will match the path’s colorFor other parameters, refer to
ArrowTip
- classmethod align_for_interpolate(item1: VItem, item2: VItem) AlignedData[Self]¶
Performs data alignment for interpolation
- class janim.items.vitem.DashedVItem(vitem: VItem, num_dashes: int = 15, *, dashed_ratio: float = 0.5, dash_offset: float = 0, equal_lengths: Literal['equal', 'approx', 'none'] = 'approx', stroke_color: JAnimColor | ColorArray | None = None, stroke_alpha: Alpha | AlphaArray | None = None, stroke_radius: float | Iterable[float] | None = None, **kwargs)¶
-
Create a dashed version of the passed
vitem, specified by the number of dash segments- Parameters:
num_dashes – Number of dash segments
dashed_ratio – Ratio of dash segments; the remaining ratio is the gap segments
dash_offset – Ratio to offset the starting point of dash segments along the path, e.g.,
1means offset by one dash segment lengthequal_lengths – Whether dash segment lengths are equal, values are
'equal','approx', or'none'-'equal': Dash segment lengths are almost equal -'approx': Default, dash segment lengths are approximately equal -'none': Dash segments will be evenly distributed according to the curve parameter t, generally lengths are not equal
- class janim.items.vitem.DashedVItemByRatio(vitem: VItem, dash_ratio: float = 0.03333333333333333, *, dashed_ratio: float = 0.5, equal_lengths: Literal['equal', 'approx', 'none'] = 'approx', stroke_color: JAnimColor | ColorArray | None = None, stroke_alpha: Alpha | AlphaArray | None = None, stroke_radius: float | Iterable[float] | None = None, **kwargs)¶
-
Create a dashed version of the passed
vitem, specified by the length ratio of dash segments- Parameters:
dash_ratio – Ratio of each dash segment to the total path length, e.g.,
1/30means each dash occupies 1/30 of the pathdashed_ratio – Ratio of dash segments; the remaining ratio is the gap segments
equal_lengths – Whether dash segment lengths are equal, values are
'equal','approx', or'none'-'equal': Dash segment lengths are almost equal -'approx': Default, dash segment lengths are approximately equal -'none': Dash segments will be evenly distributed according to the curve parameter t, generally lengths are not equal