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 ‘’.

is_infinite

Indicates whether the surface is infinitely far away.

Type:

bool

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.

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) BaseRays[source]

Traces the given rays through the surface.

Parameters:

rays (BaseRays) – The rays to be traced.

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.