chiark / gitweb /
laptop-camera-tripod-bracket: wip
[reprap-play.git] / laptop-camera-tripod-bracket.scad
1 // -*- C -*-
2
3 laptop_w       = 310;
4 laptop_th_rear  = 14;
5 laptop_th_front = 11;
6 laptop_halfdepth_real = 125;
7 laptop_halfdepth = 115; //125;
8 laptop_inner_x_clear = 95;
9
10 include <utils.scad>
11 include <camera-mount.scad>
12
13 bar_w = 20;
14 bar_th = 10;
15 flex_allow = 3;
16 claw_th = 5;
17 claw_overlap = 10;
18 mount_dia = 50;
19
20 min_ceil = 1;
21
22 //$test=true;
23 $test=false;
24
25 module ClawProfile(laptop_th){
26   laptop_zmin = bar_th + flex_allow;
27   laptop_zmax = laptop_zmin + laptop_th;
28   difference(){
29     rectfromto([-claw_overlap, 0],
30                [claw_th, laptop_zmax + claw_th]);
31     rectfromto([-claw_overlap-1, laptop_zmin ],
32                [ 0, laptop_zmax ]);
33   }
34 }
35
36 module ClawBar(inner_len, laptop_th){
37   rotate([0,0,180]) linextr_y_xz(-bar_w/2, +bar_w/2) {
38     rectfromto([0,0],
39                [inner_len, bar_th]);
40     translate([inner_len, 0])
41       ClawProfile(laptop_th);
42   }
43 }
44
45 module Body(){
46   translate([0, laptop_halfdepth - laptop_halfdepth_real, 0])
47     for (m=[0,1]) {
48       mirror([m,0]) {
49         ClawBar(laptop_w/2, laptop_th_rear);
50         translate([ laptop_w/2 - laptop_inner_x_clear + bar_w/2, 0])
51           rotate([0,0,-90])
52           ClawBar(laptop_halfdepth, laptop_th_front);
53       }
54     }
55   cylinder(r = mount_dia/2, h= bar_th);
56 }
57
58 module Bracket(){
59   difference(){
60     Body();
61     rotate([0,180,0])
62       CameraMountThread( bar_th + 2 );
63   }
64   translate([0,0, bar_th-min_ceil])
65     cylinder(r= mount_dia/2-1, h=min_ceil);
66 }
67
68 //ClawProfile(laptop_th_front);
69 //ClawBar(125, laptop_th_front);
70 //Body();
71 Bracket();