9 pin_gap = 1.5; // around
25 bolt_gap = 1.0; // total, on both sides
27 // ---------- vhook ----------
31 // ---------- cleat ----------
36 cleat_horn_d_min = [8, 10];
37 cleat_horn_d_max = [10, 12];
40 // ---------- hhook ----------
46 // ========== defaults ==========
50 pin_hole_dia = pin_dia/2;
51 pin_tail = pin_hole_dia + pin_head_th + hinge_z_gap*3;
53 // ========== calculated ==========
57 hole_dia = th + pin_gap;
59 bolt_hole_r = (bolt_dia + bolt_gap)/2;
61 main_r = tube_dia/2 + th;
65 hinge_o_r = 0.5 * hole_dia + th;
67 hinge_x = -0.5 * tube_dia - hinge_o_r;
68 bolt_x = 0.5 * tube_dia + th + bolt_flat * 0.5;
69 max_x = bolt_x + max(bolt_hole_r + th, 0.5 * bolt_flat/2);
71 flats_y = open_gap/2 + th;
73 stride_z = hinge_unit*2 + hinge_z_gap*2;
74 total_z = hinge_units * stride_z - hinge_z_gap;
79 pin_flatten = pin_dia/2 * (1 - cos(45));
81 bolt_stride = total_z / nbolts;
87 vhook_theta = atan2( smooth_r, main_r );
89 vhook_y0 = -max(main_r, (tube_dia/2 + vhook_th));
90 vhook_ctr = vhook_y0 - vhook_inside/2;
91 vhook_outer_dia = vhook_inside + vhook_th*2;
95 hhook_outer_dia = hhook_inside + hhook_th*2;
97 hhook_ctr = -max(main_r + hhook_inside/2,
98 tube_dia/2 + hhook_outer_dia/2);
104 offset(r=-smooth_r) offset(delta=smooth_r) children(0);
107 module TubePlan(){ circle(r = tube_dia/2); }
108 module MainCirclePlan(){ circle(r = main_r); }
110 module PlanWeldMainCircle(){
121 rotate(-135) square(100);
125 module MainPlan(flatten=false) {
129 translate([hinge_x, 0]) circle(r= hinge_o_r);
131 rectfromto([0, -flats_y],
135 rectfromto([0, -open_gap/2],
136 [max_x+1, +open_gap/2]);
137 translate([hinge_x, 0]) {
139 circle(r= hole_dia/2);
141 translate([ pin_flatten, 0 ])
142 square(center=true, [hole_dia, hole_dia + 1]);
148 module Portion(d=0) {
149 translate([hinge_x, 0]) circle(r= hinge_o_r + d);
150 rectfromto([hinge_x*2, 0],
151 [max_x+10, -(tube_dia/2+th+10)]);
154 module MainPlanA(flatten){
161 module MainPlanB(flatten){
168 module HalfClampX(flatten=false){
170 translate([0,0, min_z]) {
171 linextr(0, total_z) mirror([0,1]) MainPlanB();
172 for (i=[0 : hinge_units-1]) {
173 translate([0,0, stride_z*i])
174 linextr(0, hinge_unit) MainPlanA(flatten);
177 for (j=[0:nbolts-1]) {
178 translate([ bolt_x, 0, min_z + (j + 0.5) * bolt_stride ]) {
179 translate([0, -tube_dia/2, 0])
181 cylinder(r= bolt_hole_r, h= tube_dia);
182 translate([0, -flats_y, 0])
184 cylinder(r= bolt_flat/2, h= tube_dia/2);
190 // ---------- vhook ----------
192 module VHookProfile() {
193 translate([0, -vhook_inside/2 - vhook_th/2])
194 circle(r = vhook_th/2);
197 module VHookHookMain(outer=false){ ////toplevel
199 rotate_extrude(convexity=10)
204 translate([0,-vhook_outer_dia]) square(center=true, vhook_th);
209 module VHookA(){ ////toplevel
212 translate([0, vhook_ctr, 0]){
215 linextr(-0.1, vhook_outer_dia/2)
217 translate([0, -vhook_inside/2 -vhook_th/2, vhook_outer_dia/2])
218 sphere(r= vhook_th/2);
223 VHookHookMain(outer=true);
224 linextr_y_xz(0, vhook_outer_dia/2) hull(){
226 translate([0,-0.1]) square(center=true, [vhook_th, 0.2]);
232 translate([0,0, -vhook_outer_dia])
233 cube(center=true, vhook_outer_dia*2);
237 //translate([0, vhook_y0, 50]) rotate([0,0,-90]) color("black") cube(10);
238 // translate([0,0,-150]) rotate([0,0,180 + theta]) color("blue") cube(100);
241 module VHookPlanDemo(){
243 translate([0, vhook_ctr, 5])
246 color("blue") VHookProfile();
250 // ---------- cleat ----------
252 module CleatFrame(s) {
253 r = ( cleat_horn_d_min * s +
254 cleat_horn_d_max * (1-s) ) * 0.5;
255 translate([0,0, cleat_curve_r])
256 rotate( s * cleat_horn_l / cleat_curve_r * 360/TAU * [0,1,0] )
257 translate([0,0, -cleat_curve_r])
259 scale([1, r[1]/r[0]])
265 for (si=[0 : cleat_frames-2]) {
266 s0 = si / (cleat_frames-1);
267 s1 = (si+1) / (cleat_frames-1);
275 module VCleatA(){ ////toplevel
278 translate([0, -(main_r + cleat_height), 0]) {
279 rotate([0, -90, 90]) {
288 // ---------- hhook ----------
290 module HHookHookPlan(){
291 translate([0, hhook_ctr]){
293 circle(r = hhook_outer_dia/2);
294 circle(r = hhook_inside/2);
295 rectfromto([+hhook_outer_dia, -hhook_outer_dia],
296 [0, +hhook_outer_dia]);
298 translate([0, -(hhook_inside/2 + hhook_th/2)]){
300 for (x=[-0.1, hhook_l]) {
301 translate([x,0]) square(center=true, hhook_th);
308 module HHookA(){ ////toplevel
310 linextr(min_z, max_z) {
315 module HHookPlanDemo(){
320 // ---------- misc ----------
322 module PinSitu(){ ////toplevel
325 translate([0,0, -pin_head_th])
326 cylinder(r= pin_dia/2, h = total_z + pin_head_th + pin_tail);
328 cylinder(r= hinge_o_r - pin_gap, h = pin_head_th);
330 translate([0,0, total_z + pin_tail/2])
332 translate([0,0, -pin_dia])
333 cylinder(r= pin_hole_dia/2, h=pin_dia*2);
334 translate([pin_dia/2 * cos(45), -50, -pin_head_th*2])
335 cube([50,100, total_z*2]);
339 module Pin(){ ////toplevel
345 module GeneralB(){ ////toplevel
349 module DummyA(){ ////toplevel
353 module PlanDemo(){ ////toplevel
355 translate([0,0,-4]) color("red") Portion(1);
356 translate([0,0,-2]) color("grey") Portion(0);
358 translate([0, tube_dia*1.5]) {
363 translate([0, -tube_dia*1.5]) {
366 translate([tube_dia*4, 0]) {
369 // translate([max_x - hinge_x + 20, 0]) color("blue") MainPlanA();
372 module DemoA(){ DummyA(); }
374 module Demo(){ ////toplevel
375 color("red") rotate([180,0,0]) GeneralB();
376 color("blue") DemoA();
377 color("orange") translate([hinge_x, 0, min_z - hinge_z_gap])
378 rotate([0,0,180]) PinSitu();