add build files to produce the gcode

This commit is contained in:
Colin 2023-12-22 02:54:33 +00:00
parent f63c194ad1
commit ff88e90854
2 changed files with 22 additions and 2 deletions

View File

@ -1,11 +1,27 @@
PREFIX=/usr
SHAREDIR=$(PREFIX)/share/models
PRINT_TEMP=220
PRINT_BED_TEMP=65
PRINT_NOZZLE_DIAM=0.4
PRINT_FILA_DIAM=1.75
# XXX: Slic2r doesn't always set the bed temperature correctly. fix by specifying it also for the first layer.
SLIC3R_FLAGS=\
--temperature $(PRINT_TEMP) \
--first-layer-temperature $(PRINT_TEMP) \
--bed-temperature $(PRINT_BED_TEMP) \
--first-layer-bed-temperature $(PRINT_BED_TEMP) \
--nozzle-diameter $(PRINT_NOZZLE_DIAM) \
--filament-diameter $(PRINT_FILA_DIAM)
all: case.stl
all: build/case.stl build/case.gcode
%.stl: %.scad
build/%.stl: %.scad
mkdir -p build
openscad $^ -o $@
%.gcode: %.stl
slic3r $(SLIC3R_FLAGS) %^ -o $@
install:
mkdir -p $(SHAREDIR)
install -m644 case.stl $(SHAREDIR)

4
build-nix Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash -p gnumake -p slic3r
make