chiark / gitweb /
8226180e1c80d9d07c3f9357f2af6fc218853560
[reprap-play.git] / tablet-case-corner-mount.scad
1 // -*- C -*-
2
3 main_sz = 22.5;
4
5 wall_th = 3;
6
7 front_fullsz = 10;
8
9 front_th = 2;
10 gap_th = 9.5 + 0.5;
11 back_th = 4;
12
13 back_tot_l = 32.5;
14 back_cut_l = 4;
15 back_cut_w = 13;
16 back_prong_w = 3;
17 back_hole_d = 2;
18 back_hole_dia = 1 + 0.5;
19
20 module MidPlan(){
21   polygon([[0,            0],
22            [0,            main_sz],
23            [wall_th,      main_sz],
24            [wall_th,      wall_th],
25            [main_sz,      wall_th],
26            [main_sz,      0]]);
27 }
28
29 module FrontPlan(){
30   halfway = (front_fullsz + main_sz)/2;
31   polygon([[0,            0],
32            [0,            main_sz],
33            [front_fullsz, main_sz],
34            [main_sz,      front_fullsz],
35            [main_sz,      0]]);
36 }
37
38 module BackPlan(){
39   sqmid = main_sz * sqrt(0.5);
40   prlen = back_tot_l - sqmid;
41   prx = 0.5*back_cut_w + back_prong_w;
42   difference(){
43     union(){
44       square(main_sz);
45       rotate(-45) translate([-prx, sqmid])
46         square([prx*2,prlen]);
47     }
48     rotate(-45) translate([-back_cut_w/2, back_tot_l-back_cut_l])
49       square([back_cut_w, back_cut_l+1]);
50   }
51 }
52
53 module Hook(){
54   rotate([90,0,0]){
55     difference(){
56       union(){
57         linear_extrude(height=back_th)
58           BackPlan();
59         linear_extrude(height=back_th+gap_th+front_th)
60           MidPlan();
61         translate([0,0, back_th+gap_th])
62           linear_extrude(height=front_th) FrontPlan();
63       }
64       rotate([0,0,-45])
65         translate([0, back_tot_l - back_hole_d, back_th/2])
66         rotate([0,90,0]) translate([0,0,-50])
67         cylinder(h=100, r=back_hole_dia/2, $fn=40);
68     }
69   }
70 }
71
72 //MidPlan();
73 //FrontPlan();
74 //BackPlan();
75 Hook();