Skip to content

feat(convert): 3d convert — multicolour scad→3MF Orca project, format conversion, retarget alias (Refs #741) - #746

Merged
alex-mextner merged 1 commit into
mainfrom
roadmap/convert-command
Nov 6, 2026
Merged

alex-mextner merged 1 commit into
mainfrom
roadmap/convert-command

Conversation

@alex-mextner

Copy link
Copy Markdown
Owner

One command for every conversion the libs support: 3d convert IN... OUT, format from the output extension (.stl .3mf .usdz .png; extensionless names filled from the detected format), structured errors listing accepted formats for unsupported routes. Refs #741

What changed (single commit, passed the pre-commit hook before push)

  • lib/commands/convert.py + lib/convert_plan.py + lib/convert_mesh.py: self-registering 3d convert command with the collision contract — input-overwrite auto-suffixes, any other existing target refuses (exit 2) with the ready-to-run free-name command unless --force, re-checked at write time via staging+commit.
  • Multicolour scad→3mf: OpenSCAD's per-triangle color() 3MF export is read colour-grouped (dimension_model) and re-emitted through orca_project_3mf as one object per colour with per-object extruder metadata — a true Orca/Bambu project 3MF (3d arrange/export: no multi-part 3MF with per-part extruder; arrange explodes multi-colour objects and drops extruder metadata #89's long-standing ask).
  • 3mf→3mf retarget alias: convert file.3mf file-u1.3mf --to u1 takes the retarget options and delegates to 3d retarget (--to/--set/--preset/...).
  • Routes: scad/stl/3mf/usdz inputs, stl/3mf/usdz/png outputs; usdz route adds usd-core to the tier; png of a 3mf stages through an STL.
  • Docs: docs/commands/convert.md in sync with --help, plus README and lib-map entries.

Tests (in this commit)

  • tests/test_commands_convert.py — CLI surface: usage/help/exit codes, unknown option, unknown output extension listing accepted formats, one-positional usage error, missing input.
  • tests/test_convert_plan.py — collision contract: existing target refuses with the free-name command, --force overwrites, out==input auto-suffixes, write-time re-check.
  • tests/test_convert_mesh.py — per-route dispatch: scad→stl through OpenSCAD, lossless stl→stl copy, project-3mf→stl world coordinates, project 3mf→3mf repack, colour-aware scad→3mf worker, usd-core tier, png of scad/3mf, two-input png usage error.
  • tests/e2e/test_convert_workflows.py — end-to-end workflows incl. the unzippable multicolour Orca project 3MF.

Rebased onto current main (printer-vision batch #727/#730/#734/#721); only docs/architecture/lib-map.md touched both sides, no conflicts.

@alex-mextner
alex-mextner force-pushed the roadmap/convert-command branch from 18a77d0 to cb86ea0 Compare November 6, 2026 07:52
… conversion, retarget alias (Refs #741)

One command for every conversion the libs support: IN... OUT, format from the
output extension (.stl .3mf .usdz .png; extensionless names filled from the
conversion). scad→3mf is multicolour-aware: OpenSCAD's per-triangle color()
3MF export is read colour-grouped (dimension_model) and re-emitted through
orca_project_3mf as one object per colour with per-object extruder metadata.
3mf→3mf takes the retarget options and delegates to 3d retarget
(convert file.3mf file-u1.3mf --to u1). Collision contract in convert_plan:
input-overwrite auto-suffixes, any other existing target refuses (exit 2)
with the ready-to-run free-name command unless --force, re-checked at write
time via staging+commit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alex-mextner
alex-mextner force-pushed the roadmap/convert-command branch from cb86ea0 to cff049c Compare November 6, 2026 09:04
@alex-mextner
alex-mextner merged commit 66a4b8f into main Nov 6, 2026
10 checks passed
@alex-mextner
alex-mextner deleted the roadmap/convert-command branch November 6, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant