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 demo_ceil = 5;
14
15 slope = 0.35;
16
17 // calculated
18
19 nep0 = [0,0];
20 nep1 = nep0 + [0,1] * neck_length;
21 nep7 = nep0 + [1,0] * lip_depth;
22 nep2 = [ nep7[0], nep1[1] + slope * (nep7[0] - nep1[0]) ];
23 nep3 = nep2 + [0, 0.1];
24 nep4 = [ nep0[0]-1, nep3[1] ];
25 nep6 = nep7 + [0,-1] * lip_height;
26 nep5 = [ nep4[0], nep6[1] ];
27 nepm = [ nep0[0], nep3[1] ];
28
29 total_height = nep2[1] - nep6[1];
30 nep_z_offset = -nep2[1];
31 nep_side_offset = [ neck_width/2, nep_z_offset ];
32 nep_rear_offset = [ neck_depth, nep_z_offset ];
33
34 module NeckEdgePlan() {
35   polygon([ nep0,
36             nep1,
37             nep2,
38             nep3,
39             nep4,
40             nep5,
41             nep6,
42             nep7 ]);
43 }
44
45 module Neck() {
46   intersection(){
47     linextr_y_xz(-100,100,convexity=10){
48       for (m=[0,1]) {
49         mirror([m,0]) {
50           translate(nep_side_offset) NeckEdgePlan();
51           rectfromto([-0.1, -total_height],
52                      nep_side_offset + nepm);
53         }
54       }
55     }
56     linextr_x_yz(-100,100,convexity=10){
57       translate(nep_rear_offset) NeckEdgePlan();
58       rectfromto([0, -total_height],
59                  nep_rear_offset + nepm);
60     }
61   }
62 }
63
64 module DemoCeil() {
65   linextr(0, 0.8) {
66     rectfromto
67       ([ -(neck_width/2 + demo_ceil), -demo_ceil ],
68        [ +(neck_width/2 + demo_ceil), neck_depth + demo_ceil]);
69   }
70 }
71
72 module Demo(){
73   Neck();
74   DemoCeil();
75 }
76
77 //NeckEdgePlan();
78 //Neck();
79 //DemoCeil();
80 Demo();