chiark / gitweb /
bike-lipo-box: Now no longer needs m4 for toplevel (nfc)
[reprap-play.git] / osstest-arm-psu-bracket.scad
1 // -*- C -*-
2
3 mainlen = 33;
4 straps = [10,23];
5 width = 60;
6 endwall = 5;
7 sidewall = 8;
8 basethick = 3;
9 endwallheight = 20;
10 morebase = 20;
11
12 plugwidth = 35;
13 plugstartheight = 10;
14
15 strapthick = 4;
16 strapwidth = 7;
17 strapbotgap = 1;
18 overstrap = 6;
19
20 discdia = 60;
21 discoff_rear = 10;
22 discoff_front = 50;
23
24 sidewallraise = strapbotgap + strapthick + overstrap;
25
26 module Sides(){
27   difference(){
28     for (y=[0, width-sidewall]) {
29       translate([0,y,0])
30         cube([mainlen, sidewall, basethick + sidewallraise]);
31     }
32     for (x=straps) {
33       translate([x, 0, basethick + strapbotgap + strapthick/2])
34         cube([strapwidth, width*3, strapthick], center=true);
35     }
36   }
37 }
38
39 module Ell(baseoff){
40   translate([-endwall,0,0]) {
41     translate([baseoff,0,0])
42       cube([mainlen + endwall + morebase, width, basethick]);
43     cube([endwall+0.1, width, endwallheight + sidewallraise + basethick]);
44   }
45 }
46
47 module Plug(){
48   translate([0, width/2,
49              basethick + sidewallraise + plugstartheight + 50])
50     cube([endwall*3, plugwidth, 100], center=true);
51 }
52
53 module Disc(discoff){
54   translate([discoff + discdia/2, width/2, -1])
55     cylinder(r=discdia/2, h=50, $fn=100);
56 }
57
58 module Main(baseoff){
59   difference(){
60     union(){
61       Ell(baseoff);
62       Sides();
63     }
64     Plug();
65   }
66 }
67
68 module RearBlock(){
69   difference(){
70     Main(-morebase);
71     Disc(discoff_rear);
72   }
73 }
74
75 module FrontBlock(){
76   difference(){
77     Main(0);
78     Disc(discoff_front - endwall);
79   }
80 }
81
82 module Both(){
83   RearBlock();
84   translate([mainlen + endwall + 10, 0, 0])
85     FrontBlock();
86 }
87
88 Both();