add support for building .sl1 and .ctb outputs, for resin-based printers

This commit is contained in:
2025-03-10 02:39:16 +00:00
parent 3a44753d6b
commit 6add49dc7a
3 changed files with 15 additions and 1 deletions

View File

@@ -66,7 +66,7 @@ SLIC3R_FLAGS=\
--skirts 3
# --brim-width 10 #< combine with raft, if first layer fails to adhere well
all: build/case.stl build/case.gcode
all: build/case.stl build/case.gcode build/case.sl1 build/case.ctb
install:
mkdir -p $(SHAREDIR)
@@ -101,10 +101,20 @@ build/case.stl: main.py src/*.py
mkdir -p "$(@D)"
./main.py --export-stl $@
# .gcode: for FDM printers
%.gcode: %.stl
mkdir -p $(shell dirname $@)
slic3r $(SLIC3R_FLAGS) $< -o $@
# .sl1: for prusa resin-based printers
%.sl1: %.stl
prusa-slicer --export-sla $<
# .ctb: for Elegoo printers (requires `uvtools` package)
%.ctb: %.sl1
# XXX: UVtoolsCmd exits `1` on success ?? (what does it exit on failure? bleh)
UVtoolsCmd convert $< Chitubox $@ || test -f $@
readme: readme_files/pinephone_front_case_with_phone.png readme_files/pinephone_back_case_with_phone.png readme_files/pinephone_side_case_with_phone.png
doc: readme build/web-viewer/index.html

View File

@@ -27,6 +27,9 @@ you'll need a browser which supports webGL (e.g. chromium).
- Python3
- cadquery
- cq-editor (for interactive viewing/development)
- slic3r (if you want .gcode files, for FDM printers)
- prusa-slicer (if you want .sl1 files, for resin printers)
- uvtools (if you want .ctb files, for resin printers)
## Building

View File

@@ -14,6 +14,7 @@
buildInputs = [
cqPkgs.cadquery
cqPkgs.cq-editor
pkgs.prusa-slicer
pkgs.slic3r
pkgs.chromium
# (pkgs.python37.withPackages (ps: with ps; [ cadquery ]))