giant.ray_tracer.rays.INTERSECT_DTYPE

giant.ray_tracer.rays.INTERSECT_DTYPE: dtype = dtype([('check', '?'), ('distance', '<f8'), ('intersect', '<f8', (3,)), ('normal', '<f8', (3,)), ('albedo', '<f8'), ('facet', '<i8')])

The numpy datatype returned when rays are traced with a shapes or KDTree in GIANT.

For an overview of how structured data types work in numpy, refer to https://numpy.org/doc/stable/user/basics.rec.html

The following table describes the purpose of each field.

Field

Type

Description

check

bool

A boolean flag specifying if the ray hit the object

distance

double

The distance between the ray start and the intersect location (if the ray struck the object)

intersect

3 element double the object)

The location that the ray struck the object in the current frame (if the ray struck

normal

3 element double

The unit vector that is normal to the surface at the point the ray struck the object as a 3 element array (if the ray struck the object)

albedo

double

The albedo of the surface as a float

facet

int64

The id of the facet(if traced against a surface)/solid (if traced against a solid) that the ray struck (if the ray struck the object). This will be the fully encoded id so that you could use it in subsequent calls to trace to ignore that facet if so desired.

In general, anywhere that check is not True has no guarantee on the values of the other elements.