CompactRaytrace

class raytracing.compact.CompactRaytrace(compactRays, firstIndex, traceLength)

Bases: RayTrace

A view into a slice of a CompactRays buffer representing one ray trace.

When a single input ray is propagated through N optical elements, it produces N output rays (one after each element). These N consecutive entries in the output buffer form one trace. CompactRaytrace gives convenient access to that slice without copying any data.

Inherits __str__, __repr__, __iter__, and __next__ from RayTrace. Overrides __len__ and __getitem__ for buffer access.

Parameters:
  • compactRays (CompactRays) – The output buffer containing all traces laid out end to end.

  • firstIndex (int) – Index of the first ray in this trace inside the buffer.

  • traceLength (int) – Number of rays in this trace (equals the number of optical elements).

Methods

__init__(compactRays, firstIndex, traceLength)

Inherited Methods

Attributes

lastRay

The final ray after propagation through all elements.