My Gridfinity models
1OPENSCAD := openscad-nightly
2IMGSIZE := 1024,768
3THUMBSIZE := 256,192
4
5.PHONY: all clean
6all:
7
8# --- Pegboard Shelf ---
9
10PEGBOARD_SHELF_SIZES_1 := 1 2 3 4 5 6 7 8
11PEGBOARD_SHELF_SIZES_2 := 1 2 3 4 5 6 7 8
12PEGBOARD_SHELF_SIZES_3 := 1 2 3 4 5 6 7 8
13
14PEGBOARD_SHELF_MODELS := \
15 $(foreach x,$(PEGBOARD_SHELF_SIZES_1),pegboard-shelf/pegboard-shelf-$(x)x1.3mf) \
16 $(foreach x,$(PEGBOARD_SHELF_SIZES_2),pegboard-shelf/pegboard-shelf-$(x)x2.3mf) \
17 $(foreach x,$(PEGBOARD_SHELF_SIZES_3),pegboard-shelf/pegboard-shelf-$(x)x3.3mf)
18
19PEGBOARD_SHELF_IMAGES := $(PEGBOARD_SHELF_MODELS:.3mf=.png)
20
21PEGBOARD_SHELF_THUMBNAIL := pegboard-shelf.png
22
23pegboard-shelf.png: pegboard-shelf.scad Makefile
24 $(OPENSCAD) -o $@ -D 'grid_x=4' -D 'grid_y=2' --autocenter --viewall --imgsize $(THUMBSIZE) --render '' $<
25
26pegboard-shelf/pegboard-shelf-%x1.3mf: pegboard-shelf.scad Makefile
27 $(OPENSCAD) -o $@ -D 'grid_x=$*' -D 'grid_y=1' $<
28
29pegboard-shelf/pegboard-shelf-%x2.3mf: pegboard-shelf.scad Makefile
30 $(OPENSCAD) -o $@ -D 'grid_x=$*' -D 'grid_y=2' $<
31
32pegboard-shelf/pegboard-shelf-%x1.png: pegboard-shelf.scad Makefile
33 $(OPENSCAD) -o $@ -D 'grid_x=$*' -D 'grid_y=1' --autocenter --viewall --imgsize $(IMGSIZE) --render '' $<
34
35pegboard-shelf/pegboard-shelf-%x2.png: pegboard-shelf.scad Makefile
36 $(OPENSCAD) -o $@ -D 'grid_x=$*' -D 'grid_y=2' --autocenter --viewall --imgsize $(IMGSIZE) --render '' $<
37
38pegboard-shelf/pegboard-shelf-%x3.3mf: pegboard-shelf.scad Makefile
39 $(OPENSCAD) -o $@ -D 'grid_x=$*' -D 'grid_y=3' $<
40
41pegboard-shelf/pegboard-shelf-%x3.png: pegboard-shelf.scad Makefile
42 $(OPENSCAD) -o $@ -D 'grid_x=$*' -D 'grid_y=3' --autocenter --viewall --imgsize $(IMGSIZE) --render '' $<
43
44# --- Plastic Drawer Bottom ---
45
46PLASTIC_DRAWER_BOTTOM_MODEL := plastic-drawer-bottom.3mf
47PLASTIC_DRAWER_BOTTOM_THUMBNAIL := plastic-drawer-bottom.png
48
49plastic-drawer-bottom.3mf: plastic-drawer-bottom.scad Makefile
50 $(OPENSCAD) -o $@ $<
51
52plastic-drawer-bottom.png: plastic-drawer-bottom.scad Makefile
53 $(OPENSCAD) -o $@ --autocenter --viewall --imgsize $(THUMBSIZE) --render '' $<
54
55# --- Top-level targets ---
56
57ALL_OUTPUTS := \
58 $(PEGBOARD_SHELF_MODELS) $(PEGBOARD_SHELF_IMAGES) $(PEGBOARD_SHELF_THUMBNAIL) \
59 $(PLASTIC_DRAWER_BOTTOM_MODEL) $(PLASTIC_DRAWER_BOTTOM_THUMBNAIL)
60
61all: $(ALL_OUTPUTS)
62
63clean:
64 rm -f $(ALL_OUTPUTS)