chiark / gitweb /
bike-phone-mount: wip
[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 lip_height = 2.0 - 0.15;
8 lip_depth = 2.5 /*?*/ - 0.20;
9 neck_width = 26.5 - 0.45;
10 neck_depth = 28.5 - 0.45;
11 neck_length = 1.5 + 0.50;
12
13 slope = 0.35;
14
15 // calculated
16
17 nep0 = [0,0];
18 nep1 = nep0 + [0,1] * neck_length;
19 nep7 = nep0 + [1,0] * lip_depth;
20 nep2 = [ nep7[0], nep1[1] + slope * (nep7[0] - nep1[0]) ];
21 nep3 = nep2 + [0, 0.1];
22 nep4 = [ nep0[0]-1, nep3[1] ];
23 nep6 = nep7 + [0,-1] * lip_height;
24 nep5 = [ nep4[0], nep6[1] ];
25 nepm = [ nep0[0], nep3[1] ];
26
27 total_height = nep2[1] - nep6[1];
28 nep_z_offset = -nep2[1];
29 nep_side_offset = [ neck_width/2, nep_z_offset ];
30 nep_rear_offset = [ neck_depth, nep_z_offset ];
31
32 module NeckEdgePlan() {
33   polygon([ nep0,
34             nep1,
35             nep2,
36             nep3,
37             nep4,
38             nep5,
39             nep6,
40             nep7 ]);
41 }
42
43 module Neck() {
44   intersection(){
45     linextr_y_xz(-100,100,convexity=10){
46       for (m=[0,1]) {
47         mirror([m,0]) {
48           translate(nep_side_offset) NeckEdgePlan();
49           rectfromto([-0.1, -total_height],
50                      nep_side_offset + nepm);
51         }
52       }
53     }
54     linextr_x_yz(-100,100,convexity=10){
55       translate(nep_rear_offset) NeckEdgePlan();
56       rectfromto([0, -total_height],
57                  nep_rear_offset + nepm);
58     }
59   }
60 }
61
62 //NeckEdgePlan();
63 Neck();