From 91deb3fc205c56e2e44036b4c8045802fb622a5b Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 12 Sep 2025 22:30:31 +0200 Subject: [PATCH] Basic models for space and fixtures --- src/models.py | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/models.py diff --git a/src/models.py b/src/models.py new file mode 100644 index 0000000..3a6cabf --- /dev/null +++ b/src/models.py @@ -0,0 +1,56 @@ +from dataclasses import dataclass +from enum import Enum + +@dataclass +class SpaceVector: + """A 3-dimensional coordinate structure with clear orientation.""" + + lr: float + """Left-to-Right.""" + + tb: float + """Top-to-Bottom.""" + + fb: float + """Front-to-Behind.""" + +class Capabilities(Enum): + SWITCH = "switch" + BRIGHTNESS = "brightness" + TEMPERATURE = "temperature" + COLOR = "color" + +@dataclass +class Fixture: + """Definition of a fixture that generates light, its capabilities and positioning.""" + + id: str + """Unique identifier for fixture.""" + + capabilities: Capabilities + """Which dynamic capabilities does the fixture have.""" + + position: SpaceVector + """Position of the fixture in the space in meters.""" + + target: SpaceVector + """Position of the light generated by the ficture in the space in meters.""" + + spread: SpaceVector + """Spread of the light in the space at the target in meters.""" + + exposure: float + """In range [0,1], how exposed is the light source of the fixture. 0: no exposure. 1: full exposure.""" + +@dataclass +class Space: + """A space containing fixtures.""" + + id: str + """Unique identifier for space.""" + + fixtures: list[Fixture] + """All fixtures present in the space.""" + + center: SpaceVector + """A reference point in the space from which the audience perspective might be assumed."""