global vert_array = #()
global face_array = #()
global face_theta = #()
struct_length = openFile "struct_length.txt"
struct_width = openFile "struct_width.txt"
struct_theta = openFile "struct_theta.txt"
--in_file = getOpenFileName caption:"选择结构参数文件" types:"Text Files (*.txt)|*.txt|All Files (*.*)|*.*|" filename:""
--if in_file != undefined then
(
--num_verts = readValue in_file
--print(num_verts)
--num_faces = readValue in_file
--vert_array.count = num_verts
--print(vert_array.count)
--face_array.count = num_faces
for v = 1 to 10000 do vert_array[v] = (readValue struct_length)
for f = 1 to 10000 do face_array[f] = (readValue struct_width)
for g = 1 to 10000 do face_theta[g] = (readValue struct_theta)
close struct_length
close struct_width
close struct_theta
--new_mesh = mesh vertices:vert_array faces:face_array
)
--prams = filterString vert_array " "
--print(vert_array)
--print(face_array)
mybox = box length:20 width:20 height:10
--mybox = cylinder radius:20 height:10
mybox.name = "BlueBox"
mybox.wirecolor = (color 220 220 220)
--mybox.radius = 1000 -- 2 times the original 20 units
mybox.width = 4500 -- 3 times the original 20 units
mybox.length = 4500
mybox.pos = [mybox.width/2,mybox.length/2,0]
global x = 1
global m = 1
for i = 1 to 100 do
(
n = 1
for j = 1 to 100 do
(
--r = sqrt(i*i + j*j)
--if r <= 50
--print(vert_array[i])
--print(face_array[i])
mybox1 = box length:20 width:20 height:4
mybox1.name = "Box"
mybox1.height = 100
mybox1.length = vert_array[x]/10
mybox1.width = face_array[x]/10
rot_box = eulerangles 0 0 face_theta[x]
rotate mybox1 rot_box
mybox1.wirecolor = (color 0 255 255)
mybox1.pos = [m*45,n*45,10]
x = x + 1
n = n + 1
)
m = m + 1
)