Skip to content

Commit 621ac99

Browse files
committed
add maker for numbered covers up to 100
1 parent 647ecc6 commit 621ac99

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ OPENSCAD_OPTIONS=-q
33
IMAGE_OPTIONS=--imgsize=1024,768 --colorscheme "Tomorrow Night" --render true -D orient_for_printing=false
44
THUMBNAIL_OPTIONS=--imgsize=400,300 --colorscheme "Tomorrow Night" --render true -D fast=true -D orient_for_printing=false
55

6+
SHELL=bash
7+
68
SRCS=$(wildcard src/*/*.scad)
79
STLS=$(patsubst src/%.scad,export/%.stl,$(SRCS))
810
PNGS=$(patsubst src/%.scad,render/%.png,$(SRCS))
@@ -78,3 +80,13 @@ endef
7880

7981
$(foreach file,$(FILES_WITH_LOGO), \
8082
$(eval $(call logo-template-rule,$(file))))
83+
84+
85+
define numbered-cover-rule
86+
export/Mounting/AttachmentCover_$(1).stl: src/Mounting/AttachmentCover.scad
87+
@mkdir -p $$(shell dirname $$@)
88+
$(OPENSCAD) $(OPENSCAD_OPTIONS) -D orient_for_printing=true -D attachment_cover_number_text=$(1) -o $$@ $$<
89+
endef
90+
91+
$(foreach number,$(shell seq 0 1 100), \
92+
$(eval $(call numbered-cover-rule,$(number))))

src/Mounting/AttachmentCover.scad

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ module AttachmentCover(height = MainCase_gps_antenna_lid_thickness, cover_number
3636
}
3737
}
3838
if (cover_number!=false) {
39-
#translate([MountAttachment_width/2+4.5,-8,MainCase_gps_antenna_lid_thickness])rotate([0,0,90])linear_extrude(2*layer_height)text(cover_number,font="open sans", size=10,center=true);
39+
#translate([MountAttachment_width/2+4.5,-3.4*len(cover_number),MainCase_gps_antenna_lid_thickness])rotate([0,0,90])linear_extrude(2*layer_height)text(cover_number,font="open sans", size=10,center=false);
4040
}
4141
}
42-
43-
translate([-MountAttachment_width/4-6,0,0])AttachmentCover(cover_number=COVER_NUMBER);
42+
attachment_cover_number_text="1";
43+
translate([-MountAttachment_width/4-6,0,0])AttachmentCover(cover_number=attachment_cover_number_text);

0 commit comments

Comments
 (0)