Update Cubic_Array() to remove 'center' from children(), remove extra indent tabs, and shorten for loop.

This commit is contained in:
Doug Hawkins 2020-03-28 23:13:00 -06:00
parent 488b1ee54e
commit bfa9799a17

View file

@ -94,11 +94,9 @@ module Cubic_and_Radial_Array_Test()
module Cubic_Array(sx,sy,sz,nx,ny,nz,center) { module Cubic_Array(sx,sy,sz,nx,ny,nz,center) {
offset = center ? [-(((nx+1)*sx)/2),-(((ny+1)*sy)/2),-(((nz+1)*sz)/2)] : [0,0,0]; offset = center ? [-(((nx+1)*sx)/2),-(((ny+1)*sy)/2),-(((nz+1)*sz)/2)] : [0,0,0];
translate(offset) translate(offset)
for(x=[1:nx]) for(x=[1:nx], y=[1:ny], z=[1:nz])
for(y=[1:ny]) translate([x*sx,y*sy,z*sz])
for(z=[1:nz]) children();
translate([x*sx,y*sy,z*sz])
children([0:$children-1],center);
} }
// //