From ff88e90854478906e6d0eb78d6ade4756a8071b7 Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 22 Dec 2023 02:54:33 +0000 Subject: [PATCH] add build files to produce the gcode --- Makefile | 20 ++++++++++++++++++-- build-nix | 4 ++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100755 build-nix diff --git a/Makefile b/Makefile index 89e28a6..6f2c11b 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/build-nix b/build-nix new file mode 100755 index 0000000..2522eb6 --- /dev/null +++ b/build-nix @@ -0,0 +1,4 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p bash -p gnumake -p slic3r + +make