Basic models for space and fixtures
This commit is contained in:
parent
30ac7031c1
commit
91deb3fc20
1 changed files with 56 additions and 0 deletions
56
src/models.py
Normal file
56
src/models.py
Normal file
|
@ -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."""
|
Loading…
Reference in a new issue