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