9 pin_gap = 1.5; // around
25 // ---------- vhook ----------
29 // ---------- hhook ----------
35 // ========== calculated ==========
38 hole_dia = th + pin_gap;
40 main_r = tube_dia/2 + th;
44 hinge_o_r = 0.5 * hole_dia + th;
46 hinge_x = -0.5 * tube_dia - hinge_o_r;
47 bolt_x = 0.5 * tube_dia + th + bolt_flat * 0.5;
48 max_x = bolt_x + max(0.5 + bolt_dia + th, 0.5 * bolt_flat/2);
50 flats_y = open_gap/2 + th;
52 stride_z = hinge_unit*2 + hinge_z_gap*2;
53 total_z = hinge_units * stride_z - hinge_z_gap;
58 pin_flatten = pin_dia/2 * (1 - cos(45));
60 bolt_stride = total_z / nbolts;
66 vhook_theta = atan2( smooth_r, main_r );
68 vhook_y0 = -max(main_r, (tube_dia/2 + vhook_th));
69 vhook_ctr = vhook_y0 - vhook_inside/2;
70 vhook_outer_dia = vhook_inside + vhook_th*2;
74 hhook_outer_dia = hhook_inside + hhook_th*2;
76 hhook_ctr = -max(main_r + hhook_inside/2,
77 tube_dia/2 + hhook_outer_dia/2);
83 offset(r=-smooth_r) offset(delta=smooth_r) children(0);
86 module TubePlan(){ circle(r = tube_dia/2); }
87 module MainCirclePlan(){ circle(r = main_r); }
89 module PlanWeldMainCircle(){
100 rotate(-135) square(100);
104 module MainPlan(flatten=false) {
108 translate([hinge_x, 0]) circle(r= hinge_o_r);
110 rectfromto([0, -flats_y],
114 rectfromto([0, -open_gap/2],
115 [max_x+1, +open_gap/2]);
116 translate([hinge_x, 0]) {
118 circle(r= hole_dia/2);
120 translate([ pin_flatten, 0 ])
121 square(center=true, [hole_dia, hole_dia + 1]);
127 module Portion(d=0) {
128 translate([hinge_x, 0]) circle(r= hinge_o_r + d);
129 rectfromto([hinge_x*2, 0],
130 [max_x+10, -(tube_dia/2+th+10)]);
133 module MainPlanA(flatten){
140 module MainPlanB(flatten){
147 module HalfClampX(flatten=false){
149 translate([0,0, min_z]) {
150 linextr(0, total_z) mirror([0,1]) MainPlanB();
151 for (i=[0 : hinge_units-1]) {
152 translate([0,0, stride_z*i])
153 linextr(0, hinge_unit) MainPlanA(flatten);
156 for (j=[0:nbolts-1]) {
157 translate([ bolt_x, 0, min_z + (j + 0.5) * bolt_stride ]) {
158 translate([0, -tube_dia/2, 0])
160 cylinder(r= bolt_dia/2, h= tube_dia);
161 translate([0, -flats_y, 0])
163 cylinder(r= bolt_flat/2, h= tube_dia/2);
169 // ---------- vhook ----------
171 module VHookProfile() {
172 translate([0, -vhook_inside/2 - vhook_th/2])
173 circle(r = vhook_th/2);
176 module VHookHookMain(outer=false){ ////toplevel
178 rotate_extrude(convexity=10)
183 translate([0,-vhook_outer_dia]) square(center=true, vhook_th);
188 module VHookPartA(){ ////toplevel
191 translate([0, vhook_ctr, 0]){
194 linextr(-0.1, vhook_outer_dia/2)
196 translate([0, -vhook_inside/2 -vhook_th/2, vhook_outer_dia/2])
197 sphere(r= vhook_th/2);
202 VHookHookMain(outer=true);
203 linextr_y_xz(0, vhook_outer_dia/2) hull(){
205 translate([0,-0.1]) square(center=true, [vhook_th, 0.2]);
211 translate([0,0, -vhook_outer_dia])
212 cube(center=true, vhook_outer_dia*2);
216 //translate([0, vhook_y0, 50]) rotate([0,0,-90]) color("black") cube(10);
217 // translate([0,0,-150]) rotate([0,0,180 + theta]) color("blue") cube(100);
220 module VHookPlanDemo(){
222 translate([0, vhook_ctr, 5])
225 color("blue") VHookProfile();
229 // ---------- hhook ----------
231 module HHookHookPlan(){
232 translate([0, hhook_ctr]){
234 circle(r = hhook_outer_dia/2);
235 circle(r = hhook_inside/2);
236 rectfromto([+hhook_outer_dia, -hhook_outer_dia],
237 [0, +hhook_outer_dia]);
239 translate([0, -(hhook_inside/2 + hhook_th/2)]){
241 for (x=[-0.1, hhook_l]) {
242 translate([x,0]) square(center=true, hhook_th);
249 module HHookPartA(){ ////toplevel
251 linextr(min_z, max_z) {
256 module HHookPlanDemo(){
261 // ---------- misc ----------
263 module GeneralB(){ ////toplevel
267 module DummyA(){ ////toplevel
271 module PlanDemo(){ ////toplevel
273 translate([0,0,-4]) color("red") Portion(1);
274 translate([0,0,-2]) color("grey") Portion(0);
276 translate([0, tube_dia*1.5]) {
281 translate([0, -tube_dia*1.5]) {
284 translate([tube_dia*4, 0]) {
287 // translate([max_x - hinge_x + 20, 0]) color("blue") MainPlanA();
290 module Demo(){ ////toplevel
291 color("red") rotate([180,0,0]) GeneralB();
292 color("blue") DummyA();