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