9 pin_gap = 1.5; // around
25 bolt_gap = 1.0; // total, on both sides
27 // ---------- vhook ----------
31 // ---------- cleat ----------
36 cleat_horn_d_min = [10, 12];
37 cleat_horn_d_max = [12, 14];
41 cleat_overlap = (1-cos(60));
43 // ---------- hhook ----------
49 // ========== defaults ==========
53 pin_hole_dia = pin_dia/2;
54 pin_tail = pin_hole_dia + pin_head_th + hinge_z_gap*3;
56 // ========== calculated ==========
60 hole_dia = th + pin_gap;
62 bolt_hole_r = (bolt_dia + bolt_gap)/2;
64 main_r = tube_dia/2 + th;
68 hinge_o_r = 0.5 * hole_dia + th;
70 hinge_x = -0.5 * tube_dia - hinge_o_r;
71 bolt_x = 0.5 * tube_dia + th + bolt_flat * 0.5;
72 max_x = bolt_x + max(bolt_hole_r + th, 0.5 * bolt_flat/2);
74 flats_y = open_gap/2 + th;
76 stride_z = hinge_unit*2 + hinge_z_gap*2;
77 total_z = hinge_units * stride_z - hinge_z_gap;
82 pin_flatten = pin_dia/2 * (1 - cos(45));
84 bolt_stride = total_z / nbolts;
90 vhook_theta = atan2( smooth_r, main_r );
92 vhook_y0 = -max(main_r, (tube_dia/2 + vhook_th));
93 vhook_ctr = vhook_y0 - vhook_inside/2;
94 vhook_outer_dia = vhook_inside + vhook_th*2;
98 cleat_horn_tl = cleat_horn_l + cleat_stem_l/2;
102 + cleat_horn_d_min[0]/2
103 - cleat_horn_d_min[0]/2 * cleat_overlap
107 // calculated - hhook
109 hhook_outer_dia = hhook_inside + hhook_th*2;
111 hhook_ctr = -max(main_r + hhook_inside/2,
112 tube_dia/2 + hhook_outer_dia/2);
118 offset(r=-smooth_r) offset(delta=smooth_r) children(0);
121 module TubePlan(){ circle(r = tube_dia/2); }
122 module MainCirclePlan(){ circle(r = main_r); }
124 module PlanWeldMainCircle(){
135 rotate(-135) square(100);
139 module MainPlan(flatten=false) {
143 translate([hinge_x, 0]) circle(r= hinge_o_r);
145 rectfromto([0, -flats_y],
149 rectfromto([0, -open_gap/2],
150 [max_x+1, +open_gap/2]);
151 translate([hinge_x, 0]) {
153 circle(r= hole_dia/2);
155 translate([ pin_flatten, 0 ])
156 square(center=true, [hole_dia, hole_dia + 1]);
162 module Portion(d=0) {
163 translate([hinge_x, 0]) circle(r= hinge_o_r + d);
164 rectfromto([hinge_x*2, 0],
165 [max_x+10, -(tube_dia/2+th+10)]);
168 module MainPlanA(flatten){
175 module MainPlanB(flatten){
182 module HalfClampX(flatten=false){
184 translate([0,0, min_z]) {
185 linextr(0, total_z) mirror([0,1]) MainPlanB();
186 for (i=[0 : hinge_units-1]) {
187 translate([0,0, stride_z*i])
188 linextr(0, hinge_unit) MainPlanA(flatten);
191 for (j=[0:nbolts-1]) {
192 translate([ bolt_x, 0, min_z + (j + 0.5) * bolt_stride ]) {
193 translate([0, -tube_dia/2, 0])
195 cylinder(r= bolt_hole_r, h= tube_dia);
196 translate([0, -flats_y, 0])
198 cylinder(r= bolt_flat/2, h= tube_dia/2);
204 // ---------- vhook ----------
206 module VHookProfile() {
207 translate([0, -vhook_inside/2 - vhook_th/2])
208 circle(r = vhook_th/2);
211 module VHookHookMain(outer=false){ ////toplevel
213 rotate_extrude(convexity=10)
218 translate([0,-vhook_outer_dia]) square(center=true, vhook_th);
223 module VHookA(){ ////toplevel
226 translate([0, vhook_ctr, 0]){
229 linextr(-0.1, vhook_outer_dia/2)
231 translate([0, -vhook_inside/2 -vhook_th/2, vhook_outer_dia/2])
232 sphere(r= vhook_th/2);
237 VHookHookMain(outer=true);
238 linextr_y_xz(0, vhook_outer_dia/2) hull(){
240 translate([0,-0.1]) square(center=true, [vhook_th, 0.2]);
246 translate([0,0, -vhook_outer_dia])
247 cube(center=true, vhook_outer_dia*2);
251 //translate([0, vhook_y0, 50]) rotate([0,0,-90]) color("black") cube(10);
252 // translate([0,0,-150]) rotate([0,0,180 + theta]) color("blue") cube(100);
255 module VHookPlanDemo(){
257 translate([0, vhook_ctr, 5])
260 color("blue") VHookProfile();
264 // ---------- cleat ----------
266 function cleat_frame_theta(s) = s * cleat_horn_tl / cleat_curve_r * 360/TAU;
267 function cleat_frame_z(s) = cleat_curve_r * (1 - cos(cleat_frame_theta(s)));
268 function cleat_frame_x(s) = cleat_curve_r * sin(cleat_frame_theta(s));
269 function cleat_frame_r(s) = ( cleat_horn_d_min * s +
270 cleat_horn_d_max * (1-s) ) * 0.5;
272 module CleatFrameSphere(r) {
273 scale([1, r[1]/r[0], 1])
277 module CleatFrame(s) {
278 r = cleat_frame_r(s);
279 translate([cleat_frame_x(s), 0, cleat_frame_z(s)])
286 for (si=[0 : cleat_frames-2]) {
287 s0 = si / (cleat_frames-1);
288 s1 = (si+1) / (cleat_frames-1);
297 frames = cleat_frames/2;
298 se = cleat_stem_l/2 / cleat_horn_tl;
299 r = cleat_frame_r(se);
302 for (s = [-se, se]) {
303 for (z= [-(cleat_height + tube_dia/2),
305 translate([cleat_frame_x(s), 0, z])
306 linear_extrude(height=0.1)
307 scale([1, r[1]/r[0]])
316 translate([0,0, vcleat_dz]){
318 translate([0, -(main_r + cleat_height), 0]) {
319 rotate([0, -90, 90]) {
328 linextr(-cleat_stem_l, +cleat_stem_l)
329 circle(r = tube_dia/2 + 0.1);
332 translate([0,0, total_z * 0.5])
334 (main_r + cleat_stem_l)*4 * [1,1,0] +
339 module VCleatA(){ ////toplevel
344 // ---------- hhook ----------
346 module HHookHookPlan(){
347 translate([0, hhook_ctr]){
349 circle(r = hhook_outer_dia/2);
350 circle(r = hhook_inside/2);
351 rectfromto([+hhook_outer_dia, -hhook_outer_dia],
352 [0, +hhook_outer_dia]);
354 translate([0, -(hhook_inside/2 + hhook_th/2)]){
356 for (x=[-0.1, hhook_l]) {
357 translate([x,0]) square(center=true, hhook_th);
364 module HHookA(){ ////toplevel
366 linextr(min_z, max_z) {
371 module HHookPlanDemo(){
376 // ---------- misc ----------
378 module PinSitu(){ ////toplevel
381 translate([0,0, -pin_head_th])
382 cylinder(r= pin_dia/2, h = total_z + pin_head_th + pin_tail);
384 cylinder(r= hinge_o_r - pin_gap, h = pin_head_th);
386 translate([0,0, total_z + pin_tail/2])
388 translate([0,0, -pin_dia])
389 cylinder(r= pin_hole_dia/2, h=pin_dia*2);
390 translate([pin_dia/2 * cos(45), -50, -pin_head_th*2])
391 cube([50,100, total_z*2]);
395 module Pin(){ ////toplevel
401 module GeneralB(){ ////toplevel
405 module DummyA(){ ////toplevel
409 module PlanDemo(){ ////toplevel
411 translate([0,0,-4]) color("red") Portion(1);
412 translate([0,0,-2]) color("grey") Portion(0);
414 translate([0, tube_dia*1.5]) {
419 translate([0, -tube_dia*1.5]) {
422 translate([tube_dia*4, 0]) {
425 // translate([max_x - hinge_x + 20, 0]) color("blue") MainPlanA();
428 module DemoA(){ DummyA(); }
430 module Demo(){ ////toplevel
431 color("red") rotate([180,0,0]) GeneralB();
432 color("blue") DemoA();
433 color("orange") translate([hinge_x, 0, min_z - hinge_z_gap])
434 rotate([0,0,180]) PinSitu();
437 module DemoPair(){ ////toplevel
438 color("red") rotate([180,0,0]) DemoA();
439 color("blue") DemoA();
440 color("orange") translate([hinge_x, 0, min_z - hinge_z_gap])
441 rotate([0,0,180]) PinSitu();