h3. General Program Information
h3. Input Definitions
h5. Inputs Needed to Call the Channel Function
h5. Inputs Defined within the Channel Function
{float:left|border=2px solid black}
[!lamina label.bmp|width=200px!|AutoCAD Channel Program]
Top View
{float}
{float:left|border=2px solid black}
[!individual lamina.bmp|width=550px!|AutoCAD Channel Program]
Front View
{float}
\\
origin - is a 3*1 matrix with x,y,z positions corresponding to the point where the first lamella will be drawn.
amp - specifies the amplitude of the lamina
w - specifies the width of an individual lamina
l - specifies the length of an individual lamina
t - specifies the thickness of an individual lamina
periods - specifies the period of one curve of the lamina.
angle - specifies the angle of the lamina relative to the floor of the tank.
num{~}baffles~ \- specifies the number baffles in the tank
num{~}bafflescol~ \-
xspace -
yspace -
h3. Technical Program Outline
*lamina{*}{*}{~}0{~}* \- The [zoom{~}winA~|AutoCAD Basics Zoom] function creates a close-up view based on two points to specify the window size.
p1:
* x: origin{~}0~ \- w - zc
* y: origin{~}1~
* z: origin{~}2~
p2:
* x: origin{~}0~ + w + zc
* y: origin{~}1~ + 1 + zc
* z: origin{~}2~
*for loop* \- a for loop is created for the range from i = 0 to i = (periods*4).
*lamina{*}{*}{~}last{~}* \- Every time the program runs through the for loop another sine wave is drawn.
lamina{~}last~:
* x: origin{~}0~ + sin(πi/2)*amp
* y: origin{~}1~ + i*(x/(periods*4)
* z: origin{~}2~
*lamina{*}{*}{~}i+1{~}* \- Uses the 'point' function to turn the 3*1 matrix lamina{~}last~ into a text format that AutoCad can read.
*lamina{*}{*}{~}i+2{~}* \- Uses the 'concat' function create a character string out of a space and the point (origin - zc{~}point~).
*lamina{*}{*}{~}i+3{~}* \- Uses the 'point' function to turn the 3*1 matrix (lamina{~}last~ + zc{~}point~) into a text format that AutoCad can read.
*lamina{*}{*}{~}i+4{~}* \- Enters the command "offset" into AutoCad. The offset function is used to move the selected object a specified distance from its original location.
*lamina{*}{*}{~}i+5{~}* \- The command 'stringit' turns the the variable "t" into a dimensionless number and cuts the number off after 5 decimal points. t represents the distance that the selected object is to be offset.
*lamina{*}{*}{~}i+6{~}* \- Uses the 'point' function to turn the 3*1 matrix 'origin' into a text format that AutoCad can read.
*lamina{*}{*}{~}i+7{~}* \- Uses the 'point' function to turn the following 3*1 matrix into a text format that AutoCad can read.
* x: origin{~}0~ + t
* y: origin{~}1~
* z: origin{~}2~
*line{*}{*}{~}0{~}* \- Uses the 'concat' function to create a character string out of the point 'origin' a space and the point converted in line lamina{~}i+7~.
*line{*}{*}{~}1{~}* \- Uses the 'concat' function to creat a character string out of the point 'lamina{~}last~' a space and the point described below into Autocad.
* x: lamina{~}last0~ + t
* y: lamina{~}last1~
* z: lamina{~}last2~
*lamina{*}{*}{~}i+8{~}* \- Uses the 'concat' function to create a character string out of a space, the AutoCad command "line," a space, the character string created in line{~}0~, and a space. The purpose of the character string is to create a line in AutoCad between the two points specified in line{~}0~.
*lamina{*}{*}{~}i+9{~}* \- Uses the 'concat' function to create a character string out of a the AutoCad command "line," a space, the character string created in line{~}1~ and a space. The purpose of the character string is to create a line in AutoCad between the two points specified in line{~}1~.
*lamina{*}{*}{~}i+10{~}* \- Uses the 'concat' function to create a character string out of the AutoCad command "z e region w," a space, a point described below, a space, the second point described below and a space. The purpose of the character string is to create a region based on the two points specified.
first point:
* x: origin{~}0~ \- amp
* y: origin{~}1~
* z: origin{~}2~
second point:
* x: lamina{~}last0~ + t + amp
* y: lamina{~}last1~
* z: lamina{~}last2~
z: zoom
e: extents
region: creates a region based on two specified points.
w: specifies corners for the window in which the region is to be created.
*lamina{*}{*}{~}i+11{~}* \- Uses the concat function to create a character string out of the AutoCad command [extrude|AutoCAD Basics Extrude], a space, the point 'origin,' a space, a space, the variable 'l,' a space and the "0."
*lamina{*}{*}{~}i+12{~}* \- Uses the concat function to create a character string out of the AutoCad command [rotate3d|AutoCAD Basics Rotate], a space, the point 'origin,' a space, a space, the command "y," a space and a num2str (-(90-angle/deg)) if the angle is not 90 degrees.
*lamina{*}{*}{~}i+13{~}* \- Uses the concat functino to create a character string out of the AutoCad command [array|AutoCAD Basics Array], a space, the point 'origin,' a space, a space, the command "R," a space, num2str(num{~}bafflecols~, a space,num2str{~}baffles~ and a space.
*lamina{*}{*}{~}i+14{~}* \- Together lamina{~}i+14~ and lamina{~}i+15~ for an if statement. Lamina{~}i+14~ uses the concat function to create a character string that enters the dimensionless number "yspace" if num{~}bafflecols~ is less that 1.
*lamina{*}{*}{~}i+15{~}* \- Enters "" into the command line if the condition in lamina{~}i+14~ is not forfilled. |