seedling tray: add water tray and pressing tool
This commit is contained in:
+43
-14
@@ -20,28 +20,30 @@ def render_scad(
|
||||
rows: int,
|
||||
cell_size: float,
|
||||
tray_height: float,
|
||||
water_tray_height: float,
|
||||
render_mode: str,
|
||||
) -> None:
|
||||
cmd = (
|
||||
f'openscad '
|
||||
f'-D cols={cols} '
|
||||
f'-D rows={rows} '
|
||||
f'-D cell_size={cell_size} '
|
||||
f'-D tray_height={tray_height} '
|
||||
f'-D \'render_mode="{render_mode}"\' '
|
||||
f'-o "{out_file}" '
|
||||
f'"{scad_file}"'
|
||||
)
|
||||
cmd = [
|
||||
"openscad",
|
||||
"-D", f"cols={cols}",
|
||||
"-D", f"rows={rows}",
|
||||
"-D", f"cell_size={cell_size}",
|
||||
"-D", f"tray_height={tray_height}",
|
||||
"-D", f"water_tray_height={water_tray_height}",
|
||||
"-D", f'render_mode="{render_mode}"',
|
||||
"-o", str(out_file),
|
||||
str(scad_file),
|
||||
]
|
||||
|
||||
result = subprocess.run(
|
||||
["bash", "-lc", cmd],
|
||||
cmd,
|
||||
cwd=BASE_DIR,
|
||||
text=True,
|
||||
capture_output=True,
|
||||
)
|
||||
|
||||
if result.returncode != 0:
|
||||
print(f"\nFailed to render {scad_file.name}")
|
||||
print(f"\nFailed to render {scad_file.name} ({render_mode})")
|
||||
if result.stdout:
|
||||
print(result.stdout)
|
||||
if result.stderr:
|
||||
@@ -61,6 +63,7 @@ def main() -> None:
|
||||
rows = ask_int("Number of rows (rows): ")
|
||||
cell_size = ask_float("Inner cell size in mm (cell_size): ")
|
||||
tray_height = ask_float("Tray height in mm (tray_height): ")
|
||||
water_tray_height = ask_float("Water tray wall height in mm (water_tray_height): ")
|
||||
|
||||
OUT_DIR.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@@ -68,7 +71,7 @@ def main() -> None:
|
||||
if not scad_file.exists():
|
||||
raise SystemExit(f"Missing file: {scad_file}")
|
||||
|
||||
# Render the tray only
|
||||
# seedling tray
|
||||
render_scad(
|
||||
scad_file,
|
||||
OUT_DIR / "seedlings-tray.stl",
|
||||
@@ -76,10 +79,11 @@ def main() -> None:
|
||||
rows,
|
||||
cell_size,
|
||||
tray_height,
|
||||
water_tray_height,
|
||||
"tray_only",
|
||||
)
|
||||
|
||||
# Render all plates in a grid
|
||||
# removable plates
|
||||
render_scad(
|
||||
scad_file,
|
||||
OUT_DIR / "plates.stl",
|
||||
@@ -87,9 +91,34 @@ def main() -> None:
|
||||
rows,
|
||||
cell_size,
|
||||
tray_height,
|
||||
water_tray_height,
|
||||
"plates_only",
|
||||
)
|
||||
|
||||
# water tray
|
||||
render_scad(
|
||||
scad_file,
|
||||
OUT_DIR / "water-tray.stl",
|
||||
cols,
|
||||
rows,
|
||||
cell_size,
|
||||
tray_height,
|
||||
water_tray_height,
|
||||
"water_tray_only",
|
||||
)
|
||||
|
||||
# pressing tool
|
||||
render_scad(
|
||||
scad_file,
|
||||
OUT_DIR / "pusher-tool.stl",
|
||||
cols,
|
||||
rows,
|
||||
cell_size,
|
||||
tray_height,
|
||||
water_tray_height,
|
||||
"tool_only",
|
||||
)
|
||||
|
||||
print("\nDone.")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user