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 a view's incident/exit materials from its base surface. |
Classes
|
A view of a base |
- class SurfaceView(base_surface: Surface, reverse: bool = False, interaction_override: str | None = None, previous_view: SurfaceView | None = None)[source]#
A view of a base
Surfacewithin 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", orNoneto use the base surface’s nominal interaction.previous_view – The preceding view in the sequence, or
Noneif this is the first step.
- property aperture: BaseAperture | None#
- property geometry#
- property material_post: BaseMaterial#
- property material_pre: BaseMaterial#
- property previous_surface#
Anchor for
BaseInteractionModel.material_pre’s chain lookup.BaseInteractionModel.material_preresolves asself.parent_surface.previous_surface.material_post. Views resolve their materials directly from the base surface (seeresolve_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-Nonebranch, which keeps the first-step case correct too.
- 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", orNone.
- Returns:
The
(material_pre, material_post)pair for this view.