surfaces.factories.material_factory
Material Factory Module
This module contains the MaterialFactory class, which is responsible for generating material instances based on input configurations. The class abstracts material creation, allowing seamless integration with the surface factory and other optical system components in Optiland.
Kramer Harrison, 2025
Classes
Factory class for creating material instances based on input specifications. |
- class MaterialFactory[source]
Factory class for creating material instances based on input specifications.
This class provides an interface for creating different types of materials, including ideal materials, predefined materials, and user-defined materials.
- create(index, material_spec, surface_group)[source]
Determines the material before and after a surface based on its position.
- Parameters:
index (int) – The index of the surface within the surface group.
material_spec (BaseMaterial | MaterialSpec | tuple | str | dict) – The material specification.
surface_group (SurfaceGroup) – The surface group containing the surfaces.
- Returns:
The material before the surface (None for the object surface).
The material after the surface.
- Return type:
tuple[BaseMaterial | None, BaseMaterial]