Add PolyTerra™ PLA, polymaker script #34
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following changes:
Add script for importing colors and hex values from Polymaker's online storeI just got in an order of 10 different colors of PolyTerra PLA and thought what a good time to try out the load from external source feature. Alas Polymaker exists but no PolyTerra so here's every color of PolyTerra added to the data. Since I didn't want to copy paste that many items by hand I created a small python script to load the hex values Polymaker supplies on the store.
Steps to use the script:
python3 -m pip install -r scripts/requirements.txt
"color": []
and"product_url" : "<product_page-url>"
Add filament name and colors block to the filaments block at the bottom ofimport-polymakercolors.py
copying the name you gave the filament in polymaker.json and changing the URL to the URL of the Polymaker product page for that line.python3 scripts/compile-filaments.py
Limitations of script modification:
Entire color block is replaced - this is intentional to avoid complicated merge logic - comparing hex colors for existing filaments in polymaker.json and my own manual entries in Spoolman show very little difference in practical use and are the result of camera sensors and batch variance.Still have to create base block in polymaker.json and a filament block in the script this is a tradeoff for a tiny amount of duplicate data in return adding functionality to need to explicitly add a filament for it's colors to be overwritten and not complicating compile-filaments.py for a single manufacturer color generator script. Also Polymaker doesn't report every field needed and provide others as ranges or other hard to retrieve formats