X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=reprap-play.git;a=blobdiff_plain;f=anke-gps-bracket.scad;h=5831f559af015ad5c9b06eb701293d216a3ebed1;hp=6e4caa7c49ce8232978816327206d83d2193e864;hb=f9af1bf66febdda31d0c3041bee4446002140a04;hpb=686d6b09a13d7909cf166122c7537309bb9b55d6 diff --git a/anke-gps-bracket.scad b/anke-gps-bracket.scad index 6e4caa7..5831f55 100644 --- a/anke-gps-bracket.scad +++ b/anke-gps-bracket.scad @@ -1,31 +1,64 @@ // -*- C -*- -outerw = 140; -outerh = 80; -bezelw = 8; -bezelboth = 8; -bezeltoph = 8; -outert = 10; +// Dimensions of the main GPS body +outerw = 120 + 2.5; +outerh = 75 - 0.2; +outert = 15 - 1.0; +outerbackbevel = 3; -spkrdia = 40; -spkr2bot = 40; -spkr2rhs = 30; +// Dimensions of the bezel area round the edges +bezelw = 11 - 0.5; +bezelboth = 11 - 0.5; +bezeltoph = 7 - 0.5; -plugw = 10; -plugh = 8; -plug2bot = 30; -plug2lhs = 40; +// Dimensions of the speaker at the back +spkrdia = 22; +spkr2bot = 19; +spkr2rhs = 25; -plugslop = 0.3; +// Dimensions of the plug and wire +plugw = 12; +plugh = 9; +plug2bot = 11; +plug2lhs = 11; +plugtotald = 15; +pluggapd = 5; -screent = 1.0; +// Amount of wire protrusion to allow for +plugwiremoreh = 25; + +// Slops and steps etc. +plugslop = 0.5; +plughstep = 1.5; +bodylhsrhsslop = 0.5; +// Dimensions for strength only +screent = 1.0; plugstrutw = 4; plugstrutt = min(outert, 5); -module Gps() { - effplugw = plugw + plugslop; - effplugh = plugh + plugslop; +module GpsPlugPlug(slop){ + effhslop = slop - plughstep; + effplugw = plugw + slop*2; + effplugh = plugh + effhslop*2; + translate([plug2lhs-slop, plug2bot-effhslop, -1]) + cube([effplugw, effplugh, outert+2]); +} + +module GpsBodyOuterBevel(len){ + translate([0,-1,0]) { + rotate([-90,0,0]) { + linear_extrude(height=len+2) { + polygon([[-outerbackbevel, 0], + [ 0, outerbackbevel], + [outerbackbevel, 0], + [ 0, -outerbackbevel]]); + } + } + } +} + +module GpsBody() { ////toplevel difference(){ union(){ difference(){ @@ -35,15 +68,72 @@ module Gps() { translate([outerw-spkr2rhs, spkr2bot, -1]) cylinder(r=spkrdia/2, h=outert+2); } - translate([plug2lhs+effplugw/2, plug2bot+effplugh/2, 0.01]) - cylinder(r=(effplugw+effplugh)/2, h=outert-0.02); - for (x=[plug2lhs-plugstrutw, plug2lhs+effplugw]) - translate([x, 0.1, 0.01]) - cube([plugstrutw, outerh-0.2, plugstrutt-0.02]); + translate([plug2lhs+plugw/2, plug2bot+plugh/2, 0]) + cylinder(r=(plugw+plugh)/2, h=outert); + for (x=[plug2lhs-plugstrutw, plug2lhs+plugw]) + translate([x, 0.1, 0]) + cube([plugstrutw, outerh-0.2, plugstrutt-0.10]); + } + GpsPlugPlug(0); + for (x=[0,outerw]) translate([x,0,0]) GpsBodyOuterBevel(outerh); + for (y=[0,outerh]) translate([0,y,0]) + rotate([0,0,-90]) GpsBodyOuterBevel(outerw); + } +} + +module GpsPlug() { + plugwireh = plug2bot + plugwiremoreh; + GpsPlugPlug(-plugslop); + mirror([0,0,1]) translate([plug2lhs, plug2bot, 0]) { + cube([plugw, plugh, plugtotald-0.05]); + translate([0, -plugwireh, pluggapd]) + cube([plugw, plugwireh+0.05, plugtotald-pluggapd]); + } +} + +lhsteethu = 2; + +module GpsLHSMask(xslop=0){ + translate([plug2lhs + plugw+plugh+plugstrutw, + 0, + -50]) { + for (iter=[-100/lhsteethu : 100/lhsteethu]) { + translate([0, iter*lhsteethu*2, 0]) { + linear_extrude(height=100) { + polygon([[-300, 0], + [ 0, 0], + [lhsteethu,lhsteethu], + [ 0, lhsteethu*2], + [-300, lhsteethu*2+0.1]]); + } + } } - translate([plug2lhs, plug2bot, -1]) - cube([effplugw, effplugh, outert+2]); } } -Gps(); +module GpsAssembled(){ ////toplevel + GpsBody(); + GpsPlug(); +} + +module GpsBodyLT(){ + intersection(){ + GpsBody(); + GpsLHSMask(); + } +} + +module GpsBodyRT(){ + difference(){ + GpsBody(); + GpsLHSMask(bodylhsrhsslop); + } +} + +module GpsPlugT(){ ////toplevel + rotate([0,-90,0]) GpsPlug(); +} + +//GpsPlugT(); +//GpsAssembled(); +//GpsBody();