aboutsummaryrefslogtreecommitdiff
path: root/adclock.scad
diff options
context:
space:
mode:
Diffstat (limited to 'adclock.scad')
-rw-r--r--adclock.scad286
1 files changed, 286 insertions, 0 deletions
diff --git a/adclock.scad b/adclock.scad
new file mode 100644
index 0000000..3f33241
--- /dev/null
+++ b/adclock.scad
@@ -0,0 +1,286 @@
+ /*
+ * Copyright 2021, tslil clingman
+ *
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+// Adjustments
+magic_x=-0.60;
+magic_y=+0.35;
+
+display_height=19.2+1;
+pcb_width=27.7+1;
+pcb_height=28; // not so important, no adjustment
+
+bezel_height=15;
+height=2*pcb_height+bezel_height*2;
+body_depth=20;
+wall_width=4;
+width=pcb_width+wall_width;
+
+column_dim=5;
+
+cap_s=0.1;
+cap_height=2.5;
+
+side_w=15;
+side_s=0.12;
+
+base_height=5;
+base_width=width*2.2;
+base_s=0.20;
+
+module mirror_copy(v=[1,0,0]) {
+ children();
+ mirror(v) children();
+}
+
+module body(depth) {
+ // Body
+ translate([-width/2,0,0])
+ cube([width,depth,height]);
+ // Side things
+ mirror_copy() {
+ color("grey")
+ for (k=[1:3]) {
+ factor=1-side_s*k;
+ angle=5*k;
+ translate([width/2-tan(angle/k)*height*factor,
+ depth-depth*factor*factor,
+ 0])
+ rotate([0,angle,0])
+ cube([side_w*factor*factor,
+ depth*factor*factor,
+ height*factor]);
+ }
+ }
+ // Base
+ for (k=[0:1]) {
+ w=base_width*(1+k*base_s);
+ translate([-w/2,
+ -column_dim/2-depth*k*base_s,
+ -base_height*(1+k)])
+ cube([w,depth*(1+k*base_s)+column_dim/2,base_height]);
+ }
+ // Cap
+ translate([0,0,height])
+ for (k=[0:3]) {
+ factor=1-cap_s*k;
+ w=width*factor;
+ d=depth*factor;
+ translate([-w/2,depth-d,cap_height*k])
+ cube([w,d,cap_height]);
+ }
+ // Triangles on sides
+ color("grey")
+ mirror_copy()
+ translate([width/2,depth,0])
+ rotate([90,0,0])
+ linear_extrude(height=depth+column_dim/2)
+ polygon(points=[[0,0],[0,height/3],[(base_width-width)/3,0]]);
+}
+
+module front() {
+ difference() {
+ union() {
+ body(body_depth);
+
+ // Top triangle
+ $fn=4;
+ color("grey")
+ translate([0,0,height-width/4])
+ rotate([90,0,0])
+ cylinder(r=width/4,h=column_dim/2);
+ // Text
+ color("grey") {
+ rotate([90,0,0]) {
+ translate([0,(bezel_height-wall_width)/2,0]) {
+ linear_extrude(height=column_dim/5) {
+ text("MINUTES",size=5,
+ font="EB Garamond",
+ halign="center",
+ valign="center",
+ $fn=100);
+ translate([0, (bezel_height-wall_width)/2+
+ (height+display_height)/4,
+ 0])
+ text("HOURS",size=6,
+ font="EB Garamond",
+ halign="center",
+ valign="center",
+ $fn=100);
+ }
+ }
+ }
+ }
+ // Straps
+ mirror_copy() {
+ color("gold") {
+ $fn=20;
+ translate([(width-column_dim)/2,-column_dim/2,0]) {
+ cube([column_dim,column_dim,height]);
+ translate([0,column_dim/2,height]) {
+ rotate([0,90,0])
+ cylinder(r=column_dim/2,h=column_dim);
+ translate([0,0,-column_dim/2])
+ cube([column_dim,body_depth,column_dim]);
+ }
+ }
+ }
+ }
+ }
+ // Cut away component space
+ translate([(wall_width-width)/2,0,0]) {
+ union() {
+ // Display areas
+ translate([0, -0.1, bezel_height-wall_width]) {
+ // Bottom window
+ cube([pcb_width,body_depth+2,display_height]);
+ // Top window
+ translate([0,0,(height-display_height)/2])
+ cube([pcb_width,body_depth+2,display_height]);
+ }
+ // Inside
+ translate([0, wall_width, 0])
+ cube([width-wall_width,body_depth+2,height-column_dim/2]);
+ }
+ }
+ }
+}
+
+back_pcb_width = 20.1+1;
+back_pcb_height = 91.5+1;
+back_button_dim = 6.25+1;
+back_button1_z = 43.67;
+back_button2_z = 8.82+back_button_dim+back_button1_z;
+back_inner_depth = 20; // minimum governed by usb connector depth
+usb_pcb_width = 14.20;
+usb_pcb_depth = 15.10;
+usb_con_height = 4.1;
+screw_diam = 2+0.5;
+screw_head_diam = 3.8+0.5;
+screw_countersink_depth = 1.4+0.5;
+
+module back() {
+ mirror([0,1,0]) {
+ difference(){
+ union(){
+ body(back_inner_depth);
+ // different straps
+ mirror_copy() {
+ translate([-width/2,
+ -column_dim/2,
+ height-column_dim/2]) {
+ cube([width/2,column_dim,column_dim]);
+ translate([0,column_dim/2,0]) {
+ cylinder(r=column_dim/2,h=column_dim,$fn=20);
+ translate([-column_dim/2,0,0])
+ cube([column_dim,
+ back_inner_depth,
+ column_dim]);
+ }
+ }
+ }
+ }
+ // we have to cut away the triangle part a bit
+ translate([-width,-column_dim,0])
+ cube([width*2,column_dim,height-column_dim/2]);
+ // make room for PCB, buttons
+ translate([0,0,height-back_pcb_height-column_dim/2]) {
+ // PCB
+ translate([-back_pcb_width/2,wall_width,0])
+ cube([back_pcb_width,back_inner_depth,back_pcb_height]);
+ // button holes
+ translate([-back_button_dim/2,-1,0]) {
+ translate([0,0,back_button1_z])
+ cube([back_button_dim,wall_width+2,back_button_dim]);
+ translate([0,0,back_button2_z])
+ cube([back_button_dim,wall_width+2,back_button_dim]);
+ }
+ }
+ // usb connector area
+ translate([back_pcb_width/2-1,-body_depth,-base_height*2-1])
+ cube([usb_pcb_width+2,
+ body_depth*3,
+ usb_con_height+2]);
+ // side screw holes
+ mirror_copy() {
+ $fn=20;
+ translate([width/2+(base_width-width)/3-wall_width,
+ -1, screw_head_diam/2]) {
+ // Outer shaft
+ rotate([-90,0,0])
+ cylinder(r=screw_head_diam/2,
+ h=back_inner_depth-screw_countersink_depth+1);
+ // Inner
+ translate([0,back_inner_depth-screw_countersink_depth,0])
+ rotate([-90,0,0])
+ cylinder(r=screw_diam/2,h=screw_countersink_depth+2);
+ }
+ }
+ // top screw hole
+ translate([0,-column_dim/2-1,height]) {
+ $fn=20;
+ rotate([-90,0,0])
+ cylinder(r=screw_head_diam/2,
+ h=back_inner_depth+column_dim/2
+ -screw_countersink_depth+1);
+ translate([0,back_inner_depth-screw_countersink_depth+column_dim/2])
+ rotate([-90,0,0])
+ cylinder(r=screw_diam/2,h=screw_countersink_depth+2);
+
+ }
+
+ }
+ }
+ // text
+ rotate([90,0,180]) {
+ translate([0,0,0]) {
+ linear_extrude(height=column_dim/5) {
+ translate([0,height-column_dim,0])
+ text("for",size=7,
+ font="EB Garamond",
+ halign="center",
+ valign="top",
+ $fn=100);
+ translate([0,height-column_dim-15,0])
+ text("Claire",size=7,
+ font="EB Garamond",
+ halign="center",
+ valign="bottom",
+ $fn=100);
+ translate([0,22,0])
+ text("on the",size=7,
+ font="EB Garamond",
+ halign="center",
+ valign="bottom",
+ $fn=100);
+ translate([0,12,0])
+ text("occasion",size=7.5,
+ font="EB Garamond",
+ halign="center",
+ valign="bottom",
+ $fn=100);
+ translate([0,2,0])
+ text("of her ABD",size=8,
+ font="EB Garamond",
+ halign="center",
+ valign="bottom",
+ $fn=100);
+ }
+ }
+ }
+}
+
+front();
+translate([0,back_inner_depth+body_depth,0])
+ back();