Skip to content

feat(slice): pass nozzle_volume_type to Bambu Studio - #21

Open
jlapenna wants to merge 1 commit into
voska:mainfrom
jlapenna:feat/slice-nozzle-volume-type
Open

jlapenna wants to merge 1 commit into
voska:mainfrom
jlapenna:feat/slice-nozzle-volume-type

Conversation

@jlapenna

@jlapenna jlapenna commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Problem and impact

A printer with a 0.4 mm High Flow nozzle (X1C HE01) cannot be sliced for it. Stock machine presets omit nozzle_volume_type, so slice --set nozzle_volume_type="High Flow" exits 2 with unknown setting. Bambu Studio's CLI also slices for a Standard nozzle unless the variant is named with --nozzle-volume-type; a loaded config value alone is not enough. The job then uses the Standard filament variant: on an X1C gridfinity bin in Bambu PETG HF, the Standard slice predicted 2989 s against 2905 s for High Flow, with different G-code throughout.

Change

  • --set nozzle_volume_type=... is routed to the machine config even when the preset omits the key (other unknown keys still fail).
  • When set, slice passes the same value to Studio as --nozzle-volume-type.
  • Without the override, the Studio invocation is unchanged (asserted in TestRunWithFakeStudio).
  • CHANGELOG entry under Unreleased.

Verification

  • make ci: lint 0 issues, vet, race tests and build pass. The pinned goimports and gofumpt report no differences (run directly, because the Makefile's /bin/sh pipeline prints read: arg count on this host).
  • Real Bambu Studio 02.08.02.61 on Linux, X1C 0.4 nozzle, functional-petg with Bambu PETG HF, --color 000000:
    • with --set nozzle_volume_type="High Flow": saved project_settings.config has nozzle_volume_type: ["High Flow"], the filament uses the High Flow variant, and prediction is 2905 s / 20.38 g.
    • without it: Standard, 2989 s / 20.34 g.
  • No printer was contacted for this change.

Stock machine presets omit nozzle_volume_type, so --set rejected it, and
Bambu Studio's CLI slices for a Standard nozzle unless the variant is
named with --nozzle-volume-type. Route the key to the machine config and
pass the flag, so a high-flow nozzle gets its own filament variant.
Without the override the Studio invocation is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WYsJjZDRreR4EcqEwpWtv
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T22:05:26.344538Z f34bb0a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@voska

voska commented Dec 3, 2026

Copy link
Copy Markdown
Owner

The single-value path works. One blocking bug: Run joins multiple values with ;, but Studio parses --nozzle-volume-type as a comma-separated list. ConfigOptionEnumsGeneric::deserialize in src/libslic3r/Config.hpp splits on , and fails on any item it can't match. On Studio 02.09.02.62, --set 'nozzle_volume_type=["High Flow","High Flow"]' exits 11 with an empty slicer.log, and the same slice succeeds with a , join. That's the input an H2D needs.

Can you switch the join to strings.Join(vals, ",") and add a two-value case to TestRunWithFakeStudio asserting --nozzle-volume-type\nHigh Flow,Standard\n in the recorded args?

This branch has not been deployed

No deployments
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.

2 participants