9 pin_gap = 1.5; // around
31 hole_dia = th + pin_gap;
33 main_r = tube_dia/2 + th;
37 hinge_o_r = 0.5 * hole_dia + th;
39 hinge_x = -0.5 * tube_dia - hinge_o_r;
40 bolt_x = 0.5 * tube_dia + th + bolt_flat * 0.5;
41 max_x = bolt_x + max(0.5 + bolt_dia + th, 0.5 * bolt_flat/2);
43 flats_y = open_gap/2 + th;
45 stride_z = hinge_unit*2 + hinge_z_gap*2;
46 total_z = hinge_units * stride_z - hinge_z_gap;
51 pin_flatten = pin_dia/2 * (1 - cos(45));
57 vhook_theta = atan2( smooth_r, main_r );
59 vhook_y0 = -max(main_r, (tube_dia/2 + vhook_th));
60 vhook_ctr = vhook_y0 - vhook_inside/2;
61 vhook_outer_dia = vhook_inside + vhook_th*2;
68 offset(r=-smooth_r) offset(delta=smooth_r) children(0);
71 module TubePlan(){ circle(r = tube_dia/2); }
72 module MainCirclePlan(){ circle(r = main_r); }
74 module PlanWeldMainCircle(){
85 rotate(-135) square(100);
89 module MainPlan(flatten=false) {
93 translate([hinge_x, 0]) circle(r= hinge_o_r);
95 rectfromto([0, -flats_y],
99 rectfromto([0, -open_gap/2],
100 [max_x+1, +open_gap/2]);
101 translate([hinge_x, 0]) {
103 circle(r= hole_dia/2);
105 translate([ pin_flatten, 0 ])
106 square(center=true, [hole_dia, hole_dia + 1]);
112 module Portion(d=0) {
113 translate([hinge_x, 0]) circle(r= hinge_o_r + d);
114 rectfromto([hinge_x*2, 0],
115 [max_x+10, -(tube_dia/2+th+10)]);
118 module MainPlanA(flatten){
125 module MainPlanB(flatten){
132 module HalfClampX(flatten=false){
134 translate([0,0, min_z]) {
135 linextr(0, total_z) mirror([0,1]) MainPlanB();
136 for (i=[0 : hinge_units-1]) {
137 translate([0,0, stride_z*i])
138 linextr(0, hinge_unit) MainPlanA(flatten);
142 translate([ bolt_x, 0, dz * total_z/4 ]) {
143 translate([0, -tube_dia/2, 0])
145 cylinder(r= bolt_dia/2, h= tube_dia);
146 translate([0, -flats_y, 0])
148 cylinder(r= bolt_flat/2, h= tube_dia/2);
154 module PlanDemo(){ ////toplevel
156 translate([0,0,-4]) color("red") Portion(1);
157 translate([0,0,-2]) color("grey") Portion(0);
159 translate([0, tube_dia*1.5]) {
164 translate([0, -tube_dia*1.5]) {
167 // translate([max_x - hinge_x + 20, 0]) color("blue") MainPlanA();
170 // ---------- vhook ----------
172 module VHookProfile() {
173 translate([0, -vhook_inside/2 - vhook_th/2])
174 circle(r = vhook_th/2);
177 module VHookHookMain(){ ////toplevel
179 rotate_extrude(convexity=10)
184 module VHookPartA(){ ////toplevel
187 translate([0, vhook_ctr, min_z + vhook_outer_dia/2]){
188 linextr(-0.1, vhook_outer_dia/2)
192 translate([0,0, -vhook_outer_dia])
193 cube(center=true, vhook_outer_dia*2);
197 //translate([0, vhook_y0, 50]) rotate([0,0,-90]) color("black") cube(10);
198 // translate([0,0,-150]) rotate([0,0,180 + theta]) color("blue") cube(100);
201 module VHookPlanDemo(){
203 translate([0, vhook_ctr, 5])
206 color("blue") VHookProfile();
210 // ---------- misc ----------
212 module GeneralB(){ ////toplevel
216 module DummyA(){ ////toplevel
220 module Demo(){ ////toplevel
221 color("red") rotate([180,0,0]) GeneralB();
222 color("blue") DummyA();