chiark / gitweb /
poster-tube-lid: catch wip, CatchPostDistort PoC
[reprap-play.git] / axlepin.scad
1 // -*- C -*-
2 //
3 // axlepin.scad
4 //
5 // 3D designs for for securing things on axles
6 // Copyright 2012,2016 Ian Jackson
7 //
8 // This work is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12 //
13 // This work is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this work.  If not, see <http://www.gnu.org/licenses/>.
20
21
22
23 function AxlePin_holerad() = 2;
24 function AxlePin_zoffset(holerad=2, slop=0.5) = (holerad - slop)*0.7;
25
26 module AxlePin(axlerad, pinlen, holerad=2, tabthick=5, slop=0.5){
27   pinr = holerad - slop;
28   intersection(){
29     union(){
30       translate([0, -pinlen/2, 0]) rotate([-90,0,0])
31         cylinder(r=pinr, h=pinlen, $fn=10);
32       translate([-tabthick, axlerad, -holerad])
33         cube([tabthick*2, holerad*2, holerad*2]);
34     }
35     translate([-50,-50,-AxlePin_zoffset(holerad,slop)])
36       cube([100,100,50]);
37   }
38 }
39
40 function Washer_thick() = 1.2;
41
42 module Washer(axlerad, washerrad, thick=1.2, slop=0.5){
43   difference(){
44     cylinder(h=thick, r=washerrad);
45     translate([0,0,-1]) cylinder(h=thick+2, r=axlerad+slop);
46   }
47 }