visualization.info.material_formatter
Material Formatter Module
This module provides a flexible mechanism for formatting material information for display. It uses a registry pattern to allow different material types to be formatted in specific ways without modifying the core visualization code.
Kramer Harrison, 2026
Classes
A registry-based formatter for material information. |
- class MaterialFormatter[source]
A registry-based formatter for material information.
- classmethod format(surface: Surface) str[source]
Formats the material information for a given surface.
- Parameters:
surface – The surface whose material information is to be formatted.
- Returns:
A formatted string description of the material.
- Return type:
str
- classmethod register(material_type: type, formatter: Callable[[Surface], str])[source]
Registers a formatter function for a specific material type.
- Parameters:
material_type – The class of the material to format.
formatter – A function that takes a Surface object and returns a formatted string description of its material.