jschobben / colorscad

Script to produce colorized OpenSCAD models
Other
43 stars 7 forks source link

Name components by color #11

Open jschobben opened 2 months ago

jschobben commented 2 months ago

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: