9 pin_gap = 1.5; // around
25 hole_dia = th + pin_gap;
29 hinge_o_r = 0.5 * hole_dia + th;
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);
35 flats_y = open_gap/2 + th;
37 stride_z = hinge_unit*2 + hinge_z_gap*2;
38 total_z = hinge_units * stride_z - hinge_z_gap;
40 pin_flatten = pin_dia/2 * (1 - cos(45));
45 module MainPlan(flatten=false) {
47 offset(r=-smooth_r) offset(delta=smooth_r)
49 translate([hinge_x, 0]) circle(r= hinge_o_r);
50 circle(r = tube_dia/2 + th);
51 rectfromto([0, -flats_y],
54 circle(r = tube_dia/2);
55 rectfromto([0, -open_gap/2],
56 [max_x+1, +open_gap/2]);
57 translate([hinge_x, 0]) {
59 circle(r= hole_dia/2);
61 translate([ pin_flatten, 0 ])
62 square(center=true, [hole_dia, hole_dia + 1]);
69 translate([hinge_x, 0]) circle(r= hinge_o_r + d);
70 rectfromto([hinge_x*2, 0],
71 [max_x+10, -(tube_dia/2+th+10)]);
74 module MainPlanA(flatten){
81 module MainPlanB(flatten){
88 module HalfClampX(flatten){
89 translate([0,0, -total_z/2]) {
90 linextr(0, total_z) mirror([0,1]) MainPlanB();
91 for (i=[0 : hinge_units-1]) {
92 translate([0,0, stride_z*i])
93 linextr(0, hinge_unit) MainPlanA(flatten);
98 module HalfClampA() { HalfClampX(false); }
99 module HalfClampB() { rotate([180,0,0]) HalfClampX(true); }
101 module PlanDemo(){ ////toplevel
103 translate([0,0,-4]) color("red") Portion(1);
104 translate([0,0,-2]) color("grey") Portion(0);
106 translate([0, tube_dia*1.5]) {
110 // translate([max_x - hinge_x + 20, 0]) color("blue") MainPlanA();
113 module Demo(){ ////toplevel
114 color("red") HalfClampA();
115 color("blue") HalfClampB();