chiark / gitweb /
sleepphone-cable-box: wip, keeper stalk ?
[reprap-play.git] / tablet-case-corner-mount.scad
1 // -*- C -*-
2
3 main_sz = 22.5;
4
5 wall_th = 3;
6
7 front_hook = 3;
8 front_slope = 1.0;
9
10 front_th = 2;
11 gap_th = 6.5 + 0.5;
12
13 back_tot_l = 35.5;
14 back_cut_l = 6;
15 back_cut_w = 15.0 + 1.0;
16 back_prong_w = 3;
17 back_hole_d = 2;
18 back_hole_dia = 1 + 1.5;
19
20 back_th = back_hole_dia + 2.4;
21
22 module MidPlan(){
23   polygon([[0,            0],
24            [0,            main_sz],
25            [wall_th,      main_sz],
26            [wall_th,      wall_th],
27            [main_sz,      wall_th],
28            [main_sz,      0]]);
29 }
30
31 module FrontElevation(){
32   hook_z = front_hook / front_slope;
33   translate([0, back_th+gap_th]) {
34     hull(){
35       square([wall_th, hook_z + 0.01]);
36       translate([front_hook, hook_z])
37         square([wall_th, 0.01]);
38     }
39   }
40 }
41
42 module FrontEdge(){
43   rotate([90,0,0]) linear_extrude(height=main_sz) FrontElevation();
44 }
45
46 module Front(){
47   mirror([0,1,0]) FrontEdge();
48   rotate([0,0,90]) FrontEdge();
49 }
50
51 module BackPlan(){
52   sqmid = main_sz * sqrt(0.5);
53   prlen = back_tot_l - sqmid;
54   prx = 0.5*back_cut_w + back_prong_w;
55   difference(){
56     union(){
57       square(main_sz);
58       rotate(-45) translate([-prx, sqmid])
59         square([prx*2,prlen]);
60     }
61     rotate(-45) translate([-back_cut_w/2, back_tot_l-back_cut_l])
62       square([back_cut_w, back_cut_l+1]);
63   }
64 }
65
66 module Hook(){
67   difference(){
68     union(){
69       linear_extrude(height=back_th)
70         BackPlan();
71       linear_extrude(height=back_th+gap_th+front_th)
72         MidPlan();
73       Front();
74     }
75     rotate([0,0,-45])
76       translate([0, back_tot_l - back_hole_d, back_th/2])
77       rotate([0,90,0]) translate([0,0,-50])
78       cylinder(h=100, r=back_hole_dia/2, $fn=40);
79   }
80 }
81
82 //MidPlan();
83 //FrontPlan();
84 //BackPlan();
85 //Front();
86 Hook();