chiark / gitweb /
scaffold-clamp: wip
[reprap-play.git] / scaffold-clamp.scad
1 // -*- C -*-
2
3 include <utils.scad>
4
5 tube_dia = 48.3;
6
7 th = 7;
8
9 pin_gap = 1.5; // around
10
11 smooth_r = 10;
12
13 bolt_dia = 5 + 0.75;
14 bolt_flat = 10 + 1;
15
16 open_gap = 10;
17
18 // calculated
19
20 pin_dia = th;
21 hole_dia = th + pin_gap;
22
23 hinge_gap = pin_gap;
24
25 hinge_o_r = 0.5 * hole_dia + th;
26
27 hinge_x = -0.5 * tube_dia - hinge_o_r;
28 bolt_x = 0.5 * tube_dia + bolt_flat * 0.5;
29 max_x = bolt_x + max(0.5 + bolt_dia + th, 0.5 * bolt_flat/2);
30
31 flats_y = open_gap/2 + th;
32
33 $fa = 3;
34 $fs = 0.1;
35
36 module MainPlan() {
37   difference(){
38     offset(r=-smooth_r) offset(delta=smooth_r)
39       union(){
40       translate([hinge_x, 0]) circle(r= hinge_o_r);
41       circle(r = tube_dia/2 + th);
42       rectfromto([0,           -flats_y],
43                  [max_x,       +flats_y]);
44     }
45     circle(r = tube_dia/2);
46     rectfromto([0,       -open_gap/2],
47                [max_x+1, +open_gap/2]);
48     translate([hinge_x, 0]) circle(r= hole_dia/2);
49   }
50 }
51
52 module Portion(d=0) {
53   translate([hinge_x, 0]) circle(r= hinge_o_r + d);
54   rectfromto([hinge_x*2, 0],
55              [max_x+10, -(tube_dia/2+th+10)]);
56 }
57
58 module MainPlanA(){
59   intersection(){
60     MainPlan();
61     Portion(0);
62   }
63 }
64
65 module MainPlanB(){
66   difference(){
67     MainPlan();
68     Portion(hinge_gap);
69   }
70 }
71
72 module PlanDemo(){
73   MainPlan();
74   translate([0,0,-4]) color("red") Portion(1);
75   translate([0,0,-2]) color("grey") Portion(0);
76
77   translate([0, tube_dia*1.5]) {
78     MainPlanB();
79     MainPlanA();
80   }
81 //  translate([max_x - hinge_x + 20, 0]) color("blue") MainPlanA();
82 }
83
84 PlanDemo();