A small web tool for the Sorter build. Pick your frame and core colors and a layer count, and it tells you exactly how much filament to order — plus lets you download the current known-good STLs.
The grams are not estimates: every part is sliced with OrcaSlicer and the tool reads the slicer's own filament weight.
Two pieces:
slicer/— a local Python step (needs OrcaSlicer installed). It slices every part once, readsused_g, renders a thumbnail, copies the STL, and writes the data the site reads. This never runs on Vercel.- SvelteKit app (
src/) — reads the generated data and does all the color/layer math in the browser. Fully static; deploys to Vercel as-is.
slicer/
parts.json # manifest: every part, its section(s), qty, color role
parts/<section>/*.stl # source STLs (the known-good iteration)
filament.py # the local data-generation step
src/lib/data/parts.generated.json # GENERATED, committed — the app's input
static/renders/*.png # GENERATED, committed — thumbnails
static/stl/*.stl, all-parts.zip # GENERATED, committed — downloads
- Drop new STLs into
slicer/parts/<section>/(sections:feeder,interface-top,interface-bottom,layer). - Add/edit entries in
slicer/parts.json— setquantities,color_role(frame/core/any, orfixed+fixed_color), andoptional. - Run the slicer:
(add
/opt/homebrew/opt/python@3.11/libexec/bin/python slicer/filament.py--forceto re-slice/re-render everything) - Commit the changes (STLs go to Git LFS automatically) and push. Vercel redeploys.
Slicer settings live at the top of slicer/filament.py (printer, infill,
supports, etc.). Terminology is in slicer/PARTS_CONTEXT.md.
npm install
npm run dev
STLs/3mfs are committed as normal Git objects (not LFS) so Vercel serves the real files.
Drop pre-arranged .3mf plates into slicer/plates/ (auto-discovered). filament.py
copies each to static/plates/ for download, pulls its embedded plate previews, and
reads the parts it contains. To cross-link a plate's parts to the catalog, set a part's
source field in parts.json to the part's original filename as it appears in the 3mf.