chiark / gitweb /
bike-phone-mount: square
[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.30;
9 neck_width = 26.5 - 0.55;
10 neck_length = 1.5 + 0.50;
11
12 slope = .65;
13 extra_slope = 3;
14
15 demo_ceil = 4;
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] + extra_slope, nep1[1] + slope * (nep7[0] + extra_slope - 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
33 module NeckEdgePlan() {
34   polygon([ nep0,
35             nep1,
36             nep2,
37             nep3,
38             nep4,
39             nep5,
40             nep6,
41             nep7 ]);
42 }
43
44 module Neck() {
45   intersection_for (r=[0,90]) {
46     rotate([0,0,r]){
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     }
57   }
58 }
59
60 module DemoCeil() {
61   c = demo_ceil + extra_slope;
62   linextr(0, 0.8) {
63     square(neck_width + 2*(demo_ceil + extra_slope),
64            center=true);
65   }
66 }
67
68 module Demo(){
69   Neck();
70   DemoCeil();
71 }
72
73 //NeckEdgePlan();
74 //Neck();
75 //DemoCeil();
76 Demo();