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

Add PolyTerra™ PLA, polymaker script #34

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

clevelandcs
Copy link

@clevelandcs clevelandcs commented Jun 24, 2024

This PR contains the following changes:

  • Add Polymaker PolyTerra™ PLA
  • Add script for importing colors and hex values from Polymaker's online store
  • Integrate Polymaker color script into compile-filaments.py

I 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:

  • Install dependencies python3 -m pip install -r scripts/requirements.txt
  • Create basic fields for the filament in polymaker.json but leave color as "color": [] and "product_url" : "<product_page-url>"
  • Add filament name and colors block to the filaments block at the bottom of import-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.
  • Run python3 scripts/compile-filaments.py
  • Done!

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.
  • Colors array must be empty - to prevent overwriting for filament types like silk with multiple hexes
  • Colors that do not have a hex value from Polymaker will be entered as white ffffff
  • Dual extrusion color filament not supported Polymaker don't provide these hex values on their website so I didn't code for the edge case that doesn't have data
  • 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

@Donkie
Copy link
Owner

Donkie commented Aug 25, 2024

Sorry for the late response.

I don't really like the idea of having various scripts for scraping websites and automating tasks like this. It's better off if you scrape it yourself and then just commit the results. Otherwise it ends up in something I have to maintain.

If you could remove the script then I can merge this.

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