v3d.Ray#
- class visu3d.Ray(**kwargs)[source]#
Bases:
visu3d.array_dataclass.DataclassArray
6d vector with position and direction.
Note: The direction is not normalized by default.
- pos: FloatArray['*shape 3']#
- dir: FloatArray['*shape 3']#
- fig_config: plotly.TraceConfig = TraceConfig( name=None, num_samples=500, )#
- property end: etils.enp.array_types.typing.FloatArray#
The extremity of the ray (ray.pos + ray.dir).
- classmethod from_look_at(*, pos: etils.enp.array_types.typing.Array, target: etils.enp.array_types.typing.Array) visu3d.dc_arrays.ray.Ray [source]#
Factory to create a look at Ray.
Alias of Ray(pos=pos, dir=target-from).
- Parameters:
pos – Origin position
target – Target position
- Returns:
The Ray.
- scale_dir(scale: etils.enp.array_types.typing.FloatArray) visu3d.dc_arrays.ray.Ray [source]#
Scale the dir.
- norm(keepdims: bool = False) etils.enp.array_types.typing.FloatArray [source]#
Returns the norm of the dir.
- normalize() visu3d.dc_arrays.ray.Ray [source]#
Normalize the directions.
- mean(*, axis: None | Tuple[int, ...] | int = None) visu3d.dc_arrays.ray.Ray [source]#
Returns the average ray.
- look_at(target: etils.enp.array_types.typing.Array) visu3d.dc_arrays.ray.Ray [source]#
Change the direction to point to the target point.
- apply_transform(tr: visu3d.dc_arrays.transformation.Transform) visu3d.dc_arrays.ray.Ray [source]#