From 6add49dc7a601e1c48d92ee147a6f97c16fdd401 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 10 Mar 2025 02:39:16 +0000 Subject: [PATCH] add support for building .sl1 and .ctb outputs, for resin-based printers --- Makefile | 12 +++++++++++- README.md | 3 +++ flake.nix | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d186d03..270caaa 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README.md b/README.md index bcf921a..0740905 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/flake.nix b/flake.nix index 2758ecc..c9c7cac 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,7 @@ buildInputs = [ cqPkgs.cadquery cqPkgs.cq-editor + pkgs.prusa-slicer pkgs.slic3r pkgs.chromium # (pkgs.python37.withPackages (ps: with ps; [ cadquery ]))