-- Created by: Alexander Kushelev 20040428 -- http://ftp.decsy.ru/nanoworld/ a = #() b = #() numBoardsX = 4 -- numBoards / 8 numBoardsY = 8 -- numBoards / 2 maxX = numBoardsX * 8 + 1 maxY = numBoardsY * 2 + 1 koeff1x = maxX -- x/i, y/j koeff1y = maxY -- x/i, y/j koeff2 = 3.5 -- z2/r (cone angle) face = 1 d=1.1 f9=12.0 faza16=-0.3 faza17=0.123 for i in 1 to maxX do (for j in 1 to maxY do (k = i + maxX * (j - 1) x = cos(f9 * (i+j*faza17)) + d y = sin(f9 * (i+j*faza17)) z = 0 r = (x*x + y*y) --alfa = asin(y/r) alfa2 = j*22.5 x2 = r*cos(alfa2 + i*faza16) y2 = 2*y z2 = r*sin(alfa2 + i*faza16) a[k] = [x2,y2,z2] )) format "%\n" k mask1 = #(0,1,0,1,0,1,0,1) mask2 = #(1,0,1,0,1,0,1,0) ofs = 1 for y in 1 to numBoardsY do ( for x in 1 to numBoardsX do ( k0 = x * 8 - 7 + maxX * (y * 2 - 2) k1 = x * 8 - 7 + maxX * (y * 2 - 1) k2 = x * 8 - 7 + maxX * (y * 2) format "%,%: %,%,%\n" x y k0 k1 k2 i = ofs for m in mask1 do ( if (0 < m) then ( b[face] = [k0 + i, k0 + i + 1, k1 + i] face = face + 1 b[face] = [k0 + i + 1, k1 + i + 1, k1 + i] face = face + 1 ) i = i + 1 if (i > 7) then (i = i - 8) ) i = ofs for m in mask2 do ( if (0 < m) then ( b[face] = [k1 + i, k1 + i + 1, k2 + i] face = face + 1 b[face] = [k1 + i + 1, k2 + i + 1, k2 + i] face = face + 1 ) i = i + 1 if (i > 7) then (i = i - 8) ) ) ofs = ofs + 4 format "ofs: %\n" ofs if ofs > 7 then ofs = ofs - 8 ) m = mesh vertices: a \ faces: b max tool zoomextents all