surfaces.object_surface#

Object Surface

This module contains the ObjectSurface class, which represents an object surface in an optical system.

Kramer Harrison, 2024

Classes

ObjectSurface(geometry, material_post[, comment])

Represents an object surface in an optical system.

class ObjectSurface(geometry, material_post, comment='')[source]#

Represents an object surface in an optical system.

Parameters:
  • geometry (Geometry) – The geometry of the surface.

  • material_post (Material) – The material of the surface after interaction.

  • comment (str, optional) – A comment for the surface. Defaults to ‘’.

Variables:

is_infinite (bool) – Indicates whether the surface is infinitely far away.

property coating#
flip()#

Flips the surface, swapping materials and reversing geometry.

classmethod from_dict(data)#

Creates a surface from a dictionary representation.

Parameters:

data (dict) – The dictionary representation of the surface.

Returns:

The surface.

Return type:

Surface

property is_infinite#

Returns True if the surface is infinitely far away, False otherwise.

Classic authoring spells an object at infinity as cs.z = -inf, because the axis is z. A system entered off that axis – a collimated source posed to fire along +x into a fold – puts the same infinity in x or y, so any infinite vertex coordinate says the same thing.

is_rotationally_symmetric()#

Returns True if the surface is rotationally symmetric, False otherwise.

property material_post: BaseMaterial | None#
property material_pre#
property previous_surface#
reset()#

Resets the recorded information of the surface.

set_aperture()[source]#

Sets the aperture of the surface.

set_fresnel_coating()#

Sets the coating of the surface to a Fresnel coating.

set_semi_aperture(r_max: float)#

Sets the physical semi-aperture of the surface.

Parameters:

r_max (float) – The maximum radius of the semi-aperture.

subscribe(callback: Callable) None#

Register a callback to be called when this object changes.

Parameters:

callback – Zero-argument callable to invoke on change.

to_dict()[source]#

Returns a dictionary representation of the surface.

trace(rays: BaseRays, record: bool = True) BaseRays[source]#

Traces the given rays through the surface.

Parameters:
  • rays (BaseRays) – The rays to be traced.

  • record (bool, optional) – Whether to store the traced ray state on the surface. Defaults to True.

Returns:

The traced rays.

Return type:

BaseRays

unsubscribe(callback: Callable) None#

Remove a previously registered callback.

Parameters:

callback – The callable to remove. No-op if not registered.