From 88aa2da2a7286797ebec9b83b8ce7e72a3279439 Mon Sep 17 00:00:00 2001 From: Jan Huwald Date: Wed, 26 Feb 2014 10:48:12 +0100 Subject: improve strut layout diff --git a/con_bar_v.scad b/con_bar_v.scad index 1706fb9..6ef6ec2 100644 --- a/con_bar_v.scad +++ b/con_bar_v.scad @@ -1,4 +1,4 @@ -bar_width = 3; +bar_width = 4; bar_height = 20; clamp_thick = 5; @@ -6,12 +6,24 @@ clamp_l1 = 10; clamp_l2 = 50; strut_height = bar_height; +strut_thick = 3; angle = 30; // fake value; TODO clamp_width = 2 * clamp_thick + bar_width; clamp_height = bar_height + clamp_thick; +module strut(num, r1, r2, h) { + a = 360 / num; + b = a - 90; + d = clamp_width/2; + + linear_extrude(h) polygon([ + [r1, d], [r2, d], + [cos(a)*r2 + cos(b)*d, sin(a)*r2 + sin(b)*d], + [cos(a)*r1 + cos(b)*d, sin(a)*r1 + sin(b)*d]]); +} + module clamp() { l = clamp_l2 - clamp_l1; @@ -26,25 +38,13 @@ module clamp() { } module con(num) { - difference() { - for (dist = [clamp_l1 + 2*clamp_thick, clamp_l2]) - assign(l = 2 * dist * sin(180/num) + 2*clamp_thick) - for (i = [1:num]) - rotate(i*360/num) - translate([dist, -clamp_thick, 0]) - rotate(180/num) - translate([0, 0, 0]) - cube([clamp_thick, l, strut_height]); - for (i = [1:num]) - rotate(i*360/num) - translate([0, -clamp_width/2, 0]) - cube([2*clamp_l2, clamp_width, clamp_height]); - } - - for (i = [1:num]) - rotate(i*360/num) - clamp(); + for (i = [0:num-1]) + rotate(i*360/num) { + clamp(); + strut(num, clamp_l1, clamp_l1 + strut_thick, strut_height); + strut(num, clamp_l2, clamp_l2 - strut_height, strut_thick); + strut(num, clamp_l2, clamp_l2 - strut_thick, strut_height); + } } -con(5); -//clamp(); \ No newline at end of file +con(3); -- cgit v0.10.1