From f43e11317255f663efef52f064c0a91fd7ea8c1b Mon Sep 17 00:00:00 2001 From: lumbric Date: Mon, 1 Feb 2016 00:10:04 +0100 Subject: [PATCH] improve imprecise constant for hexagon shape 1.75 is a very bad aproximation for 1.732050807568877 = cos(30) * 2. I don't think we need to optimize here and hardcode the constant - better use a readable calculation. --- shapes.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shapes.scad b/shapes.scad index 84b1810c..4c06b4f0 100644 --- a/shapes.scad +++ b/shapes.scad @@ -82,7 +82,7 @@ module ovalTube(height, rx, ry, wall, center = false) { // size is the XY plane size, height in Z module hexagon(size, height) { - boxWidth = size/1.75; + boxWidth = (size / 2.) / cos(30.); for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true); }