-
Notifications
You must be signed in to change notification settings - Fork 4
/
label-holder.scad
141 lines (108 loc) · 5.24 KB
/
label-holder.scad
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// A generic cardboard label holder
// Copyright (C) 2020 Jeremy Bennett <www.jeremybennett.com>
// Contributor: Jeremy Bennett <jeremy.bennett@embecosm.com>
// SPDX-License-Identifier: CC-BY-SA-4.0
//! @file A rectangular label holder
use <libraries/mylib.scad>
//! @brief Thickness of the front part of the frame
FRAME_FRONT_THICKNESS = 2.0;
//! @brief Thickness of the back part of the frame
FRAME_BACK_THICKNESS = 2.0;
//! @brief Total thickness of the frame
FRAME_THICKNESS = FRAME_FRONT_THICKNESS + FRAME_BACK_THICKNESS;
//! @brief Width of the rim surrouding the screwhead in the tag
TAG_RIM = 1.0;
//! brief Front part of the label holder.
//! Complete rectangle
//! @param frame_x Overall X dimension of the label holder including
//! tags.
//! @param frame_x Overall Y dimension of the label holder.
//! @param frame_front_width Width of the front border of the label holder.
//! @param tag_extra Extra space in X dimension needed on each side
//! for the tag.
module frame_front (frame_x, frame_y, frame_front_width, tag_extra) {
true_x = frame_x - (tag_extra * 2);
translate (v = [tag_extra, 0, 0])
cube (size = [true_x, frame_front_width, FRAME_FRONT_THICKNESS],
center = false);
translate (v = [tag_extra, frame_y - frame_front_width, 0])
cube (size = [true_x, frame_front_width, FRAME_FRONT_THICKNESS],
center = false);
translate (v = [tag_extra, 0, 0])
cube (size = [frame_front_width, frame_y, FRAME_FRONT_THICKNESS],
center = false);
translate (v = [frame_x - tag_extra - frame_front_width, 0, 0])
cube (size = [frame_front_width, frame_y, FRAME_FRONT_THICKNESS],
center = false);
}
//! brief Back part of the label holder.
//! Three sides of the rectangle, leaving one side to drop a card through.
//! @param frame_x Overall X dimension of the label holder including
//! tags.
//! @param frame_x Overall Y dimension of the label holder.
//! @param frame_back_width Width of the back border of the label holder.
//! @param tag_extra Extra space in X dimension needed on each side
//! for the tag.
module frame_back (frame_x, frame_y, frame_back_width, tag_extra) {
true_x = frame_x - (tag_extra * 2);
translate (v = [tag_extra, 0, FRAME_FRONT_THICKNESS])
cube (size = [true_x, frame_back_width, FRAME_BACK_THICKNESS],
center = false);
translate (v = [tag_extra, 0, FRAME_FRONT_THICKNESS])
cube (size = [frame_back_width, frame_y, FRAME_BACK_THICKNESS],
center = false);
translate (v = [frame_x - tag_extra - frame_back_width, 0,
FRAME_FRONT_THICKNESS])
cube (size = [frame_back_width, frame_y, FRAME_BACK_THICKNESS],
center = false);
}
//! @brief Tag to hold screws for the label holder
//! @param frame_x Overall X dimension of the label holder including tags.
//! @param frame_x Overall Y dimension of the label holder.
//! @param tag_diam Diameter of the tag, including its rim
module frame_tag (frame_x, frame_y, tag_diam) {
translate (v = [tag_diam / 2, frame_y / 2, 0])
cylinder (r = tag_diam / 2, h = FRAME_THICKNESS,
$fn = tag_diam * tag_diam, center = false);
translate (v = [frame_x - tag_diam / 2, frame_y / 2, 0])
cylinder (r = tag_diam / 2, h = FRAME_THICKNESS,
$fn = tag_diam * tag_diam, center = false);
}
//! @brief Overall frame with tags, but without screwholes
//! @param frame_x Overall X dimension of the label holder
//! including tags.
//! @param frame_x Overall Y dimension of the label holder.
//! @param frame_front_width Width of the front border of the label holder.
//! @param frame_back_width Width of the back border of the label holder.
//! @param tag_diam Diameter of the tag, including its rim
module raw_frame (frame_x, frame_y, frame_front_width, frame_back_width,
tag_diam) {
tag_extra = tag_diam - frame_back_width;
frame_front (frame_x, frame_y, frame_front_width, tag_extra);
frame_back (frame_x, frame_y, frame_back_width, tag_extra);
frame_tag (frame_x, frame_y, tag_diam);
}
//! @brief Label holder, complete with screw tags
//! @brief Overall frame with tags, but without screwholes
//! @param frame_x Overall X dimension of the label holder
//! including tags.
//! @param frame_x Overall Y dimension of the label holder.
//! @param frame_front_width Width of the front border of the label holder.
//! @param frame_back_width Width of the back border of the label holder.
//! @param shank_diam Diameter of the shank of the screw used to hold
//! up the label holder
module frame (frame_x, frame_y, frame_front_width, frame_back_width,
shank_diam) {
tag_diam = (shank_diam + TAG_RIM) * 2;
difference () {
raw_frame (frame_x, frame_y, frame_front_width, frame_back_width,
tag_diam);
translate (v = [tag_diam / 2, frame_y / 2, 0])
rotate (a = [0, 180, 0])
metric_screwhole (shank_diam);
translate (v = [frame_x - tag_diam / 2, frame_y / 2, 0])
rotate (a = [0, 180, 0])
metric_screwhole (shank_diam);
}
}
frame(100.0, 60.0, 7.0, 5.0, 3.0);