9 pin_gap = 1.5; // around
23 // ---------- vhook ----------
27 // ---------- hhook ----------
32 // ========== calculated ==========
35 hole_dia = th + pin_gap;
37 main_r = tube_dia/2 + th;
41 hinge_o_r = 0.5 * hole_dia + th;
43 hinge_x = -0.5 * tube_dia - hinge_o_r;
44 bolt_x = 0.5 * tube_dia + th + bolt_flat * 0.5;
45 max_x = bolt_x + max(0.5 + bolt_dia + th, 0.5 * bolt_flat/2);
47 flats_y = open_gap/2 + th;
49 stride_z = hinge_unit*2 + hinge_z_gap*2;
50 total_z = hinge_units * stride_z - hinge_z_gap;
55 pin_flatten = pin_dia/2 * (1 - cos(45));
61 vhook_theta = atan2( smooth_r, main_r );
63 vhook_y0 = -max(main_r, (tube_dia/2 + vhook_th));
64 vhook_ctr = vhook_y0 - vhook_inside/2;
65 vhook_outer_dia = vhook_inside + vhook_th*2;
72 offset(r=-smooth_r) offset(delta=smooth_r) children(0);
75 module TubePlan(){ circle(r = tube_dia/2); }
76 module MainCirclePlan(){ circle(r = main_r); }
78 module PlanWeldMainCircle(){
89 rotate(-135) square(100);
93 module MainPlan(flatten=false) {
97 translate([hinge_x, 0]) circle(r= hinge_o_r);
99 rectfromto([0, -flats_y],
103 rectfromto([0, -open_gap/2],
104 [max_x+1, +open_gap/2]);
105 translate([hinge_x, 0]) {
107 circle(r= hole_dia/2);
109 translate([ pin_flatten, 0 ])
110 square(center=true, [hole_dia, hole_dia + 1]);
116 module Portion(d=0) {
117 translate([hinge_x, 0]) circle(r= hinge_o_r + d);
118 rectfromto([hinge_x*2, 0],
119 [max_x+10, -(tube_dia/2+th+10)]);
122 module MainPlanA(flatten){
129 module MainPlanB(flatten){
136 module HalfClampX(flatten=false){
138 translate([0,0, min_z]) {
139 linextr(0, total_z) mirror([0,1]) MainPlanB();
140 for (i=[0 : hinge_units-1]) {
141 translate([0,0, stride_z*i])
142 linextr(0, hinge_unit) MainPlanA(flatten);
146 translate([ bolt_x, 0, dz * total_z/4 ]) {
147 translate([0, -tube_dia/2, 0])
149 cylinder(r= bolt_dia/2, h= tube_dia);
150 translate([0, -flats_y, 0])
152 cylinder(r= bolt_flat/2, h= tube_dia/2);
158 // ---------- vhook ----------
160 module VHookProfile() {
161 translate([0, -vhook_inside/2 - vhook_th/2])
162 circle(r = vhook_th/2);
165 module VHookHookMain(outer=false){ ////toplevel
167 rotate_extrude(convexity=10)
172 translate([0,-vhook_outer_dia]) square(center=true, vhook_th);
177 module VHookPartA(){ ////toplevel
180 translate([0, vhook_ctr, 0]){
183 linextr(-0.1, vhook_outer_dia/2)
185 translate([0, -vhook_inside/2 -vhook_th/2, vhook_outer_dia/2])
186 sphere(r= vhook_th/2);
191 VHookHookMain(outer=true);
192 linextr_y_xz(0, vhook_outer_dia/2) hull(){
194 translate([0,-0.1]) square(center=true, [vhook_th, 0.2]);
200 translate([0,0, -vhook_outer_dia])
201 cube(center=true, vhook_outer_dia*2);
205 //translate([0, vhook_y0, 50]) rotate([0,0,-90]) color("black") cube(10);
206 // translate([0,0,-150]) rotate([0,0,180 + theta]) color("blue") cube(100);
209 module VHookPlanDemo(){
211 translate([0, vhook_ctr, 5])
214 color("blue") VHookProfile();
218 // ---------- hhook ----------
220 module HHookPlanDemo(){
224 // ---------- misc ----------
226 module GeneralB(){ ////toplevel
230 module DummyA(){ ////toplevel
234 module PlanDemo(){ ////toplevel
236 translate([0,0,-4]) color("red") Portion(1);
237 translate([0,0,-2]) color("grey") Portion(0);
239 translate([0, tube_dia*1.5]) {
244 translate([0, -tube_dia*1.5]) {
247 translate([tube_dia*4, 0]) {
250 // translate([max_x - hinge_x + 20, 0]) color("blue") MainPlanA();
253 module Demo(){ ////toplevel
254 color("red") rotate([180,0,0]) GeneralB();
255 color("blue") DummyA();