[OpenSCAD] Missing operators
Andy Kirby
andy at kirbyand.co.uk
Wed Sep 15 04:40:17 CEST 2010
Ok where do the 5 and 6 come from.
And what when I want to change the tile size from say 3 hex cells per side to 11 hex cells per side??
Dont get me wrong a solution would be great.
I take it that you are using square instead of a hex cell. I used circle drawn with 6 segments.
Btw you might need to re-synchronise terms. Your definition of easy is questionable.
--
Like a rolling stone
----- Original message -----
> // Here's how you make an array of hex objects
> // I'm too lazy to do the trig to get them touching perfectly, but this
> is close enough
> // to show it is possible and easy
>
> rad = 10;
> seg = sin(60)*rad;
> xstep = rad*2;
> ystep = seg + rad; // this is almost right
>
> for (y=[0:5]){
> for (x=[0:5]){
> translate([x*xstep+y%2*xstep/2,y*ystep,0])
> for (i= [0:6]){
> rotate([0,0,i*60]) translate([rad,0,0]) cube([1,seg,1],center=true);
> }
> }
> }
More information about the OpenSCAD
mailing list