SensorHumanEye#

class ansys.speos.core.sensor.SensorHumanEye(project, name, description='', metadata=None, sensor_instance=None, default_parameters=None)#

Bases: BaseSensor

Sensor feature: Human Eye.

A human eye sensor simulates the light perceived by a human eye looking from an observer point to a target point. The spectral range is fixed from 360 nm to 830 nm, only the wavelength sampling can be changed. By default, a colorimetric sensor with a wavelength sampling of 13, a pupil diameter of 4 mm, a horizontal field of view from -20 to 20 degrees (sampling 2352), a vertical field of view from -10 to 10 degrees (sampling 1176), no layer separation, the origin axis system and no focal length (target point not defined) are chosen.

Parameters:
projectansys.speos.core.project.Project

Project that will own the feature.

namestr

Name of the feature.

descriptionstr

Description of the feature. By default, "".

metadataOptional[Mapping[str, str]]

Metadata of the feature. By default, {}.

sensor_instanceansys.api.speos.scene.v2.scene_pb2.Scene.SensorInstance, optional

Sensor instance to provide if the feature does not have to be created from scratch. By default, None, means that the feature is created from scratch.

default_parametersansys.speos.core.generic.parameters.HumanEyeSensorParameters, optional

If defined the values in the sensor instance will be overwritten by the values of the dataclass. By default, None.

Parameters:

Notes

This feature only exists in sensor template version 2 and requires a Speos server 2027 R1 SP0 or above.

The position of the sensor is defined by an observer point, a target point and a top direction. The sensor axis system has its origin at the observer point, its Z axis along the sight direction (from observer to target), its Y axis along the top direction (orthogonalized against the sight direction) and its X axis equal to Y x Z. The focal length is the distance between the observer and the target points.

Overview#

set_type_colorimetric

Set type colorimetric.

set_type_spectral

Set type spectral.

set_dimensions

Set the field of view and sampling of the sensor.

commit

Save feature: send the local data to the speos server database.

set_layer_type_none

Set layer separation to None (no layer separation).

set_layer_type_source

Set layer separation to by source.

type

Type of the sensor.

wavelength_sampling

Number of wavelengths taken into account between 360 nm and 830 nm.

pupil_diameter

Diameter of the pupil.

axis_system

Axis system of the sensor.

focal

Focal length - distance between the observer point and the target point (mm).

eye_point

Position of the eye.

target_point

Point looked at by the eye.

top_direction

Top direction of the eye.

layer

Current layer separation type.

visual_data

Property containing human eye sensor visualization data.

WAVELENGTH_START

Fixed minimum wavelength of the human eye sensor (nm).

WAVELENGTH_END

Fixed maximum wavelength of the human eye sensor (nm).

Import detail#

from ansys.speos.core.sensor import SensorHumanEye

Property detail#

property SensorHumanEye.type: str | None#

Type of the sensor.

Returns:
Union[str, None]

"colorimetric", "spectral" or None when not yet set.

property SensorHumanEye.wavelength_sampling: None | int#

Number of wavelengths taken into account between 360 nm and 830 nm.

Parameters:
valueint

Wavelength sampling. By default, 13.

Returns:
Union[None, int]

Current wavelength sampling.

property SensorHumanEye.pupil_diameter: float#

Diameter of the pupil.

Parameters:
valuefloat

Pupil diameter in mm. By default, 4.0.

Returns:
float

Current pupil diameter.

property SensorHumanEye.axis_system: list[float]#

Axis system of the sensor.

O corresponds to the observer (eye point), Y to the top direction and Z to the sight direction. Prefer set_view() or the observer_point, target_point and top_direction properties to position the sensor.

Parameters:
valuelist[float]

Orthonormal axis system [Ox Oy Oz Xx Xy Xz Yx Yy Yz Zx Zy Zz].

Returns:
list[float]

Current axis system.

property SensorHumanEye.focal: float | None#

Focal length - distance between the observer point and the target point (mm).

Parameters:
valuefloat

Focal length in mm. Must be greater than 0. The observer point and the sight direction are kept, so the target point moves along the sight direction.

Returns:
Union[float, None]

Current focal length, None when not yet defined.

property SensorHumanEye.eye_point: list[float]#

Position of the eye.

Parameters:
valuelist[float]

Position [x, y, z] in mm. If the focal length is defined, the target point and top direction are kept, otherwise the orientation of the sensor is kept.

Returns:
list[float]

Observer point, origin of the axis system.

property SensorHumanEye.target_point: list[float] | None#

Point looked at by the eye.

Parameters:
valuelist[float]

Target point [x, y, z] in mm. The observer point and top direction are kept, the focal length is updated.

Returns:
Union[list[float], None]

Target point computed from the axis system and the focal length. None when the focal length is not defined.

property SensorHumanEye.top_direction: list[float]#

Top direction of the eye.

Parameters:
valuelist[float]

Top direction [x, y, z]. It is orthogonalized against the sight direction.

Returns:
list[float]

Top direction, Y axis of the axis system.

property SensorHumanEye.layer: str | None#

Current layer separation type.

Returns:
Union[str, None]

"none", "by_source", or None when not yet set.

property SensorHumanEye.visual_data: ansys.speos.core.generic.visualization_methods._VisualData#

Property containing human eye sensor visualization data.

The viewing cone is represented by a sphere section of radius equal to the focal length, centered on the observer point and covering the field of view, closed by triangles to the observer point.

Returns:
ansys.speos.core.generic.visualization_methods._VisualData

Instance of VisualData Class for pyvista.PolyData of feature faces, coordinate_systems.

Attribute detail#

SensorHumanEye.WAVELENGTH_START = 360.0#

Fixed minimum wavelength of the human eye sensor (nm).

SensorHumanEye.WAVELENGTH_END = 830.0#

Fixed maximum wavelength of the human eye sensor (nm).

Method detail#

SensorHumanEye.set_type_colorimetric()#

Set type colorimetric.

The sensor generates color results without any spectral data. The wavelength sampling is preserved when switching type.

Returns:
ansys.speos.core.sensor.SensorHumanEye

Human eye sensor.

SensorHumanEye.set_type_spectral()#

Set type spectral.

The sensor generates color results and spectral data separated by wavelength. The wavelength sampling is preserved when switching type.

Returns:
ansys.speos.core.sensor.SensorHumanEye

Human eye sensor.

SensorHumanEye.set_dimensions()#

Set the field of view and sampling of the sensor.

X corresponds to the horizontal direction, Y to the vertical direction.

Returns:
ansys.speos.core.sensor.BaseSensor.AngularRange

Angular range object.

SensorHumanEye.commit()#

Save feature: send the local data to the speos server database.

Returns:
ansys.speos.core.sensor.SensorHumanEye

Human eye sensor feature.

Raises:
ValueError

If the focal length is not defined. Set it with focal, target_point or set_view() before committing.

SensorHumanEye.set_layer_type_none()#

Set layer separation to None (no layer separation).

Returns:
ansys.speos.core.sensor.SensorHumanEye

Human eye sensor.

SensorHumanEye.set_layer_type_source()#

Set layer separation to by source.

Returns:
ansys.speos.core.sensor.SensorHumanEye

Human eye sensor.