chiark / gitweb /
anke-gps-bracket: gps assembled ok
[reprap-play.git] / anke-gps-bracket.scad
1 // -*- C -*-
2
3 // Dimensions of the main GPS body
4 outerw = 140;
5 outerh = 80;
6 outert = 10;
7
8 // Dimensions of the bezel area round the edges
9 bezelw = 8;
10 bezelboth = 8;
11 bezeltoph = 8;
12
13 // Dimensions of the speaker at the back
14 spkrdia = 40;
15 spkr2bot = 40;
16 spkr2rhs = 30;
17
18 // Dimensions of the plug and wire
19 plugw = 10;
20 plugh = 8;
21 plug2bot = 30;
22 plug2lhs = 40;
23 plugtotald = 20;
24 pluggapd = 12;
25
26 // Amount of wire protrusion to allow for
27 plugwiremoreh = 30;
28
29 // Slops and steps
30 plugslop = 0.5;
31 plughstep = 1.5;
32
33 // Dimensions for strength only
34 screent = 1.0;
35 plugstrutw = 4;
36 plugstrutt = min(outert, 5);
37
38 module GpsPlugPlug(slop){
39   effhslop = slop - plughstep;
40   effplugw = plugw + slop*2;
41   effplugh = plugh + effhslop*2;
42   translate([plug2lhs-slop, plug2bot-effhslop, -1])
43     cube([effplugw, effplugh, outert+2]);
44 }
45
46 module GpsBody() {
47   difference(){
48     union(){
49       difference(){
50         cube([outerw, outerh, outert]);
51         translate([bezelw, bezelboth, screent])
52           cube([outerw-bezelw*2, outerh-bezelboth-bezeltoph, outert]);
53         translate([outerw-spkr2rhs, spkr2bot, -1])
54           cylinder(r=spkrdia/2, h=outert+2);
55       }
56       translate([plug2lhs+plugw/2, plug2bot+plugh/2, 0.05])
57         cylinder(r=(plugw+plugh)/2, h=outert-0.02);
58       for (x=[plug2lhs-plugstrutw, plug2lhs+plugw])
59         translate([x, 0.1, 0.05])
60           cube([plugstrutw, outerh-0.2, plugstrutt-0.10]);
61     }
62     GpsPlugPlug(0);
63   }
64 }
65
66 module GpsPlug() {
67   plugwireh = plug2bot + plugwiremoreh;
68   GpsPlugPlug(-plugslop);
69   mirror([0,0,1]) translate([plug2lhs, plug2bot, 0]) {
70     cube([plugw, plugh, plugtotald-0.05]);
71     translate([0, -plugwireh, pluggapd])
72       cube([plugw, plugwireh+0.05, plugtotald-pluggapd]);
73   }
74 }
75
76 module GpsAssembled(){ ////toplevel
77   GpsBody();
78   GpsPlug();
79 }
80
81 module GpsPlugT(){ ////toplevel
82   rotate([0,-90,0]) GpsPlug();
83 }
84
85 //GpsPlugT();
86 GpsAssembled();