feat: Add role for components

This commit is contained in:
Leni Aniva 2024-06-27 23:26:21 -04:00
parent 57e1bce3e7
commit 1c7f218a2b
Signed by: aniva
GPG Key ID: 4D9B1C8D10EA4C50
1 changed files with 18 additions and 0 deletions

View File

@ -8,7 +8,25 @@ def _color(name: str, alpha: float) -> Cq.Color:
r, g, b, _ = Cq.Color(name).toTuple() r, g, b, _ = Cq.Color(name).toTuple()
return Cq.Color(r, g, b, alpha) return Cq.Color(r, g, b, alpha)
class Role(Enum):
"""
Describes the role of a part
"""
# Parent and child components in a load bearing joint
PARENT = _color('blue4', 0.6)
CHILD = _color('darkorange2', 0.6)
STRUCTURE = _color('gray', 0.4)
DECORATION = _color('lightseagreen', 0.4)
ELECTRONIC = _color('mediumorchid', 0.5)
def __init__(self, color: Cq.Color):
self.color = color
class Material(Enum): class Material(Enum):
"""
A catalog of common material properties
"""
WOOD_BIRCH = 0.8, _color('bisque', 0.9) WOOD_BIRCH = 0.8, _color('bisque', 0.9)
PLASTIC_PLA = 0.5, _color('azure3', 0.6) PLASTIC_PLA = 0.5, _color('azure3', 0.6)