9 pin_gap = 1.5; // around
25 // ---------- vhook ----------
29 // ---------- hhook ----------
35 // ========== defaults ==========
39 pin_hole_dia = pin_dia/2;
40 pin_tail = pin_hole_dia + pin_head_th*3;
42 // ========== calculated ==========
44 hole_dia = th + pin_gap;
46 main_r = tube_dia/2 + th;
50 hinge_o_r = 0.5 * hole_dia + th;
52 hinge_x = -0.5 * tube_dia - hinge_o_r;
53 bolt_x = 0.5 * tube_dia + th + bolt_flat * 0.5;
54 max_x = bolt_x + max(0.5 + bolt_dia + th, 0.5 * bolt_flat/2);
56 flats_y = open_gap/2 + th;
58 stride_z = hinge_unit*2 + hinge_z_gap*2;
59 total_z = hinge_units * stride_z - hinge_z_gap;
64 pin_flatten = pin_dia/2 * (1 - cos(45));
66 bolt_stride = total_z / nbolts;
72 vhook_theta = atan2( smooth_r, main_r );
74 vhook_y0 = -max(main_r, (tube_dia/2 + vhook_th));
75 vhook_ctr = vhook_y0 - vhook_inside/2;
76 vhook_outer_dia = vhook_inside + vhook_th*2;
80 hhook_outer_dia = hhook_inside + hhook_th*2;
82 hhook_ctr = -max(main_r + hhook_inside/2,
83 tube_dia/2 + hhook_outer_dia/2);
89 offset(r=-smooth_r) offset(delta=smooth_r) children(0);
92 module TubePlan(){ circle(r = tube_dia/2); }
93 module MainCirclePlan(){ circle(r = main_r); }
95 module PlanWeldMainCircle(){
106 rotate(-135) square(100);
110 module MainPlan(flatten=false) {
114 translate([hinge_x, 0]) circle(r= hinge_o_r);
116 rectfromto([0, -flats_y],
120 rectfromto([0, -open_gap/2],
121 [max_x+1, +open_gap/2]);
122 translate([hinge_x, 0]) {
124 circle(r= hole_dia/2);
126 translate([ pin_flatten, 0 ])
127 square(center=true, [hole_dia, hole_dia + 1]);
133 module Portion(d=0) {
134 translate([hinge_x, 0]) circle(r= hinge_o_r + d);
135 rectfromto([hinge_x*2, 0],
136 [max_x+10, -(tube_dia/2+th+10)]);
139 module MainPlanA(flatten){
146 module MainPlanB(flatten){
153 module HalfClampX(flatten=false){
155 translate([0,0, min_z]) {
156 linextr(0, total_z) mirror([0,1]) MainPlanB();
157 for (i=[0 : hinge_units-1]) {
158 translate([0,0, stride_z*i])
159 linextr(0, hinge_unit) MainPlanA(flatten);
162 for (j=[0:nbolts-1]) {
163 translate([ bolt_x, 0, min_z + (j + 0.5) * bolt_stride ]) {
164 translate([0, -tube_dia/2, 0])
166 cylinder(r= bolt_dia/2, h= tube_dia);
167 translate([0, -flats_y, 0])
169 cylinder(r= bolt_flat/2, h= tube_dia/2);
175 // ---------- vhook ----------
177 module VHookProfile() {
178 translate([0, -vhook_inside/2 - vhook_th/2])
179 circle(r = vhook_th/2);
182 module VHookHookMain(outer=false){ ////toplevel
184 rotate_extrude(convexity=10)
189 translate([0,-vhook_outer_dia]) square(center=true, vhook_th);
194 module VHookPartA(){ ////toplevel
197 translate([0, vhook_ctr, 0]){
200 linextr(-0.1, vhook_outer_dia/2)
202 translate([0, -vhook_inside/2 -vhook_th/2, vhook_outer_dia/2])
203 sphere(r= vhook_th/2);
208 VHookHookMain(outer=true);
209 linextr_y_xz(0, vhook_outer_dia/2) hull(){
211 translate([0,-0.1]) square(center=true, [vhook_th, 0.2]);
217 translate([0,0, -vhook_outer_dia])
218 cube(center=true, vhook_outer_dia*2);
222 //translate([0, vhook_y0, 50]) rotate([0,0,-90]) color("black") cube(10);
223 // translate([0,0,-150]) rotate([0,0,180 + theta]) color("blue") cube(100);
226 module VHookPlanDemo(){
228 translate([0, vhook_ctr, 5])
231 color("blue") VHookProfile();
235 // ---------- hhook ----------
237 module HHookHookPlan(){
238 translate([0, hhook_ctr]){
240 circle(r = hhook_outer_dia/2);
241 circle(r = hhook_inside/2);
242 rectfromto([+hhook_outer_dia, -hhook_outer_dia],
243 [0, +hhook_outer_dia]);
245 translate([0, -(hhook_inside/2 + hhook_th/2)]){
247 for (x=[-0.1, hhook_l]) {
248 translate([x,0]) square(center=true, hhook_th);
255 module HHookPartA(){ ////toplevel
257 linextr(min_z, max_z) {
262 module HHookPlanDemo(){
267 // ---------- misc ----------
269 module PinSitu(){ ////toplevel
272 translate([0,0, -pin_head_th])
273 cylinder(r= pin_dia/2, h = total_z + pin_head_th + pin_tail);
275 cylinder(r= hinge_o_r, h = pin_head_th);
277 translate([0,0, total_z + pin_tail/2])
279 translate([0,0, -pin_dia])
280 cylinder(r= pin_hole_dia/2, h=pin_dia*2);
281 translate([pin_dia/2 * cos(45), -50, -pin_head_th*2])
282 cube([50,100, total_z*2]);
286 module Pin(){ ////toplevel
292 module GeneralB(){ ////toplevel
296 module DummyA(){ ////toplevel
300 module PlanDemo(){ ////toplevel
302 translate([0,0,-4]) color("red") Portion(1);
303 translate([0,0,-2]) color("grey") Portion(0);
305 translate([0, tube_dia*1.5]) {
310 translate([0, -tube_dia*1.5]) {
313 translate([tube_dia*4, 0]) {
316 // translate([max_x - hinge_x + 20, 0]) color("blue") MainPlanA();
319 module Demo(){ ////toplevel
320 color("red") rotate([180,0,0]) GeneralB();
321 color("blue") DummyA();