Skip to content

Instantly share code, notes, and snippets.

@ochafik

ochafik/bug.txt Secret

Last active January 26, 2023 16:11
Show Gist options
  • Select an option

  • Save ochafik/25896beac9836da9ab6fb551f906dceb to your computer and use it in GitHub Desktop.

Select an option

Save ochafik/25896beac9836da9ab6fb551f906dceb to your computer and use it in GitHub Desktop.
Color change bug for PrusaSlicer / BambuStudio
Alternate order of colors between slices to reduce color changes (faster prints w/ less waste).
If I'm not mistaken, the slicer currently has a very naive color changing strategy, which leads to massive waste of filament:
βš«οΈΒΉπŸ”„βšͺοΈΒΉπŸ”„
βš«οΈΒ²πŸ”„βšͺοΈΒ²πŸ”„
βš«οΈΒ³πŸ”„βšͺοΈΒ³πŸ”„
βš«οΈβ΄πŸ”„βšͺοΈβ΄πŸ”„
...
(layer numbers are in superscript, πŸ”„ indicates a color change + expensive purge, including a go on the purge tower)
It seems that one could cut the number of color changes by keeping the last color of a slice to start the next slice (with a brief pause to ensure the previous layer has cooled, similar to what is already done for single color printing):
βš«οΈΒΉπŸ”„βšͺ️¹⏸
βšͺοΈΒ²πŸ”„βš«οΈΒ²βΈ
βš«οΈΒ³πŸ”„βšͺ️³⏸
βšͺοΈβ΄πŸ”„βš«οΈβ΄βΈ
...
Assuming the pause between layers is negligible, with two colors, this would save half of the color changes.
In general this saves 1/N of color changes for N-color prints.
πŸ”΄ΒΉπŸ”„πŸŸ’ΒΉπŸ”„πŸ”΅ΒΉπŸ”„
πŸ”΄Β²πŸ”„πŸŸ’Β²πŸ”„πŸ”΅Β²πŸ”„
πŸ”΄Β³πŸ”„πŸŸ’Β³πŸ”„πŸ”΅Β³πŸ”„
πŸ”΄β΄πŸ”„πŸŸ’β΄πŸ”„πŸ”΅β΄πŸ”„
...
Keep last color of a slice to start next slice (after short pause):
πŸ”΄ΒΉπŸ”„πŸŸ’ΒΉπŸ”„πŸ”΅ΒΉβΈ
πŸ”΅Β²πŸ”„πŸ”΄Β²πŸ”„πŸŸ’Β²βΈ
πŸŸ’Β³πŸ”„πŸ”΄Β³πŸ”„πŸ”΅Β³βΈ
πŸ”΅β΄πŸ”„πŸ”΄β΄πŸ”„πŸŸ’β΄βΈ
...
While this could in theory be implemented by some G-code post processor, it seems a bit challenging to do so (esp. when purge towers are involved).
Any thoughts?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment