From 564373cc6b1038d885a5e5b98c5163ff7527dc6d Mon Sep 17 00:00:00 2001 From: "Jan \"Yenya\" Kasprzak" Date: Mon, 17 Dec 2018 18:17:38 +0100 Subject: [PATCH] terarko podlozka: verze pro plnou velikost --- terarko-podlozka.scad | 56 ++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/terarko-podlozka.scad b/terarko-podlozka.scad index 53641fa..b51b464 100644 --- a/terarko-podlozka.scad +++ b/terarko-podlozka.scad @@ -1,43 +1,51 @@ infty = 300; eps = 0.01; -wall = 1.0; +wall = 1.2; -squares = 3; +squares_x = 6; +squares_y = 5; -bottom_l = 6; +bottom_l = 8; top_l = 3; -top_h = 3.5; +top_h = 5; string_h = 1.5; -square_l = 20; +stem_l = 14; module stem() { hull() { cylinder(r = wall/2, h = string_h, $fn = 16); - translate([square_l, 0, 0]) + translate([stem_l, 0, 0]) cylinder(r = wall/2, h = string_h, $fn = 16); } // tip - for (x = [-1, 1]) - translate([(1-x)*square_l/2, 0, 0]) - scale([x, 1, 1]) - hull() { - cylinder(r = wall/2, h = top_h, $fn = 16); - translate([top_l, 0, 0]) - cylinder(r = wall/2, h = top_h, $fn = 16); - translate([bottom_l, 0, 0]) - cylinder(r = wall/2, h = string_h, $fn = 16); - } + hull() { + cylinder(r = wall/2, h = top_h, $fn = 16); + translate([top_l, 0, 0]) + cylinder(r = wall/2, h = top_h, $fn = 16); + translate([bottom_l, 0, 0]) + cylinder(r = wall/2, h = string_h, $fn = 16); + } } -for (y = [-squares/2:squares/2]) -for (x = [-squares/2:squares/2-1]) - translate([x*square_l, y*square_l, 0]) +module hexagon() { + for (angle = [0:120:360]) rotate([0, 0, angle]) + translate([-stem_l/2, -stem_l*cos(30), 0]) { stem(); + translate([stem_l*(1+sin(30)), stem_l*cos(30), 0]) + rotate([0, 0, 240]) + stem(); + } +} -rotate([0, 0, 90]) -for (y = [-squares/2:squares/2]) -for (x = [-squares/2:squares/2-1]) - translate([x*square_l, y*square_l, 0]) - stem(); +for (y = [0:squares_y]) +for (x = [0:squares_x]) { + if (x % 2 == 0) { + translate([x/2*stem_l*(2+2*sin(30)), (y+0.5)*stem_l*(2*cos(30)), 0]) + hexagon(); + } else { + translate([(x/2)*stem_l*(2+2*sin(30)), y*stem_l*(2*cos(30)), 0]) + hexagon(); + } +} -- 2.43.0