CompactRay
- class raytracing.compact.CompactRay(raysSource, index)
Bases:
RayA view into a shared buffer that behaves like a
Ray.A regular
Raystores its data in normal Python attributes. ACompactRayinstead reads and writes directly into a position inside aCompactRaysbuffer. From the outside it feels identical — you can still writeray.y = 1.0orprint(ray.theta)— but under the hood every access goes through the contiguous numpy array.The memory layout of a single ray is defined by
CompactRay.Struct, a numpy structured dtype with fields: y, theta, z, isBlocked, apertureDiameter, and wavelength (all 32-bit).- Parameters:
raysSource (CompactRays) – The owning buffer that holds the actual data.
index (int) – Position of this ray inside the buffer (0-based).
See also
CompactRaysThe contiguous buffer that owns the data.
RayThe base class whose interface is preserved.
Methods
|
Create a view for one ray inside the shared buffer. |
|
Copy all fields from a regular |
Inherited Methods
|
This function returns a ray at position z along the ray trace. |
|
This function returns a ray at position z parallel to the current ray. |
|
|
|
Attributes
|
|
|
|
|
|
|
|
|
Opposite of isBlocked. |
|
|
|
|
|
|
|