Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name components by color #11

Merged
merged 3 commits into from
Sep 14, 2024
Merged

Name components by color #11

merged 3 commits into from
Sep 14, 2024

Conversation

jschobben
Copy link
Owner

@jschobben jschobben commented May 27, 2024

This adds a human-readable name to generated color components, to make assigning filaments to colors easier in a slicer for instance.

For now, it's implemented only for .3mf output, and tested to work with the latest OrcaSlicer and Cura. These two read the name from a different part in the input though, so the name is set in both places to make it work for either slicer.

The name is derived from the color values post-csg conversion, so for instance "red" becomes [1, 0, 0, 1]. In a follow-up PR we can try to use the original name perhaps, or even allow defining a custom name.

Some TODOs before this can be merged:

  • Test with more slicers; works with OrcaSlicer, Bambu Studio, Cura, PrusaSlicer and SuperSlicer
  • [ ] Implement it for .amf output too Most slicers don't even support amf color properly, let's focus on 3mf

This makes it much easier to map color to filament in a slicer, for instance.
However not all slicers extract the name from the same place, so some redundancy is needed for more compatibility.
For now, the name used is simply "[R, G, B, A]".
@jschobben jschobben merged commit 4d098fc into master Sep 14, 2024
16 checks passed
@jschobben jschobben deleted the feat/name-components-by-color branch September 14, 2024 20:02
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