Add python based source for designs

Copy structure of src/designs.lua to designs.py to have the metadata for
the available designs available to Python scripts.
This commit is contained in:
Hornwitser 2025-06-07 18:25:09 +02:00
parent 8d9a16b307
commit c9755b3576

82
designs.py Normal file
View file

@ -0,0 +1,82 @@
# Keep this file in sync with src/designs.lua
colors = [
"red",
"green",
"black",
"cyan",
"purple",
"yellow",
"white",
"orange",
"pink",
"blue",
"lime",
]
contents = [
"empty",
"liquid",
"frozen",
]
base_models = [
"cone_normal",
"cone_slim",
"cone_inverted",
"cylinder",
"tube_one",
"tube_two",
"tube_three",
"sphere_normal",
"sphere_tiny",
"sphere_double",
"sphere_tubed",
"sphere_hemi",
"sphere_spiked",
"hourglass",
"torus",
"klein",
"pyramid",
"cube",
"triangle",
"triangle_alt",
"pentagon",
"hexagon",
]
frozen_models = [
"cone_normal",
]
models = {}
for model in base_models:
variants = {
"empty": {
"name": "empty",
"model": model,
"contents": "empty",
},
}
for color in colors:
variants[f"liquid_{color}"] = {
"name": f"liquid_{color}",
"model": model,
"color": color,
"contents": "liquid",
}
if model in frozen_models:
for color in colors:
variants[f"frozen_{color}"] = {
"model": model,
"name": f"frozen_{color}",
"color": color,
"contents": "frozen",
}
models[model] = {
"name": model,
"variants": variants,
}