Skip to content

feat(scadm): add scadm export-png command #333

@kellervater

Description

@kellervater

📦 What

Move the export-png.sh script functionality into scadm as a scadm export-png command so both homeracker and homeracker-exclusive can use it without duplicating the script.

💡 Why

cmd/export/export-png.sh is currently duplicated across repos (homeracker core and homeracker-exclusive, with the exclusive version adding -D and --output support). This violates DRY — scadm already manages OpenSCAD installation and knows where the binary lives. 🔧

🔧 Proposed Features

  • scadm export-png <input.scad> — basic PNG export
  • --output <path> — custom output path
  • -D key=value — OpenSCAD variable overrides (repeatable)
  • --view <mode> — preset camera angles: iso (default), front, top, back, left, right, bottom, all (renders all views as separate PNGs)
  • --imgsize W,H — image dimensions (default: 1920,1080 🖥️)
  • --colorscheme <name> — OpenSCAD color scheme (default: BeforeDawn 🌑)
  • --camera <params> — raw camera override: translate_x,y,z,rot_x,y,z,distoverrides --view when both are specified ⚠️

📐 View Presets

View Camera (translate_x,y,z,rot_x,y,z,dist)
iso 0,0,0,55,0,35,0 (default)
front 0,0,0,0,0,0,0
top 0,0,0,90,0,0,0
back 0,0,0,0,0,180,0
left 0,0,0,0,0,90,0
right 0,0,0,0,0,270,0
bottom 0,0,0,270,0,0,0
all renders all of the above as <name>_<view>.png

💡 --autocenter --viewall is always applied, so dist=0 lets OpenSCAD auto-fit.

✅ Once Available

Both repos can remove their export-png.sh scripts and use scadm export-png directly. The render-mw-modules.sh wrapper (exclusive repo) can also switch to calling scadm export-png. 🚀

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions