sequences.surface_view#

SurfaceView: a per-sequence proxy over a shared base Surface.

A SurfaceView shares geometry, material, aperture and coating with a base Surface by reference, but owns its own per-visit record buffers, direction and interaction model. It implements the same duck-typed interface that _TracingCoordinator and the BaseRays subclasses use (reset, geometry, _trace_real, _record_real, _trace_paraxial, _record_paraxial), so it traces through the existing, unforked tracing pipeline with zero changes to Surface or the rays classes.

Kramer Harrison, 2026

Functions

resolve_view_materials(base_surface, ...)

Resolve a view's incident/exit materials from its base surface.

Classes

SurfaceView(base_surface[, reverse, ...])

A view of a base Surface within one step of a sequence.

class SurfaceView(base_surface: Surface, reverse: bool = False, interaction_override: str | None = None, previous_view: SurfaceView | None = None)[source]#

A view of a base Surface within one step of a sequence.

Geometry, aperture, and coating/BSDF objects are shared with the base surface by reference, so editing the base surface (or optimizing a variable on it) is immediately visible through every view. Record buffers, the interaction model instance, and the traversal direction are owned by the view.

Parameters:
  • base_surface – The shared base surface.

  • reverse – Whether this step traverses the surface in the reverse physical direction.

  • interaction_override"reflect", "refract", or None to use the base surface’s nominal interaction.

  • previous_view – The preceding view in the sequence, or None if this is the first step.

property aperture: BaseAperture | None#
property comment: str#
property geometry#
property is_stop: bool#
property material_post: BaseMaterial#
property material_pre: BaseMaterial#
property previous_surface#

Anchor for BaseInteractionModel.material_pre’s chain lookup.

BaseInteractionModel.material_pre resolves as self.parent_surface.previous_surface.material_post. Views resolve their materials directly from the base surface (see resolve_view_materials()) rather than by walking a physical chain, so this returns a stand-in object exposing exactly that already-resolved value — always taking the non-None branch, which keeps the first-step case correct too.

reset() None[source]#

Resets the recorded information owned by this view.

property semi_aperture: float | None#
property surface_type: str | None#
property thickness: float#
trace(rays)[source]#
resolve_view_materials(base_surface: Surface, reverse: bool, interaction_override: str | None) tuple[BaseMaterial, BaseMaterial][source]#

Resolve a view’s incident/exit materials from its base surface.

Parameters:
  • base_surface – The shared base surface.

  • reverse – Whether this step traverses the surface in the reverse physical direction.

  • interaction_override"reflect", "refract", or None.

Returns:

The (material_pre, material_post) pair for this view.