9 pin_gap = 1.5; // around
23 // ---------- vhook ----------
27 // ---------- hhook ----------
33 // ========== calculated ==========
36 hole_dia = th + pin_gap;
38 main_r = tube_dia/2 + th;
42 hinge_o_r = 0.5 * hole_dia + th;
44 hinge_x = -0.5 * tube_dia - hinge_o_r;
45 bolt_x = 0.5 * tube_dia + th + bolt_flat * 0.5;
46 max_x = bolt_x + max(0.5 + bolt_dia + th, 0.5 * bolt_flat/2);
48 flats_y = open_gap/2 + th;
50 stride_z = hinge_unit*2 + hinge_z_gap*2;
51 total_z = hinge_units * stride_z - hinge_z_gap;
56 pin_flatten = pin_dia/2 * (1 - cos(45));
62 vhook_theta = atan2( smooth_r, main_r );
64 vhook_y0 = -max(main_r, (tube_dia/2 + vhook_th));
65 vhook_ctr = vhook_y0 - vhook_inside/2;
66 vhook_outer_dia = vhook_inside + vhook_th*2;
70 hhook_outer_dia = hhook_inside + hhook_th*2;
72 hhook_ctr = -max(main_r + hhook_inside/2,
73 tube_dia/2 + hhook_outer_dia/2);
79 offset(r=-smooth_r) offset(delta=smooth_r) children(0);
82 module TubePlan(){ circle(r = tube_dia/2); }
83 module MainCirclePlan(){ circle(r = main_r); }
85 module PlanWeldMainCircle(){
96 rotate(-135) square(100);
100 module MainPlan(flatten=false) {
104 translate([hinge_x, 0]) circle(r= hinge_o_r);
106 rectfromto([0, -flats_y],
110 rectfromto([0, -open_gap/2],
111 [max_x+1, +open_gap/2]);
112 translate([hinge_x, 0]) {
114 circle(r= hole_dia/2);
116 translate([ pin_flatten, 0 ])
117 square(center=true, [hole_dia, hole_dia + 1]);
123 module Portion(d=0) {
124 translate([hinge_x, 0]) circle(r= hinge_o_r + d);
125 rectfromto([hinge_x*2, 0],
126 [max_x+10, -(tube_dia/2+th+10)]);
129 module MainPlanA(flatten){
136 module MainPlanB(flatten){
143 module HalfClampX(flatten=false){
145 translate([0,0, min_z]) {
146 linextr(0, total_z) mirror([0,1]) MainPlanB();
147 for (i=[0 : hinge_units-1]) {
148 translate([0,0, stride_z*i])
149 linextr(0, hinge_unit) MainPlanA(flatten);
153 translate([ bolt_x, 0, dz * total_z/4 ]) {
154 translate([0, -tube_dia/2, 0])
156 cylinder(r= bolt_dia/2, h= tube_dia);
157 translate([0, -flats_y, 0])
159 cylinder(r= bolt_flat/2, h= tube_dia/2);
165 // ---------- vhook ----------
167 module VHookProfile() {
168 translate([0, -vhook_inside/2 - vhook_th/2])
169 circle(r = vhook_th/2);
172 module VHookHookMain(outer=false){ ////toplevel
174 rotate_extrude(convexity=10)
179 translate([0,-vhook_outer_dia]) square(center=true, vhook_th);
184 module VHookPartA(){ ////toplevel
187 translate([0, vhook_ctr, 0]){
190 linextr(-0.1, vhook_outer_dia/2)
192 translate([0, -vhook_inside/2 -vhook_th/2, vhook_outer_dia/2])
193 sphere(r= vhook_th/2);
198 VHookHookMain(outer=true);
199 linextr_y_xz(0, vhook_outer_dia/2) hull(){
201 translate([0,-0.1]) square(center=true, [vhook_th, 0.2]);
207 translate([0,0, -vhook_outer_dia])
208 cube(center=true, vhook_outer_dia*2);
212 //translate([0, vhook_y0, 50]) rotate([0,0,-90]) color("black") cube(10);
213 // translate([0,0,-150]) rotate([0,0,180 + theta]) color("blue") cube(100);
216 module VHookPlanDemo(){
218 translate([0, vhook_ctr, 5])
221 color("blue") VHookProfile();
225 // ---------- hhook ----------
227 module HHookHookPlan(){
228 translate([0, hhook_ctr]){
230 circle(r = hhook_outer_dia/2);
231 circle(r = hhook_inside/2);
232 rectfromto([-hhook_outer_dia, -hhook_outer_dia],
233 [0, +hhook_outer_dia]);
235 translate([0, -(hhook_inside/2 + hhook_th/2)]){
237 for (x=[0.1, -hhook_l]) {
238 translate([x,0]) square(center=true, hhook_th);
245 module HHookPlanDemo(){
250 // ---------- misc ----------
252 module GeneralB(){ ////toplevel
256 module DummyA(){ ////toplevel
260 module PlanDemo(){ ////toplevel
262 translate([0,0,-4]) color("red") Portion(1);
263 translate([0,0,-2]) color("grey") Portion(0);
265 translate([0, tube_dia*1.5]) {
270 translate([0, -tube_dia*1.5]) {
273 translate([tube_dia*4, 0]) {
276 // translate([max_x - hinge_x + 20, 0]) color("blue") MainPlanA();
279 module Demo(){ ////toplevel
280 color("red") rotate([180,0,0]) GeneralB();
281 color("blue") DummyA();