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