Loop function

image_pdfimage_print

The loop function consists of the following syntax:
loop (id_start, i, i_start, i_stop, i_step, x_expr, y_expr, z_expr)
It is used in generating the point coordinates instead of the typical id x y z command.
In the bracket we need to consecutively define: the initial poit index, the loop variable, its initial and terminal value, the iteration step, the x-axis expression, the y-axis expression and the z-axis expression.
We will use the loop function to outline a reflexing pannel. Given this purpose, we will generate a new model geometry file and then define the ABS, CORNERS and PLANES sections.
This situation is depicted in the following picture:
ekran

Consecutive points defining the pannel intersection (in red) are located every 9 degrees in a circle of “blue” radius. Green marks the hights needed on the z-axis, the coordinates of the y-axis can be obtained using the Pitagorean Theorem. In the beginning we need to generate two curves such that the x-coordinate varies. We use the loop command syntax and we enter the following into the CORNERS section:
loop(1,i,0,45,9,-4,2*cos(i),2*sin(i))
loop(7,i,0,45,9,4,2*cos(i),2*sin(i)

A loop-like function will help us consecutively create the areas we need:

[*5 1 panel // 1 2 8 7 / panel]

The above means that the CATT-Acoustic will produce 5 areas – one of them, indexed as 1, bases on points 1 2 8 7. For the following planes the number of each point increases by 1. The syntax (the double ‘/’ sign) that is implemented is an abbreviation. In its original form, the line looks like below:
[*5 1 panel /1 1 1 1/ 1 2 8 7 / panel]

Finally, we still need a material of low absorption coefficient to cover the area:

ABS panel <15 0 3 4 5 14 >

Eventually our PLANE.GEO file looks like:

ABS panel <15 0 3 4 5 14 >

CORNERS

loop(1,kat,0,45,9,-4,2*cos(kat)3*sin(kat))
loop(7,kat,0,45,9,4,2*cos(kat),3*sin(kat))

PLANES

[*5 1 panel // 1 2 8 7 / panel]

And its model visualisation:

panel