-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
81 lines (66 loc) · 3.13 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
ALL_OUTPUT=$(addprefix fab/, \
thin_shield_no_support.stl thin_shield_with_support.stl \
thin_pla_shield_no_support.stl thin_pla_shield_with_support.stl \
thin-stack2.stl thin-stack3.stl thin-stack4.stl thin-stack5.stl \
bottom_reinforcement.stl bottom_reinforcement-full_plate-fast.3mf) \
img/version-img.png baseline/maker-nexus-faceshield-cut.dxf
# The 3mf file does not store the relative directory for some reason, so
# we have to put it here, to be able to easily reload-from-disk
# Reload-from-disk still needs to be manually (is there a commandline option
# for prusa-slicer to do that?)
release: fab/thin_shield_with_support.stl fab/thin_pla_shield_with_support.stl fab/bottom_reinforcement.stl
ln -sf $^ .
# Same for stacks: prepare the STLs and link to local directory where 3mf
# is. That way, we can do a simple 'reload from disk'
stacks: fab/thin-stack2.stl fab/thin-stack3.stl fab/thin-stack4.stl fab/thin-stack5.stl
ln -sf $^ .
# Building all the STLs we also push in fab/
all: $(ALL_OUTPUT)
# -- concrete rules
img/version-img.png: fab/thin_shield_no_support.scad baseline/RC2-nexusized-thin.stl
openscad -o$@-tmp.png --imgsize=1024,1024 \
--camera=-0.5,-24.8,38,66.2,0,270,35 \
--colorscheme=Nature $< \
&& cat $@-tmp.png | pngtopnm | pnmcrop | pnmscale 0.25 | pnmtopng > $@
rm -f $@-tmp.png
# The bottom reinforcment is just the same as the original.
fab/bottom_reinforcement.stl : baseline/bottom_reinforcement.stl
cp $^ $@
# Use replicate_model script to create a mk3 build plate full of bottom_reinforcement pieces
# Prints in 7:29
fab/bottom_reinforcement-full_plate-fast.3mf:
python3 scripts/replicate_model.py \
--model baseline/bottom_reinforcement-single-fast.3mf \
--output $@ \
--x_offset 4 --front_offset 10 --rear_offset 5 \
--x_gap 1 --y_spacing 8.2
# -- pattern rules
# Qualifying with a support suffix, to distinguish from bottom_reinforcement
%_support.stl: %_support.scad baseline/RC2-nexusized-*.stl
openscad -o $@ $<
# Create an scad file on-the-fly that calls that particular function
fab/%.scad : prusa-covid-shield-remix.scad
mkdir -p fab
echo "use <../prusa-covid-shield-remix.scad>; $*();" > $@
# Various stack arrangements in different heights.
define make-stack-rule
fab/thin-stack$(1).stl: fab/thin_stack_with_support.scad
openscad -o "$$@" -Ddefault_stack_height=$(1) -Dprint_layer_height=0.25 -Dsupport_wall=1.1 $$<
endef # make-stack-rule
# Create all the stack targets
$(foreach i, 2 3 4 5 6 7 8 9, $(eval $(call make-stack-rule,$(i))))
%.dxf : %.ps
pstoedit -nb -dt -f "dxf_s:-mm -ctl -splineaspolyline" $^ $@
%.ps : %.svg
inkscape -f $^ -E $@
# Unfortunately, we have to use the UI curently. For some reason the
# resulting gcode is entirely different if created on the command line.
fab/%_0.3mm_PETG_MK3S.gcode: %.3mf
prusa-slicer $^ --export-gcode --output $@
# List all the available targets so that they are tab-completable.
fab/normal_shield_no_support.stl:
fab/normal_shield_with_support.stl:
fab/thin_shield_no_support.stl:
fab/thin_shield_with_support.stl:
clean:
rm -f $(ALL_OUTPUT) $(ALL_OUTPUT:=.deps) *.stl