phone-case/Makefile

57 lines
1.9 KiB
Makefile

PREFIX=/usr
SHAREDIR=$(PREFIX)/share/models
PRINT_TEMP=220
PRINT_BED_TEMP=65
PRINT_NOZZLE_DIAM=0.2
PRINT_FILA_DIAM=1.75
# settings for Bambu p1p 3d printer
# 50mm/sec w/ raft=2, 0.4diam (wrong!), density 20%: works but causes very rough edges
# 40mm/sec w/ raft=0, 0.4diam (wrong!), density 20%: fails; infill becomes too sparse
# 35mm/sec w/ raft=0, 0.4diam (wrong!), density 50%, honeycomb: works, corners are rough
# 25mm/sec w/ raft=0, 0.2diam, density 75%, rectilinear: fails; detached from bed
# 35mm/sec w/ raft=0, 0.2diam, density 75%, rectilinear, first-layer 0.2: works, but takes like 6 hours to print
# - 2.5mm thickness => needlessly thick; stiff
# - 160mm length => too short
# - 3/3.5/6.0mm overhang => too much (that amount of overhang can't be printed reliably)
# - port cutouts => should extend into more z
PRINT_SPEED=40
PRINT_DENSITY=20
PRINT_RAFT_LAYERS=0
PRINT_FILL_PATTERN=rectilinear
# XXX: Slic3r 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) \
--solid-infill-speed $(PRINT_SPEED) \
--first-layer-speed $(PRINT_SPEED) \
--infill-speed $(PRINT_SPEED) \
--raft-layers $(PRINT_RAFT_LAYERS) \
--fill-density $(PRINT_DENSITY) \
--fill-pattern $(PRINT_FILL_PATTERN) \
--use-firmware-retraction \
--first-layer-height 0.2 \
--skirts 2
all: build/cases/pp.stl build/cases/pp.gcode
build/cases/pp.stl: src/pp/*.scad
build/%.stl: src/%.scad src/*.scad src/lib/*.scad
mkdir -p $(shell dirname $@)
openscad $< -o $@
%.gcode: %.stl
slic3r $(SLIC3R_FLAGS) $< -o $@
install:
mkdir -p $(SHAREDIR)
install -m644 build/case.stl $(SHAREDIR)
install -m644 build/case.gcode $(SHAREDIR)
.PHONY: all install