chiark / gitweb /
scaffold-clamp: wip, toplevels
[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 hinge_unit = 10;
19 hinge_units = 4;
20 hinge_z_gap = 1;
21
22 // calculated
23
24 pin_dia = th;
25 hole_dia = th + pin_gap;
26
27 hinge_gap = pin_gap;
28
29 hinge_o_r = 0.5 * hole_dia + th;
30
31 hinge_x = -0.5 * tube_dia - hinge_o_r;
32 bolt_x = 0.5 * tube_dia + bolt_flat * 0.5;
33 max_x = bolt_x + max(0.5 + bolt_dia + th, 0.5 * bolt_flat/2);
34
35 flats_y = open_gap/2 + th;
36
37 stride_z = hinge_unit*2 + hinge_z_gap*2;
38 total_z = hinge_units * stride_z - hinge_z_gap;
39
40 $fa = 3;
41 $fs = 0.1;
42
43 module MainPlan() {
44   difference(){
45     offset(r=-smooth_r) offset(delta=smooth_r)
46       union(){
47       translate([hinge_x, 0]) circle(r= hinge_o_r);
48       circle(r = tube_dia/2 + th);
49       rectfromto([0,           -flats_y],
50                  [max_x,       +flats_y]);
51     }
52     circle(r = tube_dia/2);
53     rectfromto([0,       -open_gap/2],
54                [max_x+1, +open_gap/2]);
55     translate([hinge_x, 0]) circle(r= hole_dia/2);
56   }
57 }
58
59 module Portion(d=0) {
60   translate([hinge_x, 0]) circle(r= hinge_o_r + d);
61   rectfromto([hinge_x*2, 0],
62              [max_x+10, -(tube_dia/2+th+10)]);
63 }
64
65 module MainPlanA(){
66   intersection(){
67     MainPlan();
68     Portion(0);
69   }
70 }
71
72 module MainPlanB(){
73   difference(){
74     MainPlan();
75     Portion(hinge_gap);
76   }
77 }
78
79 module HalfClamp(){ ////toplevel
80   linextr(0, total_z) mirror([0,1]) MainPlanB();
81   for (i=[0 : hinge_units-1]) {
82     translate([0,0, stride_z*i])
83       linextr(0, hinge_unit) MainPlanA();
84   }
85 }
86
87 module PlanDemo(){ ////toplevel
88   MainPlan();
89   translate([0,0,-4]) color("red") Portion(1);
90   translate([0,0,-2]) color("grey") Portion(0);
91
92   translate([0, tube_dia*1.5]) {
93     MainPlanB();
94     MainPlanA();
95   }
96 //  translate([max_x - hinge_x + 20, 0]) color("blue") MainPlanA();
97 }
98
99 //PlanDemo();
100 //HalfClamp();