chiark / gitweb /
scaffold-clamp: wip straphook
[reprap-play.git] / bike-phone-mount.scad
1 // -*- C -*-
2
3 // should rename this to actual name of the product
4
5 include <utils.scad>
6
7 mount_lip_height = 2.0 - 0.15 - 0.15;
8 mount_lip_depth = 2.5 /*?*/ - 0.30;
9 mount_neck_width = 26.5 - 0.55 - 0.15;
10 mount_neck_length = 1.5 + 0.50;
11
12 mount_diag_outer = 34.8        - 0.50;
13 mount_diag_inner = 34.6 - 0.20 - 0.50;
14
15 mount_slope = .65;
16 mount_extra_slope = 3;
17
18 mount_demo_ceil = 4;
19
20 // calculated
21
22 mnep0 = [0,0];
23 mnep1 = mnep0 + [0,1] * mount_neck_length;
24 mnep7 = mnep0 + [1,0] * mount_lip_depth;
25 mnep2 = [ mnep7[0] + mount_extra_slope, mnep1[1] + mount_slope * (mnep7[0] + mount_extra_slope - mnep1[0]) ];
26 mnep3 = mnep2 + [0, 0.1];
27 mnep4 = [ mnep0[0]-1, mnep3[1] ];
28 mnep6 = mnep7 + [0,-1] * mount_lip_height;
29 mnep5 = [ mnep4[0], mnep6[1] ];
30 mnepm = [ mnep0[0], mnep3[1] ];
31
32 mount_total_height = mnep2[1] - mnep6[1];
33 mnep_z_offset = -mnep2[1];
34 mnep_side_offset = [ mount_neck_width/2, mnep_z_offset ];
35
36 module MountNeckEdgePlan() {
37   polygon([ mnep0,
38             mnep1,
39             mnep2,
40             mnep3,
41             mnep4,
42             mnep5,
43             mnep6,
44             mnep7 ]);
45 }
46
47 module MountNeckSquare() {
48   intersection_for (r=[0,90]) {
49     rotate([0,0,r]){
50       linextr_y_xz(-100,100,convexity=10){
51         for (m=[0,1]) {
52           mirror([m,0]) {
53             translate(mnep_side_offset) MountNeckEdgePlan();
54             rectfromto([-0.1, -mount_total_height],
55                        mnep_side_offset + mnepm);
56           }
57         }
58       }
59     }
60   }
61 }
62
63 module MountDiagonal() {
64   rotate([0,0,45]){
65     translate([0,0, -mount_total_height]){
66       linextr(0, mount_lip_height)
67         square(center=true, mount_diag_outer);
68       linextr(0, mount_total_height)
69         square(center=true, mount_diag_inner);
70       linextr(mount_lip_height + mount_neck_length,
71               mount_total_height + 1)
72         square(center=true, 100);
73     }
74   }
75 }
76
77 module MountDemoCeil() {
78   c = mount_demo_ceil + mount_extra_slope;
79   linextr(0, 0.8) {
80     square(mount_neck_width + 2*(mount_demo_ceil + mount_extra_slope),
81            center=true);
82   }
83 }
84
85 module Mount(){
86   intersection(){
87     MountNeckSquare();
88     MountDiagonal();
89   }
90 }
91
92 module MountDemo(){ ////toplevel
93   Mount();
94   MountDemoCeil();
95 }
96
97 //MountNeckEdgePlan();
98 //MountNeck();
99 //MountDemoCeil();
100 //MountDiagonal();
101 //MountDemo();