Datasets:
Formats:
csv
Languages:
English
Size:
< 1K
Tags:
robotics
embodied-ai
human-demonstration
egocentric-video
bimanual-manipulation
tactile-sensing
License:
Download player/runtime/python/Lib/site-packages/rerun/components/line_strip3d.py from alinarus/MultimodalData: direct link, hf CLI and curl.
- Browser
- Download file 2.72 kB
-
https://huggingface.co/datasets/alinarus/MultimodalData/resolve/main/player/runtime/python/Lib/site-packages/rerun/components/line_strip3d.py
- Command line
-
hf download hf://datasets/alinarus/MultimodalData/player/runtime/python/Lib/site-packages/rerun/components/line_strip3d.py
-
curl -L -o line_strip3d.py https://huggingface.co/datasets/alinarus/MultimodalData/resolve/main/player/runtime/python/Lib/site-packages/rerun/components/line_strip3d.py
2.72 kB
| # DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/python/mod.rs | |
| # Based on "crates/build/re_type_definitions/rerun/components/line_strip3d.def.rs". | |
| # You can extend this class by creating a "LineStrip3DExt" class in "line_strip3d_ext.py". | |
| from __future__ import annotations | |
| from collections.abc import Sequence | |
| from typing import TYPE_CHECKING, Any | |
| import numpy as np | |
| import numpy.typing as npt | |
| import pyarrow as pa | |
| from attrs import define, field | |
| from .._baseclasses import ( | |
| BaseBatch, | |
| ComponentBatchMixin, | |
| ComponentMixin, | |
| ) | |
| from .line_strip3d_ext import LineStrip3DExt | |
| __all__ = ["LineStrip3D", "LineStrip3DArrayLike", "LineStrip3DBatch", "LineStrip3DLike"] | |
| class LineStrip3D(LineStrip3DExt, ComponentMixin): | |
| r""" | |
| **Component**: A line strip in 3D space. | |
| A line strip is a list of points connected by line segments. It can be used to draw | |
| approximations of smooth curves. | |
| The points will be connected in order, like so: | |
| ```text | |
| 2------3 5 | |
| / \ / | |
| 0----1 \ / | |
| 4 | |
| ``` | |
| """ | |
| _BATCH_TYPE = None | |
| def __init__(self: Any, points: LineStrip3DLike) -> None: | |
| """Create a new instance of the LineStrip3D component.""" | |
| # You can define your own __init__ function as a member of LineStrip3DExt in line_strip3d_ext.py | |
| self.__attrs_init__(points=points) | |
| points: list[encodings.Vec3D] = field() | |
| def __len__(self) -> int: | |
| # You can define your own __len__ function as a member of LineStrip3DExt in line_strip3d_ext.py | |
| return len(self.points) | |
| if TYPE_CHECKING: | |
| from .. import encodings | |
| LineStrip3DLike = LineStrip3D | encodings.Vec3DArrayLike | npt.NDArray[np.float32] | |
| """A type alias for any LineStrip3D-like object.""" | |
| else: | |
| LineStrip3DLike = Any | |
| LineStrip3DArrayLike = LineStrip3D | Sequence[LineStrip3DLike] | npt.NDArray[np.float32] | |
| """A type alias for any LineStrip3D-like array object.""" | |
| class LineStrip3DBatch(BaseBatch[LineStrip3DArrayLike], ComponentBatchMixin): | |
| _ARROW_DATATYPE = pa.list_( | |
| pa.field( | |
| "item", | |
| pa.list_(pa.field("item", pa.float32(), nullable=False, metadata={}), 3), | |
| nullable=False, | |
| metadata={}, | |
| ) | |
| ) | |
| _COMPONENT_TYPE: str = "rerun.components.LineStrip3D" | |
| def _native_to_pa_array(data: LineStrip3DArrayLike, data_type: pa.DataType) -> pa.Array: | |
| return LineStrip3DExt.native_to_pa_array_override(data, data_type) | |
| # This is patched in late to avoid circular dependencies. | |
| LineStrip3D._BATCH_TYPE = LineStrip3DBatch # type: ignore[assignment] | |