APT or Automatically Programmed Tool is a high-level computer programming language used to generate
instructions for numerically controlled machine tools. Douglas T. Ross is considered by many to be the
father of APT. APT is a language and system that makes numerically controlled manufacturing possible.
This
early language was used widely into the 1970s and is still a standard internationally.
APT is used to program CNC machine tools to create complex parts using a cutting tool moving in space. It
is used to calculate a point-to-point path that a tool must follow to generate a desired form. APT is a CAM
system based on a special-purpose language. It was created and refined during the late 1950s and early
1960s to simplify the task of calculating geometry points that a tool must traverse in space to cut the
increasingly complex parts required in the aerospace industry. It was a direct result of the new CNC
technology becoming available at that time, and the daunting task that a machinist or engineer faced
calculating the movements of the CNC for the complex parts for which it was capable. APT was created
before graphical interfaces were available, and so it relies on text to specify the geometry and toolpaths
needed to machine a part.
APT shares many similarities to computer programming languages like Fortran. A general-purpose
computer
language takes source text and converts the statements to instructions that can operate the internals of a
computer. APT converts source statements into programs for numerically- or computer-controlled machine
tools. Typically, this is a text file that contains CNC-vendor dependent commands to generate tool motions
and machine states. Most commonly, this is some form of G-code.
Chapter 1. Language and Syntax
The input to the APT processor is a part program that is a collection of APT statements set forth in an
ordered fashion. APT statements are used for the following purposes:
To define a scalar or geometric quantity.
To describe a cutter path.
To describe auxiliary machine tool functions.
To define machining parameters.
These statements are typed into an editor and saved as a plain-text ASCII file, which is the input to the APT
processor. Columns 1 through 72, inclusively, contain information pertinent to the part programming text,
while columns 73 to 80 are reserved for sequence and/or identification purposes. Blank columns are ignored
by the processor, so blanks can be used to make the text more readable.
1.1. Elements of the APT Language
Each statement is made up of one or more of the following elements (expressed according to set rules of
syntax):
Punctuation
Vocabulary Words
Numbers
Symbols, including Labels
1.1.1. Punctuation
Punctuation for the APT language includes the comma, slash, asterisk, double asterisk, plus, minus, single
dollar, double dollar, equal, period and parentheses [, / * ** + - $ $$ = . ( )]. This punctuation is used to
separate individual words and elements of the source statements used in the APT language and to indicate
arithmetic operations. The APT processor will automatically accept either BCD or EBCDIC characters.
(ASCII for apt360)
The Comma (,)
Used to separate elements of a statement where no other punctuation is appropriate.
MACHIN/ BENDIX, 2, CURCUL
TLLFT, GOLFT/ L1, TO, l2
The Slash (/)
Used either to separate major elements of a statement or as the arithmetic operator, divide, in a
compute statement.
GOLFT/ L1, PAST, C3
A = B / D
The Asterisk (*)
Used as the arithmetic operator multiply.
A = B * C
The Double Asterisk (**)
Used as the arithmetic operator exponentiation. The example below means A=BC.
A = B ** C
The Plus Sign (+)
Used either to indicate arithmetic addition or to specify a signed number. In specifying signed
numbers, plus is assumed if no sign appears.
A = B + C
D = E + F * (+2) * G
P = POINT/ +1, +2, +3
The Minus Sign (-)
Used either to indicate arithmetic subtraction or to specify a signed number.
A = B - C
D = E + F * (-2) * G
P = POINT/ -1, -2, -3
The Single Dollar Sign ($)
Used to indicate the end of a line and to indicate to the processor that the APT statement is continued
on the next line. Any information appearing to the right of the dollar sign is treated as commentary;
that is, the full line is printed out as input translation time, but the information to the right of the
dollar sign is ignored by the rest of the processor.
P1 = PLANE/ PARLEL, PL1, $ clearance
XLARGE, 6.9
A = B * C $ continued on the next line
- D + G
The Double Dollar Sign ($$)
This sign is optional; it's use indicates the end of a part program statement before the end of the 72
column data field. The information to the right of the double dollar sign is to be treated as
commentary. Absence of either a single or double dollar sign causes a part program statement to be
discontinued at the end of the 72-column data field.
CUTTER/ 1, .25 $$ Filleted end mill
The Equal Sign (=)
This sign is used as follows:
$$ To assign a name to a geometric surface or macro.
$$ (This name could be used as a variable later in the source program.)
PT1 = POINT/ X, Y, Z
MAC1 = MACRO/ A, B, C
$$ To assign a value to a scalar variable.
A = B + C
$$ To assign a variable to a macro variable.
CALL/ MAC1, ALPHA1 = 4., ALPHA2 = B
MAC1 = MACRO/ A1 = B, C, D
The Period (Decimal Point) (.)
Used to separate the integral from the fractional part of a number.
4.62
2.
1.23
.005
The Left and Right Parentheses [()]
Used as follows:
$$ To enclose the arguments of an arithmetic function
A = COSF(B)
$$ To enclose subscripts of a variable
A(J) = B(2) + G
$$ To enclose the arithmetic argument of the arithmetic IF statement
IF(A - B * C) 12, 13, 14
$$ To enclose nested definitions
GO/ (L1 = LINE/ X1, Y1, X2, Y2), L3
$$ To enclose any parenthetical expression or related list of objects
A = B * (-3) + c
$$ Right parenthesis -- to separate statement label from the statement
A4) K = 1
1.1.2. Vocabulary Words
The APT processor recognizes a set of vocabulary words that are assigned to the following classes of
activity:
Types of geometric quantities and surfaces; POINT, PLANE, SPHERE, etc.
Computing operators and functions; IF, SINF, COSF, etc.
Postprocessor instructions; STOP, END, SPINDL, etc.
Modifiers, designators and selectors; XLARGE, POSY, LEFT, etc.
Action verbs; GO, GODLTA, etc.
Modes of operation; NOPOST, CLPRNT, PTONLY, etc.
1.1.3. Numbers
All numbers used in a part program are treated by the APT processor as floating-point quantities. Integers
are not treated as a separate class of numbers. The number one (1) may be expressed in the following ways:
1
1.
1.0
.01e2
10.0e-1
1000.e-3
.001e+3
+1
+10.e-1
When writing a number in the exponential format (using an e followed by an exponent), a decimal point
must be given in the number preceding the e. If no decimal point appears, the presence of the alpha character
e will cause the number to be interpreted as a variable symbol.
The maximum number of significant digits allowed is 16, with a range of about 10-75 to 1075.
Whenever a number is used as an index of a subscript only, its integral part is used; for example, if I = 2.4,
the index or subscript value of I is 2.
1.1.4. Symbols
A symbol is used to define an entity in a part program statement that is to be referenced in later statements.
For example, the statement
CIRC1 = CIRCLE/ 1, 2, 3, 8
defines a circle whose center is at X = 1, Y = 2 and Z = 3, and whose radius is 8. Later part program
statements can now refer to this circle by referencing the symbol CIRC1.
A symbol is made up of from one to six alphanumeric characters, at least one of which must be a letter.
(Punctuation characters cannot be used in a variable symbol.) A symbol, sometimes noted as "variable
symbol", cannot be the same as a vocabulary word. Further, a symbol must be defined before a reference to
that symbol in another part program statement. Because of the dynamic environment of the APT language,
new vocabulary words are frequently required. The use of at least one numeric character in a symbol is
recommended to protect against subsequent changes.
1.1.5. Statement Labels
A statement may have a label (or "ID") so that other part program statements can reference it. A statement
label must be from on the six alphanumeric characters (all of which can be numeric) and must occur to the
extreme left of the statement. A statement label must be terminated by a right parentheses.
IF (I + 2) JOE, 123, 41E
JOE) I = 1
123) J = 3
41E) K = 1
1.1.6. Statement Size Limitation
The maximum number of elements that may be included in a single APT statement is 600. For example, this
statement:
ID6) CIRC1 = CIRCLE/ 1, 2, 3, 8
contains the 13 elements listed in Table 1.1.
Table 1.1. Statement Elements
Count Symbol Type
Count Symbol Type
ID6
Statement Label
Punctuation
Punctuation
Number
CIRC1
Symbol
10
Punctuation
Punctuation
11
Number
CIRCLE Vocabulary Word 12
Punctuation
Punctuation
Number
Number
13
Chapter 2. Computing and Subscripted Variables
The ability to perform a variety of computing operations and the concept of subscripted variables have been
included to provide additional capability in the APT language.
2.1. Computing in the APT Language
The computing feature allows a given quantity to be expressed as the result of one or more arithmetic
operations. For example, the statement:
A = 2 + 6 * SQRTF(4)
specifies that the symbol A is to be assigned the value 14 (the result of multiplying 6 times the square root of
4 and adding 2). A computing statement may be made up of some combination of the following:
Scalars
Arithmetic Operators
Arithmetic Expression
Arithmetic Functions
2.1.1. Scalars
Scalars are one-dimensional quantities that can be operated on as is or combined to define a geometric
quantity. Scalars, sometimes noted as "scalar variables", can be multiply-defined, that is, the value of the
scalar can be reassigned by a new computing statement.
2.1.2. Arithmetic Operators
Table 2.1. Operators
Operator Description
+
Addition
Subtraction
Multiplication
Division
**
Exponentiation
2.1.3. Arithmetic Expressions
Scalar symbols, numbers and arithmetic operators may be combined to form an arithmetic expression.
2*A+B
3. * A + B/ (4. * C)
A + B ** 2 + 3 * C
In the APT language, an arithmetic expression may replace a scalar or a subscript. A scalar symbol or a
variable my be assigned a value by an arithmetic expression.
F = 2 * A + B
C = 3 * A + B / (4. * C)
H = 3.14159
Parentheses may be used in arithmetic expressions to indicate the order of the operations. Within
parentheses, or where parentheses are omitted, the order of operations is as follows:
Table 2.2. Operator Precedence
Operator
Precedence
Evaluation of Functions 1 (highest)
**
*/
+-
4 (lowest)
Among operations of the same priority, processing is done from left to right.
For example the following expressions are equivalent:
F = A * B + C / D * A ** 2
F = (A * B) + (C / D) * (A ** 2)
An arithmetic expression enclosed in parentheses can be substituted for a scalar value (where a scalar value
is appropriate) in and APT statement except RESERV/.
P1 = POINT/ (A + 2. * B), Y, (-3 + E)
However, an arithmetic expression can never appear to the left of an equal sign, except when used to denote
a subscript value.
Legal
Not Legal
A(I + 2) = D * C I + 2 = D * C
D = A(I + K + 1) CALL/ MAC1, B + C = A, D = E / 2, F = G + H
CALL/ MAC2, B = A(I + K * 2)
2.1.4. Arithmetic Functions
The following functions are available in the APT language:
Table 2.3. Arithmetic Functions
Name
Function
Example Usage
ABSF(x)
Absolute Value of x
X = ABSF(-22.5)
ATANF(x)
Arctangent of x
X = ATANF(.577350)
EXPF(x)
ex
X = EXPF(2)
SINF(x)
Sine of x
X = SINF(45)
COSF(x)
Cosine of x
X = COSF(45)
Name
Function
Example Usage
DOTF(svector, svector) Dot Product of Vectors
DP = DOTF(V1, V2)
LNTHF(svector)
Vector Magnitude
LEN = LNTHF(V)
LOGF(x)
logex
LOG = LOGF(2)
SQRTF(x)
Square Root of x
SQR = SQRTF(4)
Angle between the positive X axis
ANGLF(scircle, spoint) and a line joining the center of
a circle and a point.
A = ANGLF(C1, (POINT/ 2, 3))
NUMF(SPAT)
The number of points in a pattern.
N = NUMF(PAT1)
DISTF(splane, splane)
or
DISTF(sline, sline)
Distance between parallel lines
or parallel planes. (Mixing
surfaces types is not allowed.)
D = DISTF(L1, L2)
LOG10F(x)
Log10x
LG = LOG10F(2)
TANF(x)
Tangent of x
T = TANF(30.)
ATAN2F(x, y)
Arctangent of x/y
A = ATAN2F(2, .5)
Note
The arguments to SINF, COSF and TANF are in degrees. ANGLF,
ATANF and ATANF2F return degrees.
The output of each of these functions is single-valued; hence, these functions can be used to define an
arithmetic expression.
R = A * SQRTF(C ** 2 + D ** 2) / E
2.2. Subscripted Variables in the APT Language
The APT processor provides the capability of defining an array of geometric quantities or scalars that may
be referenced by one symbolic name. The individual quantities may be defined or referenced by means of a
subscript or an index.
A(1) = 2
A(2) = 5
The scalar quantity 2 is stored in the first storage location for A, and the scalar quantity 5 is stored in the
second storage location of A.
2.2.1. The Reserve (RESERV) Statement
When a symbol is used to define an array of quantities, the RESERV statement must be used to define the
extent of the array before any referencing to the subscripted symbol in the part program. For example:
RESERV/ A, 50
$$ or
RESERV/ 50, A
indicates that 50 storage locations are to be set aside for the symbol A. The first pair of entries in the
RESERV statement defines the order for subsequent pairs (symbol, range or range, symbol). The array(s)
defined in a RESERV statement may be used to store either scalars or surfaces. Statement ID's and MACRO
names cannot be subscripted. The first usage of a subscripted variable will determine whether surfaces (or
scalars) are to be allowed for that array. For example:
RESERV/ L1, 10, C1, 20, P1, 5, Q, 20
L1(2) = LINE/ 2.0, 1.0, 2.0, 5.0
C1(5) = CIRCLE/ 0, 0, 0, 0
P1(1) = POINT/ 0, 1, 0
Q(1) = 6.0 * 3 ** 2
would allow ten surfaces to be defined using the symbol L1(1)-L1(10), 20 surfaces to be defined using the
symbols C1(1)-C1(20), etc. Finally, 20 scalars could be defined using the symbols Q(1)-Q(20).
The extent of the array must be specified by a scalar number; a variable symbol cannot be used in place of
the required value.
$$ OK
RESERV/ A, 50
$$ Not allowed
B = 50
RESERV/ A, B
The value of the index (subscript) in a later part program statement cannot extend beyond the range assigned
to the symbol by the RESERV statement. The above example indicates that the allowable range for the
subscript is between 1 and 50, inclusive. Thus, the following examples would result in an error condition.
A(0) = 6
A(61) = 3.56
A(-1) = 10
The value of the subscript may be expressed as a number (as shown in the examples), as a symbolic scalar,
or as a computed expression. Although the subscript value may -- as a result, for instance, of having been
computed -- have a fractional part (that is, not be a perfect integer), it is truncated to an integer value when
used for subscripting purposes.
2.2.2. Inclusive Subscripts
Several input formats used in APT part programming call for writing strings (sometimes long) of data items
of the same class, such as all point definitions. Sometimes these data items have been calculated earlier in
the part program and can be defined as elements of a subscripted array. In place of writing a string of data of
the form:
A(1), A(2), A(3), A(4), ... A(n)
a modification of the subscript format permits the writing of a single item:
A(1, THRU, n)
which is exactly equivalent to the list of elements of the subscripted array A shown above.
The general form of this "inclusive subscript" notation is:
where a, b and c are scalar values expressed in any of the forms available in the APT language. This notation
is equivalent to a list of consecutive individual elements of the subscript array for the symbol NAME,
between subscript value a and subscript value b at interval of c. The value a specifies the lowest subscript of
the implied list, and be the highest value. These are not necessarily the first and last values of the entire
array; they must, of course, be within the range of the array.
the implied list is from a to b if the incremental value c is positive, and from be to a if the increment is
negative. A negative c may be specified by either a negative sign for the increment with the INCR modifier,
or a positive c with the DECR modifier. A negative c with DECR is equivalent to a double negative, the
effect being positive. The incremental modifier and value need not be given; if omitted, a positive increment
of 1 is assumed. When using incremental values other than 1, the final subscript of the implied list will be
the last subscript value that does not exceed the specified limit and need not be the same as the limiting
value. For Example:
A(1, THRU, 8, INCR, 3)
implies the list:
A(1), A(4), A(7)
When the value of the last subscript of the array is desired for b in the inclusive subscript notation, the
modifier ALL may be used, in place of a scalar following THRU, to indicate it. When the inclusive subscript
is to represent a list with the subscript limits of 1 and the highest value of the array, regardless of the
increment value, of direction, the notation "a, THRU, b" in the subscript nest may be replaced by the single
modifier ALL; for example:
A(ALL) or
A(ALL, DECR, 2)
The first element of the examples implies a list of all of the elements of the array A, in the order:
A(1), A(2), A(3), ... A(n)
The second example implies a list of every other element of the array A, starting with the last one, in the
order:
A(n), A(n-2), A(n-4), ...
If the low end of the range is to be 1, the value of a may be omitted. For example:
A(THRU, ALL)
is equivalent to:
A(1, THRU, ALL)
Examples of the use of inclusive subscripts:
L1 = LINE/ A(ALL)
where A is a scalar array with four or six elements.
L1 = LINE/ B(7, THRU, 10)
where B is a scalar array with ten or more elements.
L1 = LINE/ B(7, THRU, ALL)
where B is a scalar array with exactly ten or exactly twelve elements.
T1 = TABCYL/ NOZ, SPLINE, P(ALL)
where P is an array of three of more points.
In the general form:
NAME(a, THRU, b)
a should be the lower value of the range, and b should be the upper value of the range. If a=b,
P(5, THRU, 3)
has an implied positive direction and an increment value of 1. It should therefore define the low end of the
array P(5) and continue defining with a positive increment of 1 (P(6), P(7), ...) until the high end is reached
or passed. In this case, the high end, 3, is passed immediately, so P(6), etc., are not defined. However, the
one value P(5) is defined.
The converse example:
P(5, THRU, 3, DECR, 1)
is to start at the high end P(3) and decrease by 1 until the low end P(5) is reached. In this case, only P(3) will
be defined.
Inclusive subscript notation may be used in any geometric definition statement (with the one exception
noted in Section 3.22.2) and the PRINT or PUNCH statements. These are the only types of statements in
which the inclusive subscript is allowed.
Chapter 3. Geometric Statements in APT
The APT language permits the definition of a variety of geometric entities, with the added capability that
each of the allowable types can be defined in several ways. For instance, a point can be defined simply by
listing the x, y and z coordinates, or it can be defined as the intersection of two lines, or as one of the two
possible points of intersection of a line and a circle, etc. The geometric types allowed, together with the APT
vocabulary word used to indicate each, are listed below.
Table 3.1. Geometry Type and Name
Geometric Type
Vocabulary Word
Point
POINT
Line
LINE
Plane
PLANE
Circle
CIRCLE
Cylinder
CYLNDR
Ellipse
ELLIPS
Hyperbola
HYPERB
Cone
CONE
General Conic
GCONIC
Loft Conic
LCONIC
Vector
VECTOR
Matrix
MATRIX
Sphere
SPHERE
Quadric
QADRIC
Tabulated Cylinder TABCYL
Polyconic Surface
POLCON
Ruled Surface
RLDSRF
3.1. Format
The general format of a surface definition is:
SNAME = SURFACE TYPE/ method of definition
where SNAME is a symbol, the SURFACE TYPE is one of the vocabulary words defining the surfaces
listed above and the method of definition is as defined in the following sections. A variable symbol may be
redefined, and then only as a surface of the same type, if one of two techniques involving the word CANON
is used.
CANON as a modifier
Any geometric definitions type involving the word CANON will allow the symbol to be redefined
(see Section 3.22).
These statements are provided to set a module condition to allow redefinition of surface variables.
The specification of CANON/ ON will allow subsequent surface variables to be redefined with any
geometric definition. The specification of CANON/ OFF, which is the default mode, will require the
CANON modifier for redefinition.
3.1.1. Modifiers
Some of the methods of definition require a modifier (or selector). This is necessary when there is more than
one solution as represented by the definitions itself. For example:
SPT = POINT/ XSMALL, INTOF, sline, scircle (see Figure 3.1)
would mean "define SPT as the point that has the smallest X coordinate value of the two possibilities when
the line sline is intersected with the circle scircle".
Figure 3.1. Geometry Modifier
3.1.2. Canonical Form
A particular geometric type can be defined in many ways. However, it would be highly inefficient to pass all
of this information along from section to section of the APT processor. Therefore, the APT processor
reduces to a common format each of the possible definitions for a particular geometric type. This format is
called the canonical form and is usually the most basic analytical expression for the surface type in question;
(Chapter 16 contains a table of the canonical forms for all of the allowable surface types.) For example, the
statement given in Section 3.1.1 would be evaluated, and only the x, y and z coordinates for the point would
be stored for later use.
3.2. The ZSURF Definition
The ZSURF definition supplies a means of defining an implicit Z coordinate for a point whenever it is
required for use in a geometric definition or a motion command. The general form of this statement is:
When only the X and Y coordinates for a point have been specified in a part program statement, the APT
processor projects the point on the ZSURF plane to calculate the implicit Z value. (if ZSURF is not
specified, the XY plane is assumed.) For example:
ZSURF/ SPLANE
SPOINT = POINT/ X, Y
The Z value is supplied by projecting the point (X, Y) in a direction parallel to the Z axis onto the plane
SPLANE.
3.3. The Point (POINT) Definitions
A point is a unique position in space and can be defined in several ways.
3.3.1. Rectangular Coordinates
SPT = POINT/ xcoord, ycoord, zcoord
SPT = POINT/ xcoord, ycoord
Figure 3.2. POINT by Rectangular Coordinates
PT1
PT2
PT3
PT4
=
=
=
=
POINT/
POINT/
POINT/
POINT/
2, 4, 3
2, 4, 0
-5, -2, 3
-5, -2, 0
3.3.2. Intersection of Two Lines
SPT = POINT/ INTOF, sline, sline
Figure 3.3. POINT by Line, Line Intersection
PT1
PT2
PT3
PT4
PT5
=
=
=
=
=
POINT/
POINT/
POINT/
POINT/
POINT/
INTOF,
INTOF,
INTOF,
INTOF,
INTOF,
LN1,
LN2,
LN1,
LN2,
LN2,
LN4
LN1
LN3
LN3
LN4
3.3.3. Intersection of a Line and a Circle
Figure 3.4. POINT by Line, Circle Intersection
P1
P2
P3
P4
P5
P6
P7
P8
=
=
=
=
=
=
=
=
POINT/
POINT/
POINT/
POINT/
POINT/
POINT/
POINT/
POINT/
YSMALL,
YLARGE,
YSMALL,
YLARGE,
XLARGE,
XSMALL,
XLARGE,
XSMALL,
INTOF,
INTOF,
INTOF,
INTOF,
INTOF,
INTOF,
INTOF,
INTOF,
L1,
L1,
L1,
L1,
L2,
L2,
L2,
L2,
C3
C3
C1
C1
C1
C1
C2
C2
3.3.4. Intersection of Two Circles
Figure 3.5. POINT by Circle, Circle Intersection
P1
P2
P3
P4
=
=
=
=
POINT/
POINT/
POINT/
POINT/
YLARGE,
YSMALL,
XSMALL,
XLARGE,
INTOF,
INTOF,
INTOF,
INTOF,
C1,
C1,
C3,
C3,
C2
C2
C4
C4
3.3.5. On a Circle at an Angle with the X Axis
SPT = POINT/ scircle, ATANGL, degrees
The point lies on the circle so that the line from the point to the center of the circle makes a stated angle with
the X axis.
Figure 3.6. POINT by Circle, Angle
P1
P2
P3
$$
P1
P2
P3
= POINT/
= POINT/
= POINT/
or
= POINT/
= POINT/
= POINT/
C1, ATANGL, 45.0
C1, ATANGL, 90
C1, ATANGL, 225
C1, ATANGL, -315
C1, ATANGL, -270
C1, ATANGL, -135
Note
The angle is expressed in degrees and decimal fractions of a degree and is measured from the positive X
axis. A positive angle is measured counter clockwise.
3.3.6. Center of a Circle
SPT = POINT/ CENTER, scircle
Figure 3.7. POINT by Circle Center
PT1 = POINT/ CENTER, C1
3.3.7. Intersection of a Line and a Conic
Figure 3.8. POINT by Line, Conic Intersection
P1 = POINT/ XLARGE, INTOF, L1, C1
P2 = POINT/ XSMALL, INTOF, L1, C1
3.3.8. Intersection of Three Planes
SPT = POINT/ INTOF, splane, splane, splane
Figure 3.9. POINT by 3 Plane Intersection
P1 = POINT/ INTOF, PLANE1, PLANE2, PLANE3
3.3.9. Polar Coordinates
Figure 3.10. POINT by Polar Coordinates
PT1 = POINT/ RTHETA, XYPLAN, 5.66, 45
PT2 = POINT/ THETAR, XYPLAN, 150.0, 6
3.3.10. Intersection of a Line and a Tabulated Cylinder
SPT = POINT/ INTOF, sline, STABCYL, spoint
It is necessary to include a point on the TABCYL near the desired intersection to differentiate between the
several possible intersections. Further, since the APT processor uses this point as a basis for locating the
proper interval, a careful selection of this point can reduce processing time. The optimum point specification
is the last point of the TABCYL definition before the intersection point (that is, if the intersection point is
between the ninth and tenth points of the original TABCYL definition, using the ninth point as the "near
point" results in the most efficient processing). This is true for all the definitions involving a TABCYL
where a "near point" is required.
Figure 3.11. POINT by Line, Tabulated Cylinder Intersection
PNT = POINT/ INTOF, LN1, TBCYL1, PNTA
3.3.11. The Location in a PATERN
SPT = POINT/ spattern, n
Where n specifies the nth point in the definition order of the pattern.
3.4. The Line (LINE) Definitions
A line is the intersection of two planes and is treated by the APT processor as a vertical plane surface (that
is, perpendicular to the XY plane).
3.4.1. Through Two Points
Note
The two points must not be coincidental
Figure 3.12. LINE by Two Points
LN1 =
LN2 =
$$ or
PT1 =
PT2 =
PT3 =
PT4 =
LN1 =
LN2 =
LINE/ -3, -3.5, 4, 3.5
LINE/ 7, 2, 3, 1
POINT/ -3, -3.5
POINT/ 4, 3.5
POINT/ 7, 2
POINT/ 3, 1
LINE/ PT1, PT2
LINE/ PT3, PT4
3.4.2. Through a Point and Tangent to a Circle
Note
The modifiers RIGHT and LEFT are applied looking from the point toward the circle.
Figure 3.13. LINE by Point and Tangent Circle
LN1 = LINE/ PT1, LEFT, TANTO, C1
LN2 = LINE/ PT1, RIGHT, TANTO, C1
LN3 = LINE/ PT2, RIGHT, TANTO, C1
3.4.3. Tangent to Two Circles
Note
The modifiers RIGHT and LEFT are applied looking from the first referenced circle toward the second.
Figure 3.14. LINE by Tangent Circles
L1
L2
L3
L4
=
=
=
=
LINE/
LINE/
LINE/
LINE/
RIGHT, TANTO, C1, RIGHT, TANTO, C2
LEFT, TANTO, C1, LEFT, TANTO, C2
RIGHT, TANTO, C1, LEFT, TANTO, C2
LEFT, TANTO, C1, RIGHT, TANTO, C2
3.4.4. Through a Point and at an Angle with the X or Y Axis
Figure 3.15. LINE by Point Angle
LN1 = LINE/ PT1, ATANGL, 45, XAXIS
LN2 = LINE/ PT2, ATANGL, 22.5
LN3 = LINE/ PT3, ATANGL, 60, YAXIS
3.4.5. Through a Point and Having a Slope with Respect to the X or Y Axis
The three lines illustrated in Figure 3.15 could be defined as follows:
LN1 = LINE/ PT1, SLOPE, 1, XAXIS
LN2 = LINE/ PT2, SLOPE, .4142
LN3 = LINE/ PT3, SLOPE, 1.7321, YAXIS
3.4.6. The X or Y Axis
3.4.7. Through a Point and Having a Slope with Respect to Another Line
SLN = LINE/ spoint, SLOPE, slope, sline
The lines L1 and L3 illustrated in Figure 3.16 could be defined as follows:
LN1 = LINE/ PT2, SLOPE, .26759, L2
LN3 = LINE/ PT3, SLOPE, -1, L1
3.4.8. Through a Point at an Angle with a Line
SLN = LINE/ spoint, ATANGL, degrees, sline
Note
A positive angle is measured counter clockwise from the given line. A negative angle is measured
clockwise.
Figure 3.16. LINE by Point, Angle to Line
L1 = LINE/ PT2, ATANGL, 15, L2
L3 = LINE/ PT3, ATANGL, 135, L1
3.4.9. Through a Point and Parallel to a Line
SLN = LINE/ spoint, PARLEL, sline
Figure 3.17. LINE by Point, Parallel Line
L1 = LINE/ PT1, PARLEL, LX
3.4.10. Through a Point and Perpendicular to a Line
SLN = LINE/ spoint, PERPTO, sline
Figure 3.18. LINE by Point, Perpendicular Line
LN1 = LINE/ PT1, PERPTO, LNX
3.4.11. Parallel to a Line at a Distance
Note
The modifiers denote the direction in which the line is offset
Figure 3.19. LINE by Distance from Parallel Line
L1 = LINE/ PARLEL, LX, XSMALL, 2
$$ or
L1 = LINE/ PARLEL, LX, YLARGE, 2.0
L2 = LINE/ PARLEL, LX, XLARGE, 2
$$ or
L2 = LINE/ PARLEL, LX, YSMALL, 2.0
3.4.12. Intersection of Two Planes
SLN = LINE/ INTOF, splane, splane
Note
The planes cannot be coplanar, parallel to one another, or both vertical (perpendicular to the XY plane).
Figure 3.20. LINE by Plane Intersection
L1 = LINE/ INTOF, PLN1, PLN2
3.4.13. Slope Intercept Form
Figure 3.21. LINE by Slope Intercept Form
L1
L2
$$
L1
L2
$$
L1
L2
$$
L1
L2
= LINE/
= LINE/
or
= LINE/
= LINE/
or
= LINE/
= LINE/
or
= LINE/
= LINE/
SLOPE, .40403, INTERC, 3
SLOPE, -.40403, INTERC, 3
SLOPE, .40403, INTERC, YAXIS, 3
SLOPE, -.40403, INTERC, XAXIS, 7.425
ATANGL, 22, INTERC, 3
ATANGL, -22, INTERC, 3
ATANGL, 22, INTERC, YAXIS, 3
ATANGL, -22, INTERC, XAXIS, 7.425
3.4.14. Angle and Axis Intercept
See Figure 3.21
3.4.15. Through a Point and Tangent to a Tabulated Cylinder
SLN = LINE/ spoint, TANTO, stabcyl, spoint
Note
A point on the TABCYL near the point of tangency is included to specify the desired point of tangency.
(This point may be omitted if it is the same as the spoint specified immediately after the slash.)
Figure 3.22. LINE by Point, Tangent Tabulated Cylinder
L3 = LINE/ P3, TANTO, TABC, P4
3.4.16. Through a Point and Perpendicular to a Tabulated Cylinder
SLN = LINE/ spoint, PERPTO, stabcyl, spoint
Note
A point on the TABCYL near the normal is included to specify the desired normal.
Figure 3.23. LINE by Point, Tangent Tabulated Cylinder
L2 = LINE/ P1, PERPTO, TABC, P2
3.5. The Plane (PLANE) Definitions
A plane is a surface that contains all points of a straight line joining any two points of the surface.
3.5.1. Coefficients of the Plane Equation
SPL = PLANE/ a, b, c, d
Figure 3.24. PLANE by Coefficients
PLANA = PLANE/ 0, 0, 1, 1.5
PLANB = PLANE/ .5, 0, 1, -4
3.5.2. Passing Through Three Nonlinear Points
SPL = PLANE/ spoint, spoint, spoint
Figure 3.25. PLANE by Three Points
P1 = POINT/ 1, 1, 1
P2 = POINT/ 2, 3, 2
P3 = POINT/ 3, 4, 0
PLN = PLANE/ P1, P2, P3
3.5.3. Through a Point and Parallel to a Plane
SPL = PLANE/ spoint, PARLEL, splane
Figure 3.26. PLANE by Point, Parallel Plane
PL1 = PLANE/ P1, PARLEL, PLN
PL2 = PLANE/ P2, PARLEL, PLN
3.5.4. Parallel to a Plane at a Distance
Figure 3.27. PLANE by Parallel Plane at Distance
PLQ = PLANE/ PARLEL, PL5, XLARGE, D
3.5.5. Through a Point and Perpendicular to a Vector
SPL = PLANE/ spoint, PERPTO, svector
Figure 3.28. PLANE by Point, Vector
PLN1 = PLANE/ PT, PERPTO, VEC
3.5.6. Through Two Points and Perpendicular to a Plane
Note
A line joining the two given points must not be perpendicular to the given plane.
Figure 3.29. PLANE by Two Points, Perpendicular Plane
PLN6 = PLANE/ PERPTO, PL2, PTA, PTB
3.5.7. Perpendicular to Two Intersecting Planes and Passing Through a Point
SPL = PLANE/ spoint, PERPTO, splane, splane
3.6. The Circle (CIRCLE) Definitions
A circle is the locus of points that are equidistant from a fixed point. The APT processor defines a circle as a
cylinder perpendicular to the XY plane.
3.6.1. Coordinates of the Center and the Radius
SCIR = CIRCLE/ xcoord, ycoord, zcoord, radius
SCIR = CIRCLE/ xcoord, ycoord, radius
Figure 3.30. CIRCLE by Coordinates, Radius
C1 = CIRCLE/ 4, 3, 2
$$ or
PT1 = POINT/ 4, 3
C1 = CIRCLE/ CENTER, PT1, RADIUS, 2
3.6.2. Center and a Line to which it is Tangent
SCIR = CIRCLE/ CENTER, spoint, TANTO, sline
Figure 3.31. CIRCLE by Center Point, Tangent Line
C1 = CIRCLE/ CENTER, PT2, TANTO, L1
3.6.3. Center and a Point on the Circumference
SCIR = CIRCLE/ CENTER, spoint, spoint
Figure 3.32. CIRCLE by Center Point, Circumference Point
C1 = CIRCLE/ CENTER, PNTB, PNTC
3.6.4. Three Points on the Circumference
SCIR = CIRCLE/ spoint, spoint, spoint
Figure 3.33. CIRCLE by Three Points
C1 = CIRCLE/ PT1, PT2, PT3
3.6.5. Center Point and Tangent to a Circle
Note
There are two possibilities. The modifiers LARGE and SMALL indicate the circle is to be chosed with
the largest or smallest (respectively) radius.
Figure 3.34. CIRCLE by Center Point, Tangent Circle
C2 = CIRCLE/ CENTER, PT1, SMALL, TANTO, C1
C3 = CIRCLE/ CENTER, PT1, LARGE, TANTO, C1
3.6.6. Radius and Tangent to Two Intersecting Lines
Figure 3.35. CIRCLE by Radius, Two Tangent Lines
C1 = CIRCLE/ YLARGE, L2, YLARGE, L1, RADIUS, .375
C2 = CIRCLE/ YSMALL, L1, XLARGE, L2, RADIUS, .375
C3 = CIRCLE/ YSMALL, L2, YSMALL, L1, RADIUS, .375
C4
$$
C1
C2
C3
C4
= CIRCLE/
or
= CIRCLE/
= CIRCLE/
= CIRCLE/
= CIRCLE/
XSMALL, L2, YLARGE, L1, RADIUS, .375
XLARGE,
XLARGE,
XSMALL,
YSMALL,
L2,
L1,
L2,
L2,
XSMALL,
YLARGE,
XLARGE,
XSMALL,
L1,
L2,
L1,
L1,
RADIUS,
RADIUS,
RADIUS,
RADIUS,
.375
.375
.375
.375
3.6.7. Radius and Tangent to a Line and Passing Through a Point
Figure 3.36. CIRCLE by Radius, Point, Tangent Line
C1
C2
$$
C1
C2
= CIRCLE/
= CIRCLE/
or
= CIRCLE/
= CIRCLE/
TANTO, LN1, XSMALL, PT1, RADIUS, .5
TANTO, LN1, XLARGE, PT1, RADIUS, .5
TANTO, LN1, YSMALL, PT1, RADIUS, .5
TANTO, LN1, YLARGE, PT1, RADIUS, .5
3.6.8. Radius and Tangent to a Line and a Circle
Figure 3.37. CIRCLE by Radius, Tangent Line, Tangent Circle
C1
C2
C3
C4
C5
C6
C7
C8
=
=
=
=
=
=
=
=
CIRCLE/
CIRCLE/
CIRCLE/
CIRCLE/
CIRCLE/
CIRCLE/
CIRCLE/
CIRCLE/
YLARGE,
YLARGE,
YSMALL,
YSMALL,
YLARGE,
YSMALL,
YLARGE,
YSMALL,
LG,
LG,
LG,
LG,
LG,
LG,
LG,
LG,
XSMALL,
XSMALL,
XSMALL,
XSMALL,
XLARGE,
XLARGE,
XLARGE,
XLARGE,
OUT, CG, RADIUS, 1.
IN, CG, RADIUS, 1.
OUT, CG, RADIUS, 1.
IN, CG, RADIUS, 1.
IN, CG, RADIUS, 1.
IN, CG, RADIUS, 1.
OUT, CG, RADIUS, 1.
OUT, CG, RADIUS, 1.
3.6.9. Radius and Tangent to Two Circles
Figure 3.38. CIRCLE by Radius, Two Tangent Circles
CIR3 = CIRCLE/ YLARGE, IN, CIR2, OUT, CIR1, RADIUS, .25
CIR5 = CIRCLE/ YSMALL, OUT, CIR2, OUT, CIR4, RADIUS, .5
CIR6 = CIRCLE/ YLARGE, OUT, CIR2, OUT, CIR4, RADIUS, .5
3.6.10. Radius and Tangent to a Line and a Tabulated Cylinder
Note
A point on the TABCYL must be included that is nearest the desired tangency point.
Figure 3.39. CIRCLE by Radius, Tangent Line, Tangent TABCLY
CL1 = CIRCLE/ TANTO, L1, XSMALL, TABC, YLARGE, PNTA, RADIUS, .5
3.7. The Cylinder (CYLNDR) Definitions
A cylinder is the locus of all points at a constant distance from a given line.
3.7.1. An Axis Point, an Axis Vector and a Radius
SCYL = CYLNDR/ x, y, z, a, b, c, radius
Note
(x, y, z) represent a point on the axis of the cylinder, (a, b, c) are the components of the unit vector in
the direction of the axis and (radius) represents the radius of the cylinder.
Figure 3.40. CYLNDR by Point, Vector, Radius
C1 = CYLNDR/ 8, 0, 1, 0, 0, 1, 1.0
3.7.2. Substitution of Symbols in the Canonical Form
SCYL = CYLNDR/ spoint, a, b, c, radius
SCYL = CYLNDR/ x, y, z, svector, radius
SCYL = CYLNDR/ spoint, svector, radius
For example, the cylinder in Figure 3.40 could also be defined:
C1 = CYLNDR/ PTA, 0, 0, 1, 1.0
C1 = CYLNDR/ 8, 0, 1, VECTA, 1.0
C1 = CYLNDR/ PTA, VECTA, 1.0
3.8. The Ellipse (ELLIPS) Definition
An ellipse is a plane curve that is the locus of a point moving in such a manner that the sum of the distances
from that point to two fixed points in the plane is constant.
3.8.1. Center, Semi-Major and Semi-Minor Axes, and the Angle the Major Axis Makes
with the X Axis.
SELP = ELLIPS/ CENTER, spoint, semi-maj, semi-min, angle
Note
The ellipse define will be in the XY plane. A positive angle (in degrees) is measured counter clockwise.
Figure 3.41. ELLIPS Example
EL1 = ELLIPS/ CENTER, PTA, 3.25, 1.9, 30
3.9. The Hyperbola (HYPERB) Definition
A hyperbola is a plane curve that is the locus of a point moving such that the differences of the distances
from that point to two fixed points in the plane are consistant.
3.9.1. Center, Half-Tranverse Axis, Half-Conjugate Axis and the Angle of the Transverse
Axis to the X axis.
SHYP = HYPERB/ CENTER, spoint, half-transverse, half-conjugate, angle
Note
A positive angle (in degrees) is measured counter clockwise.
Figure 3.42. HYPERB Example
HYP1 = HYPERB/ CENTER, PTA, 2, 1, 45
3.10. The Cone (CONE) Definitions
A cone is a surface generated by moving a straight line so that the line always touches a circle, and passes
through a fixed point.
3.10.1. Canonical Form
SCN = CONE/ CANON, x, y, z, a, b, c, costheta
Note
(x, y, z) are the coordinates of the vertex of the cone, (a, b, c) are the components of the unit vector in
the direction of the axis of the cone, and (costheta) is the cosine of the vertex half-angle.
Figure 3.43. CONE by Canonical Form
CONEA = CONE/ CANON, 3.1, 2, 0, 0, 0, 1, .866
3.10.2. Expressing the Vertex and Axis Vector Symbolically
SCN = CONE/ spoint, svector, half-angle
For example, the cone in Figure 3.43 could also be defined as:
CONEA = CONE/ PTA, VECB, 30.0
3.11. The General Conic (GCONIC) Definitions
The general conic is the plane curve represented by the general class of second-degree equations in two
variables:
Ax2 + Bxy + Cy2 + Dx + Ey + F = 0
3.11.1. Coefficients of the General Equation
SGC = GCONIC/ A, B, C, D, E, F
3.11.2. Coefficients of the Alternate Equation
SGC = GCONIC/ P, Q, R, S, T
Where the alternate equation is defined as follows:
3.11.3. Coefficients of the Inverse of the Alternate Equation
SGC = GCONIC/ P, Q, R, S, T, FUNOFY
Where the alternate equation is defined as follows:
3.12. The Loft Conic (LCONIC) Definitions
A loft conic is a general conic expressed by a combination of five independent conditions, rather than by a
mathematical expression.
3.12.1. Five Points
Figure 3.44. LCONIC by Five Points
LCONA = LCONIC/ SPT, PTA, PTB, PTC, PTD, PTE
3.12.2. Four Points and a Slope
Figure 3.45. LCONIC by Four Points, Slope
LC1 = LCONIC/ 4PT1SL, PTA, 1.0, PTB, PTC, PTD
3.12.3. Three Points and a Two Slopes
Figure 3.46. LCONIC by Three Points, Two Slopes
LCOND = LCONIC/ 3PT2SL, PTA, 1.887, PTB, -.577, PTC
3.13. The Vector (VECTOR) Definitions
The vector is that quantity which has both magnitude and direction. In cases where a specific magnitude is
not defined for a vector, the unit vector (magnitude = 1) is assumed.
The formats given in Section 3.13.4, Section 3.13.5, Section 3.13.6 and Section 3.13.9 accept as input both
points and vectors. In these formats, if a point is specified it is equivalent to a vector from the origin to the
given point.
3.13.1. X, Y, Z Components
SVCT = VECTOR/ x, y, z
Figure 3.47. VECTOR by X, Y, Z
VEC1 =
VEC2 =
$$ or
VEC1 =
VEC2 =
$$ or
VEC1 =
VEC2 =
VECTOR/ 1, 1, 4
VECTOR/ +2, -6, -1
VECTOR/ 2, 2, -3, 3, 3, 1
VECTOR/ -5, 2, 3, -3, -4, 2
VECTOR/ P1, P2
VECTOR/ P4, P3
3.13.2. Two End Points
Note
The defined vector is from the first point toward the second point. (See Figure 3.47)
3.13.3. Perpendicular to a Plane
The modifiers are used to indicate the direction the vector is to point. (POSX indicates the vector points in
the positive X direction, etc.)
Figure 3.48. VECTOR by Perpendicular Plane
VECTA = VECTOR/ PERPTO, PLANA, POSX
3.13.4. A Scalar Times a Vector
SVCT = VECTOR/ scalar, TIMES, svector
Figure 3.49. VECTOR by Scaled Vector
VEC3 = VECTOR/ 4.0, TIMES, VEC
VEC4 = VECTOR/ -1, TIMES, VEC
3.13.5. The Cross Product of Two Vectors or Points
SVCT = VECTOR/ svector, CROSS, svector
Note
The resultant vector will be perpendicular to the plane of the two given vectors, and its length will be
the scalar product of the magnitudes of the given vectors and the sine of the included angle. The
direction of the resultant vector will be as see in Figure 3.50 (an application of the "right-hand rule").
Figure 3.50. VECTOR by Cross Product
VECTA = VECTOR/ V1, CROSS, V2
VECTB = VECTOR/ V2, CROSS, V1
3.13.6. Normalizing a Vector, Point or Components
Note
A normalized vector has the same direction as the given vector, with a magnitude equal to one.
Figure 3.51. VECTOR by Normal
VECTA = VECTOR/ UNIT, VECB
3.13.7. A Length (Magnitude) and an Angle in a Plane
The angle is measured from the first axis specified in the modifier; that is, from the X axis in the XYPLAN,
from the Y axis in the YZPLAN, and from the Z axis in the ZXPLAN.
Figure 3.52. VECTOR by Length, Angle
VEC = VECTOR/ LENGTH, 6, ATANGL, 30, XYPLAN
3.13.8. Parallel to the Intersection of Two Planes
Figure 3.53. VECTOR by Intersecting Planes
VECA = VECTOR/ PARLEL, INTOF, PLNA, PLNB, NEGZ
3.13.9. The Addition or Subtraction of Two Vectors or Points
SVCT = VECTOR/ svector, PLUS, svector
SVCT = VECTOR/ spoint, PLUS, spoint
SVCT = VECTOR/ svector, MINUS, svector
SVCT = VECTOR/ spoint, MINUS, spoint
Figure 3.54. VECTOR by Addition, Subtraction
VECTC = VECTOR/ V1, PLUS, V2
VECTD = VECTOR/ V1, MINUS, V2
3.13.10. In the XY Plane Having an Angle with a Line
Figure 3.55. VECTOR by Angle, Line
V1
V1
V2
V2
V3
V3
=
=
=
=
=
=
VECTOR/
VECTOR/
VECTOR/
VECTOR/
VECTOR/
VECTOR/
ATANGL,
ATANGL,
ATANGL,
ATANGL,
ATANGL,
ATANGL,
30, L1, POSY
30, L1, XLARGE
135, L1, XSMALL
135, L1, NEGX
330, L1, POSX
330, L1, XLARGE
3.14. The Matrix (MATRIX) Definitions
A matrix is a rectangular array of numbers defining the three simultaneous equations that represent the
relationship between two coordinate systems.
3.14.1. The Equation Coefficients (Canonical Form)
SMAT1 = MATRIX/ a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3
where a1, b1, etc. are the coefficients of the equations:
a1x + b1y + c1z - d1 = 0
a2x + b2y + c2z - d2 = 0
a3x + b3y + c3z - d3 = 0
which define three mutually perpendicular planes of the new coordinate system.
3.14.2. A Translation of Axis
SMAT2 = MATRIX/ TRANSL, d1, d2, d3
Note
d3 may be omitted. If it is omitted, the APT processor assumes d3 = 0.
The parameters d1, d2 and d3 are the coordinates of the origin of the new coordinate system expressed in
terms of the old system.
The format will generate the following canonical form:
1, 0, 0, d1, 0, 1, 0, d2, 0, 0, 1, d3
3.14.3. A Rotation of Axis
Note
angle is in degrees
a. Rotation in the XY plane, where positive rotation is from the X axis to the Y axis (counter
clockwise)
M1 = MATRIX/ XYROT, A
The canonical form generally will be:
COS A, -SIN A, 0, 0, SIN A, COS A, 0, 0, 0, 0, 1, 0
b. Rotation in the YZ plane, where positive rotation is from the Y axis to the Z axis (counter clockwise)
M2 = MATRIX/ YZROT, B
The canonical form generally will be:
1, 0, 0, 0, 0, COS B, -SIN B, 0, 0, SIN B, COS B, 0
c. Rotation in the ZX plane, where positive rotation is from the Z axis to the X axis (counter clockwise)
M3 = MATRIX/ ZXROT, C
The canonical form generally will be:
COS C, 0, SIN C, 0, 0, 1, 0, 0, -SIN C, 0, COS C, 0
3.14.4. Matrix Combinations
As shown in Section 3.14.5 a MATRIX can be defined as a combination (Multiplication) of matrices.
Because matrix operations of this type are not commutative, the order of the operation becomes quite
important. That is, if M and N are matrices, in general:
MxNNxM
To illustrate, compare the result of performing a rotation followed by a translation with the result obtained
by first performing the translation and then the rotation.
If matrix A is multiplied into matrix B, the resultant matrix C will have the effect of first performing the B
operations and then performing the A operations. For example, let A be a translation matrix and B be a
rotation matrix. Then:
Atranslation x Brotation = C
Matrix C will have the effect of first a rotation and then a translation. On the other hand, if the matrix
multiplication is reversed:
Arotation x Btranslation = C
C will first translate and then rotate. Notice that the effect of a matrix multiplication can be thought of as
being the opposite of the order of multiplication.
3.14.5. The Product of Two Matrices
The order of matrix multiplication for most of the combinations above is left to right. For example:
M1 = MATRIX/ MATR, MATT
where MATR is a rotation matrix and MATT is a translation matrix will yield:
M1 = MATR x MATT
There are exceptions to this general rule. The formats given below define the cases in which the order of
matrix multiplication is right to left rather than left to right.
All other formats result in a matrix multiplication order of left to right.
Assume matrix
is multiplied into matrix
, where:
a41 = b41 = 0
a42 = b42 = 0
a43 = b43 = 0
a44 = b44 = 1
The canonical form generated will be:
Obviously, the order of the matrices given in this format is quite important.
3.14.6. The Inverse of a Matrix
SMAT6 = MATRIX/ INVERS, smatrix
If the input matrix is defined as:
a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3,
the canonical form generated will be:
A1 = a1
B1 = a2
C1 = a3
D1 = -(a1d1 + a2d2 + a3d3)
A2 = b1
B2 = b2
C2 = b3
D2 = -(b1d1 + b2d2 + b3d3)
A3 = c1
B3 = c2
C3 = c3
D3 = -(c1d1 + c2d2 + c3d3)
3.14.7. Three Mutually Perpendicular Planes
SMAT7 = MATRIX/ splane, splane, splane
If the canonical forms of the three planes are:
PLAN1: A1, B1, C1, D1
PLAN2: A2, B2, C2, D2
PLAN3: A3, B3, C3, D3
the canonical form generated will be:
A1, A2, A3, -(A1D1 = A2D2 + A3D3),
B1, B2, B3, -(B1D1 = B2D2 + B3D3),
C1, C2, C3, -(C1D1 = C2D2 + C3D3)
3.14.8. Scale Factor
SMAT8 = MATRIX/ SCALE, s
The canonical form generated will be:
s, 0, 0, 0, 0, s, 0, 0, 0, 0, s, 0
3.14.9. Origin, X Axis Vector and a Vector in the 1st or 2nd Quadrant
SMAT = MATRIX/ spoint, svector1, svector2
Where svector1 represents the new X axis and svector2 is in the first or second quadrant.
3.14.10. A Mirror Matrix about One or More Planes
3.14.11. A Mirror Matrix about a Line or Plane
3.15. The Sphere (SPHERE) Definitions
A sphere is a surface such that all points on the surface are equidistant from a fixed point.
3.15.1. Center Point and Radius
Figure 3.56. SPHERE by Center Point, Radius
S1 = SPHERE/ PNTC, 2.5
$$ or
S1 = SPHERE/ CENTER, PNTC, PNTA
3.15.2. Center Point and a Point on the Surface
SPH = SPHERE/ CENTER, spoint, spoint
See Figure 3.56.
3.15.3. Center Point and a Plane to which it is Tangent
SPH = SPHERE/ CENTER, spoint, TANTO, splane
Figure 3.57. SPHERE by Center Point, Tangent Plane
SPHA = SPHERE/ CENTER, PTA, TANTO, PLANEB
3.15.4. Passing Through Four Points
SPH = SPHERE/ spoint, spoint, spoint, spoint
Note
The four points cannot be coplanar.
Figure 3.58. SPHERE by Four Points
SPHD = SPHERE/ PNTA, PNTB, PNTC, PNTD
3.16. The Quadric (QADRIC) Definitions
The general qadric surface is the locus of points that satisfy the following general equation in the second
degree:
SQAD = QADRIC/ a, b, c, d, e, f, g, h, p, q, r, d
3.16.1. Permissible Quadric Surfaces
Figure 3.59 through Figure 3.62 and Figure 3.63 through Figure 3.67 show all allowable quadric surfaces,
together with the normal equation for each surface.
Figure 3.59. Elliptic Cone
Figure 3.60. Elliptic Cylinder
Figure 3.61. Hyperbolic Cylinder
Figure 3.62. Parabolic Cylinder
Figure 3.63. Real Ellipsoid
Figure 3.64. Hyperboloid of One Sheet
Figure 3.65. Hyperboloid of Two Sheets
Figure 3.66. Elliptic Paraboloid
Figure 3.67. Hyperboloid Paraboloid
3.16.2. Quadratics as a Special Form of QADRIC
In many instances a quadratic (that is, parabola, ellipse, hyperbola) is defined in equation form. For
example, an ellipse my be specified in the following form:
Ax2 + By2 + Cx + Dy + E = 0
ELLP1 = QADRIC/ A, B, 0, 0, 0, 0, C, D, 0, E
As further illustration, the parabola (y - a)2 - p(x - b) = 0 can be expressed
y2 - 2ay + a2 - px + pb = 0
or, collecting terms:
y2 - 2ay - px + (pb + a2 )
The general quadric definition can then be used as follows:
PARB = QADRIC/ 0, 1, 0, 0, 0, 0, -p,$$
(-2 * a), 0, (p * b + a**2)
This provides the facility for specifying any two-dimensional quadratic curve with the QADRIC surface
definition.
3.15. The Sphere (SPHERE) Definitions
3.17. The Reference System (REFSYS)
Statement
3.17. The Reference System (REFSYS) Statement
Chapter 3. Geometric Statements in APT
3.17. The Reference System (REFSYS) Statement
The REFSYS statement is used to describe a surface or surfaces in one coordinate system (such as an
auxiliary view on a blueprint) and to machine this surface or surfaces in another coordinate system.
REFSYS/ smatrix
REFSYS/ NOMORE
The REFSYS statement specifies a matrix that will be used to transform the geometric surface or surfaces to
any other coordinate system. smatrix expresses the origin and coordinate planes of the new system in terms
of the old system (or base system). A particular reference system is in effect until it is either replaced by a
new reference system (REFSYS/ smatrix) or terminated by a REFSYS/ NOMORE, which causes a return to
the base or original coordinate system. All of the geometric types listed in Section 3.3 through Section 3.16,
except the MATRIX definition itself, can be transformed by using the REFSYS statement. No other APT
surface can be transformed. If a nested definition is used in the REFSYS statement, the MATRIX must be
given a name.
A geometric definition defined in a particular reference system will not be transformed until it is used in a
reference system different (by name) from the system in which it was defined. Example:
REFSYS/ (MAT1 = MATRIX/ TRANSL, 5, 5, 0)
P1 = POINT/ 2, 4, 0
REFSYS/ NOMORE
A) GOTO/ P1
The point P1 will be defined with the coordinate values X = 2, Y = 4, Z = 0. At statement labeled A, the
point P1 will be used to define the output point -- by applying the translation matrix MAT1, the output point
will have the coordinate values X = 7, Y = 9, Z = 0; P1 will still be defined as X = 2, Y = 4, Z = 0 in
reference system MAT1. To rephrase, a geometric definition when used in another system will be
dynamically redefined as often as it is used while preserving its static definition in its own system.
Note
When both rotation and translation are specified, the translation is made first, then the rotation.
3.18. The Tabulated Cylinder (TABCYL) Definition
A tabulated cylinder (TABCYL) is the surface generated by moving a line (generatrix) along a space curve
(directrix) such that it is always parallel to a given line. The space curve is defined by a set of points and an
interpolation scheme for "fairing" between given points. A maximum of 139 points may be given to define
the space curve. However, when using some of the formats available for TABCYL specification, it is
possible to exceed the limitation on the maximum number of elements in one statement (see Section 1.1.6)
well before the 139 point limit is reached. The limiting value in such cases depends upon the number of
elements being used in the description of each point, and must be determined by the part programmer.
The general format of the TABCYL is:
Note
A symbolic vector (svector) must be specified if, and only if, the XYZ format is used.
The various options available under the formats indicated above (CANON, NOX, NOY, NOZ, RTHETA,
THETAR, XYZ), together with the data representations, are discussed in the following sections.
3.18.1. Transformation (TRFORM)
A TABCYL can be transformed at the time it is defined by using TRFORM and specifying the symbolic
MATRIX (smatrix) to be used.
3.18.2. CANON Format
A TABCYL can be defined by specifying the canonical form of parameters:
STAB = TABCYL/ CANON, n, k, m1, ... m9, u1, v1, a1, b1, c1, r1, u2, v2, a2, b2, c2, r2, ... un, vn, an, bn, cn, rn,
un+1, vn+1,
See Section 16.15 for an explanation of the terms.
3.18.3. NOZ, RTHETA, THETAR Formats
The data in these formats is given in the XY plane, the generatrix is normal to the XY plane; and coordinate
transformation is limited to the XY plane. NOZ implies X, Y coordinates only are given; RTHETA and
THETAR indicate polar coordinates, where r is the radius (in units) and is the angle in degrees measured
counter clockwise from the positive X axis.
Note
RTHETA means r1, 1, r2, 2, ... rn, n, and THETAR implies 1, r1, 2, ... r2, n, rn.
The following sections discuss the options (PTNORM, PTSLOP, TWOPT, FOURPT, SPLINE) available
under these formats.
Note
The NOZ format is used, although the options also apply to RTHETA and THETAR
3.18.3.1. PTNORM
STAB = TABCYL/ NOZ, PTNORM, [TRAFORM, smatrix,] x1, y1, n1, x2, y2, n2, ... xn, yn, nn
This option is used when the normals (n1, n2, ... nn, where n is specified in degrees measured counter
clockwise from the positive X axis) are to be input for each given point. The interpolation technique defines
a series of curves that go through the given points, matching the specified normals at each point.
3.18.3.2. PTSLOP
STAB = TABCYL/ NOZ, PTSLOP, [TRAFORM, smatrix,] x1, y1, s1, x2, y2, s2, ... xn, yn, sn
This option is used when the slopes (s1, s2, ... sn, where s is specified as y / x) are known at each given
point. The fitting scheme is such that the slopes are matched at each point.
3.18.3.3. TWOPT
This option is used when the slopes or normals are specified only at selected points. The program computes
a slope or normal when not specified; it then processes as in Section 3.18.3.1 or Section 3.18.3.2.
3.18.3.4. FOURPT
STAB = TABCYL/ NOZ, FOURPT, [TRAFORM, smatrix,] x1, y1, x2, y2, ... xn, yn
This option defines a series of curves, each one passing through four successive input points. The resulting
TABCYL does not have a continuous slope.
3.18.3.5. SPLINE
This TABCYL is similar to the TWOPT, PTNORM and PTSLOP types, except that the slopes or normals
are adjusted until the curvature is continuous.
3.18.4. NOX, NOY Formats
These formats are identical to the NOZ format (Section 3.18.3) except that the data reference plane is
different.
NOX implies the XZ plane and requires that the points be specified in the y, z order (y1, z1, y2, z2, ..., yn,
zn). NOY implies the ZX plane and requires that the points be specified in the z, x order (z1, x1, z2, x2, ...,
zn, xn).
3.18.5. XYZ Format
This format requires that the symbolic vector (svector) representing the generatrix be specified. Further, the
processor determines which coordinate plane will control the fitting techniques; therefore, no slopes or
normals can be given.
The options (TWOPT, FOURPT, SPLINE) are as outlined in Section 3.18.3.3 through Section 3.18.3.5,
respectively, with the exception that no slopes are given in the TWOPT method.
3.19. The Polyconic (POLCON) Definition
The polyconic surface is defined to be a continuous family of conic sections in parallel planes. The shape of
the conics is regulated by a set of polynomial curves.
Figure 3.68. POLCON Nomenclature
3.19.1. Method of Definition
The input to the polyconic routine is the canonical form of the polyconic, as follows:
POLY1 = POLCON/ CANON, JROOTS,
M1, M2, M3, M4, M5, M6, M7, M8, M9, M10, M11, M12,
T, Cb, Pb,
A0, A1, A2, A3, A4, A5, A6, A7,
B0, B1, B2, B3, B4, B5, B6, B7,
C0, C1, C2, C3, C4, C5, C6, C7,
D0, D1, D2, D3, D4, D5, D6, D7,
L0, L1, L2, L3, L4, L5, L6, L7,
H0, H1, H2, H3, H4, H5, H6, H7,
P0, P1, P2, P3, P4, P5, P6, P7,
A 1/2, B 1/2, C 1/2, D 1/2, L 1/2, H 1/2, P 1/2
where:
JROOTS
Equal to 2 if there are square root terms, 1 otherwise
M1 - M12
Transformation matrix (may be all zeros)
T
Thickness between defined surface and working surface
Cb
Origin of curves, that is, the start of the polyconic
Pb
Full-size length of the valid region of the surface
A0-P1/2
Coefficients of surface control equations, each of the form:
f(d) = A 1/2 d + A0 + A1d + a2d2 + a3d3 + a4d4 + a5d5 + a6d6 + a7d7
Note
The coefficients of the square root terms for all the surface control equations are in the bottom line of
the canonical form. The square root terms may all be zero (JROOTS = 1).
See Figure 3.68 for a graphic representation of a POLCON.
3.20. The Ruled Surface (RLDSRF) Definitions
A ruled surface is a surface generated by straight lines (called rulings) joining corresponding points on two
space curves. An alternate form of the ruled surface allows substitution of a point of the second space curve.
The space curves are two-dimensional (formed by a plane cutting a surface) and are limited by two end
points. The line joining the end points of a space curve is a base line, whose length considered as unity, or
100 percent. A point on one space curve corresponds to a point on the second space curve when the
associated points on the base lines are of equal percentage.
The following surfaces are permitted within a ruled surface definition: line, plane, circle, cylinder, ellipse,
hyperbola, cone, general conic, loft conic, sphere, quadric and tabulated cylinder.
3.20.1. Six Points and Two Surfaces
A ruled surface may be defined by specifying:
A surface and three points on a plane intersecting the surface (two of the points being end points of the
desired space curve), and a second surface and three points on a plane intersecting the surface (two of the
points being the end points of the second space curve).
Figure 3.69. RLDSRF by Six Points, Two Surfaces
RS1 = RLDSRF/ SURF1, P1A, P1B, P1C, SURF2, P2A, P2B, P2C
Format:
SRLD = RLDSRF/ ssurface, spoint, spoint, spoint, ssurface, spoint, spoint, spoint
With reference to Figure 3.69, the following restrictions apply:
P1A, P1B and P1C cannot be colinear (similarly for P2A, P2B and P2C)
P1A, P1B and P2A, P2B must be the end points of the first and second space curves respectively.
3.20.2. Two Surfaces, Four Points and Two Vectors
A ruled surface may be defined by specifying:
A surface and two end points of a plane curve and a vector, and a second surface with two end points of a
space curve and a vector. (The two points and the vector determine an intersecting plane in each case.)
Figure 3.70. RLDSRF by Two Surfaces, Four Points, Two Vectors
RS2 = RLDSRF/ SURF1, P1A, P1B, V1, SURF2, P2A, P2B, V2
Format:
SRLD = RLDSRF/ ssurface, spoint, spoint, svector, ssurface, spoint, spoint, svector
3.20.3. Two Surfaces, Five Points and a Vector
A ruled surface may be defined by specifying:
Three non-colinear points to define one intersecting plane and two points, and a vector to define the other
intersecting plane.
Figure 3.71. RLDSRF by Two Surfaces, Five Points, Vector
RS3 = RLDSRF/ SURF1, P1A, P1B, V1, SURF2, P2A, P2B, P2C
$$ or
RS3 = RLDSRF/ SURF1, P1A, P1B, P1C, SURF2, P2A, P2B, V2
Format:
SRLD = RLDSRF/ ssurface, spoint, spoint, svector, ssurface, spoint, spoint, spoint
or
SRLD = RLDSRF/ ssurface, spoint, spoint, spoint, ssurface, spoint, spoint, svector
3.20.4. Replacing One of the Curves with a Point
A rules surface may be defined by using a point as one of the surfaces.
Figure 3.72. RLDSRF by Replacing Curve with Point
RS4 = RLDSRF/ SURF1, P1A, P1B, P1C, P2
$$ or
RS4 = RLDSRF/ SURF1, P1A, P1B, V1, P2
Format:
See Section 14.6 for further information on RLDSRF.
3.21. Nested Definitions
The nested definition permits defining a geometric quantity (except a scalar variable) in the APT statements
that refer symbolically to these quantities. All of the geometric types can be nested except TABCYL,
POLCON and RLDSRF. The following examples illustrate some of the applications of nested definitions.
3.21.1. Nested Geometric Definitions Instead of Symbols
SP3 = SPHERE/ CENTER, (POINT/ INTOF L1, L2), TANTO, (PLANE/ $
PTA, PERPTO, (VECTOR/ PTB, PTC))
In this example, the SP3 is defined by its center and a plane to which it is tangent. However, the center of
the sphere is defined by a nested definition of a point that is the intersection of two lines. Similarly, the plane
is defined by a nested definition as passing through a point and perpendicular to a vector that, in turn, is
defined as a nested definition.
3.21.2. Nested Geometric Definitions with Symbols Attached
It is possible to nest the name a geometric type simultaneously. For example:
SP4 = SPHERE/ CENTER, (PT2 = POINT/ INTOF, L1, L2), $
TANTO, PLANEA
The center of the sphere is defined as a nested point definition and has been assigned the symbol PT2.
3.21.3. Nested Geometric Definitions in Non-Geometric Definition Statements
A nested definition can be used in any APT statement where a surface type is referenced.
REFSYS/ (SMATA = MATRIX/ definition)
ZSURF/ (SPLANA = PLANE/ definition)
FROM/ (SPTA = POINT/ definition)
GOTO/ (POINT/ definition)
GOLFT/ (SLA = LINE/ definition)
GOFWD/ (CIRCLE/ definition), PAST, (SLB = LINE/ definition)
3.21.4. Special Case of Nested Definition
Because of the high incident of POINT in other geometric definition formats, a special nesting capability is
provided for points.
In any part of a geometric definition where it would be valid to write:
(POINT/ a, b)
or
(POINT/ a, b, c)
that is, to use a nested point definition without a symbol attached, it would also be valid to write:
(a, b)
or
(a, b, c)
The POINT/ is not required in this case. For example:
C1 = CIRCLE/ P1, P2, (POINT/ 1, 4, 8)
can be written:
C1 = CIRCLE/ P1, P2, (1, 4, 8)
3.21. Nested Definitions
The nested definition permits defining a geometric quantity (except a scalar variable) in the APT statements
that refer symbolically to these quantities. All of the geometric types can be nested except TABCYL,
POLCON and RLDSRF. The following examples illustrate some of the applications of nested definitions.
3.21.1. Nested Geometric Definitions Instead of Symbols
SP3 = SPHERE/ CENTER, (POINT/ INTOF L1, L2), TANTO, (PLANE/ $
PTA, PERPTO, (VECTOR/ PTB, PTC))
In this example, the SP3 is defined by its center and a plane to which it is tangent. However, the center of
the sphere is defined by a nested definition of a point that is the intersection of two lines. Similarly, the plane
is defined by a nested definition as passing through a point and perpendicular to a vector that, in turn, is
defined as a nested definition.
3.21.2. Nested Geometric Definitions with Symbols Attached
It is possible to nest the name a geometric type simultaneously. For example:
SP4 = SPHERE/ CENTER, (PT2 = POINT/ INTOF, L1, L2), $
TANTO, PLANEA
The center of the sphere is defined as a nested point definition and has been assigned the symbol PT2.
3.21.3. Nested Geometric Definitions in Non-Geometric Definition Statements
A nested definition can be used in any APT statement where a surface type is referenced.
REFSYS/ (SMATA = MATRIX/ definition)
ZSURF/ (SPLANA = PLANE/ definition)
FROM/ (SPTA = POINT/ definition)
GOTO/ (POINT/ definition)
GOLFT/ (SLA = LINE/ definition)
GOFWD/ (CIRCLE/ definition), PAST, (SLB = LINE/ definition)
3.21.4. Special Case of Nested Definition
Because of the high incident of POINT in other geometric definition formats, a special nesting capability is
provided for points.
In any part of a geometric definition where it would be valid to write:
(POINT/ a, b)
or
(POINT/ a, b, c)
that is, to use a nested point definition without a symbol attached, it would also be valid to write:
(a, b)
or
(a, b, c)
The POINT/ is not required in this case. For example:
C1 = CIRCLE/ P1, P2, (POINT/ 1, 4, 8)
can be written:
C1 = CIRCLE/ P1, P2, (1, 4, 8)
Chapter 4. Point-To-Point Programming
The APT language provides the capability for explicitly referencing an absolute location to which the cutter
is to be positioned. This concept of moving a cutter from one specific location directly to another specific
location by means of a single straight line movement is called point-to-point programming. The movement
is accomplished with the APT statements FROM, GOTO, and GODLTA. These statements completely
control the motion of the cutter and require no additional information.
4.1. The Initialization (FROM) Statement
The FROM statement specifies a location at which the tip of the cutter is assumed to be positioned. A
FROM statement should be given before any other statement used to define a cutter position; in this regard it
will not result in any movement of the cutter. However, later FROM statements in the part program will
usually result in a movement of the tool. The general format of the FROM statement is as follows:
FROM/ x, y (See Section 4.4)
The FROM point is specified either symbolically or by listing the x, y and z coordinates. The first optional
field is used to specify information concerning the axis of the cutter (either by referencing a symbolic vector
or by giving the individual components). The last optional field is used to specify a feed rate that is to be in
effect until a new value is specified on a later statement.
Note
If the alternate form is used (FROM/ x, y), the optional fields cannot be used.
4.2. The Absolute Movement (GOTO) Statement
The GOTO statement is used to move a tool from its current point of reference to a specified point. The tip
of the cutter will be located at the specified point. The general format of the GOTO statement is as follows:
GOTO/ x, y (See Section 4.4)
The GOTO point is specified either symbolically or by listing the x, y and z coordinates. The two optional
fields have exactly the same meaning as indicated in the FROM statement, and the same rules apply.
4.3. The Incremental Movement (GODLTA) Statement
The GODLTA statement specifies an incremental value that is to be added to each of the coordinates of the
current tool position. This statement, then, defines the amount of movement of the tool in each axis
direction, rather than the specific point to Which the tool is to move (as did the GOTO statement). The
general form of the GODLTA statement is as follows:
The amount to be added to each coordinate can be specified by listing the values (dx, dy, dz) or by
referencing the components of a symbolic vector (done by specifying svector). The third option (specifying
a single scalar value) indicates the tool is to be moved by that amount directly along the tool axis. (A
positive value for delta generates a movement similar to "withdrawing" the tool; a negative value defines a
movement comparable to a plunge operation.) The optional feed rate field has the same meaning as
indicated in the FROM statement,
4.4. Implication of the ZSURF Statement
The ZSURF statement (see Section 3.2) can be used to supply the z coordinate when the alternate form for
the FROM or GOTO statement is used (that is, FROM/ x, y or GOTO/ x, y). The z coordinate is computed
from the plane defined by the ZSURF statement and is zero if no ZSURF statement is specified.
.5. Pattern Definition Statement
A pattern is a set of one or more points. The maximum number of points that can be included in a pattern is
330. Pattern definition statements may be constructed in such a way that a pattern containing the full 330
points cannot be defined. In this case a diagnostic is issued. If this occurs, the desired pattern can always be
defined by breaking the definition statement up into two patterns and adding them together. Even the very
worst case pattern definition statement can always define at least 230 points. It is very unusual to encounter
a pattern definition that cannot define a full 330 points. Patterns may be defined using the formats listed
below. Pattern definitions may not be nested.
4.5.1. Linear (LINEAR) Patterns
A linear pattern is a set of point locations, all of which lie on a straight line.
4.5.1.1. Start Point, End Point and Number of Equally Spaced Points
The start and end points are included in npoints.
SPAT = PATERN/ LINEAR, spoint1, spoint2, npoints
Figure 4.1. LINEAR PATERN 1
PAT1 = PATERN/ LINEAR, PT1, PT2, 9
$$ or
PAT1 = PATERN/ LINEAR, PT1, VEC1, 9
$$ or
PAT1 = PATERN/ LINEAR, PT1, VEC1, INCR, 8, AT, 1
4.5.1.2. Start Point, a Vector, and Number of Equally Spaced Points
The start point is included in npoints. The distance between the points is equal to the vector magnitude. (See
Figure 4.1)
SPAT = PATERN/ LINEAR, spoint, svector, npoints
4.5.1.3. Start Point, a Vector, and an Incremental Spacing
The start point is not included in npoints. The distance between the points is equal to i. (See Figure 4.1)
SPAT = PATERN/ LINEAR, spoint, svector, INCR, npoints, AT, i
4.5.1.4. Starting Point, a Vector and Successive Increments
SPAT = PATERN/ LINEAR, spoint, svector, INCR, i1, i2, ... in
Where i1, i2, ... in, are the successive increments along the vector.
Figure 4.2. LINEAR PATERN 2
PAT2 = PATERN/ LINEAR, PT2, VEC2, INCR, 2, 1, 1, 3
4.5.2. Arc (ARC) Patterns
An ARC pattern is a set of point locations, all of which lie on a single circle. The points may be defined in
the counterclockwise or clockwise direction by specifying the appropriate modifier as follows:
CLW
CCLW
Clockwise
Counterclockwise
The angles used in arc PATERN definitions are specified in degrees measured counterclockwise from the
positive X axis.
4.5.2.1. A Circle, Start and End Angles and the Number of Points
Where sa and ea specify the starting and ending angles, respectively. The number of points includes the
starting and ending points in the pattern.
Figure 4.3. ARC PATERN
PAT1 =
$$ or
PAT2 =
$$ or
PAT3 =
$$ or
PAT4 =
PATERN/ ARC, C1, 70, 230, CCLW, 5
PATERN/ ARC, C1, -130, 70, CLW, 5
PATERN/ ARC, C1, 70, CLW, INCR, 200, 40, 40, 40
PATERN/ ARC, C1, 70, CCLW, INCR, 4, AT, 40
4.5.2.2. A Circle, Starting Angle, and Angular Increments
Where sa is the starting angle and a1, a2, ... an define the angular displacements between successive points
on the circle in the direction specified by CLW or CCLW. (See Figure 4.3)
4.5.2.3. A Circle, Starting Angle, and Number of Increments at an Angular Spacing
Where sa defines the starting angle, and npoints is the number of points (one less than the resultant total
number of points) to be generated at an angular displacement specified by angle in the direction indicated by
CLW or CCLW. (See Figure 4.3)
4.5.3. Parallelogram (PARLEL) Patterns
A parallelogram pattern is a grid of point locations defined by establishing lines parallel to a specified linear
pattern and projecting the points from the original pattern onto those lines. The definition order for the
points in a parallelogram pattern will be governed by the following rules:
1. The first linear pattern in the list defines a "column", the order of which is that of the linear pattern.
2. A parallelogram pattern will consist of at least one other column parallel to the first column. The
points in the second, fourth, and all even-numbered columns will be ordered in the opposite direction
from those in odd-numbered columns.
For example, in Figure 4.4 PAT5 contains points 1-7. Points 8-14 in the next row are ordered in the opposite
direction; points 15-21 are ordered in the same direction as points 1-7, etc. In this example the first column
consists of points 1-7, the second column consists of points 8-14, etc.
Figure 4.4. PARLEL PATERN 1
PAT6 = PATERN/ PARLEL, PAT5, VEC2, INCR, 2.5, 1.5, 1, 2
4.5.3.1. Two Previously Defined Linear Patterns
SPAT = PATERN/ PARLEL, spat1, spat2
spat1 and spat2 must contain a common point as either their first or last point for this definition.
Figure 4.5. PARLEL PATERN 2
PAT4 = PATERN/ PARLEL, PAT1, PAT2
$$ or
PAT4 = PATERN/ PARLEL, PAT1, VEC1, 5
$$ or
PAT4 = PATERN/ PARLEL, PAT1, VEC1, INCR, 5, AT, 4
4.5.3.2. A Linear Pattern, Vector and Number of Columns
SPAT = PATERN/ PARLEL, spat, svect, n
spat1 and spat2 must contain a common point as either their first or last point for this definition. (See
Figure 4.5)
4.5.3.3. A Linear Pattern, Vector, Increment, and Number of Columns
SPAT = PATERN/ PARLEL, spat, svect, INCR, i, AT, n
Where i specifies the increment in units and n specifies the number of times spat is to be repeated at the
specified interval and direction, not including the original pattern. (See Figure 4.5)
4.5.3.4. A Linear Pattern, Vector, and Increments
SPAT = PATERN/ PARLEL, spat, svect, INCR, i1, i2, ... in
Where i1, i2, ... in will be increments (in units) between columns along the direction specified by svect. (See
Figure 4.4)
4.5.4. Random (RANDOM) Patterns
A random pattern is a collection of point locations not necessarily contained on a line or an arc.
4.5.4.1. Previously Defined Points and Patterns
SPAT = PATERN/ RANDOM, spat1, spoint1, spoint2, spat2, spoint3, ...
Figure 4.6. RANDOM PATERN
PAT10 = PATERN/ RANDOM, PAT1, PT8, PT7, PT6, PT5, PT4, PT3$
PT2, PT1
4.6. Point-Point Motion Commands
A cutter movement to a. series of locations may be specified as follows:
GOTO/ spat
where spat is a previously defined pattern.
The resulting output will be a series of GOTO commands specifying movement of the cutter to each point
location defined in the pattern.
The motion between points will be the minimum possible move between points and will be parallel to the
XY plane unless the z-component of the adjacent points differs.
To increase the flexibility of this command the modifiers, OMIT, CONST, INVERS, RETAIN, AVOID, and
THRU are allowed. Their usage is described in Section 4.6.1 through Section 4.6.6.
4.6.1. INVERS Modifier
This modifier specifies that motion should occur to the point locations in a pattern in the reverse order of
their definition. That is, for a pattern containing N points motion would occur to the N, N-1, ..., 1 points.
4.6.2. OMIT Modifier
Points in a pattern may be omitted by specifying OMIT, N1, N2, N3, ..., N, where N1, N2, N3, ..., N
correspond to the points in the pattern according to their output order (affected by INVERS or CONST).
This modifier allows the specification of pattern elements which are not to be included in a specific pointpoint motion sequence.
For example, GOTO/ PAT1, OMIT, 2, 3, 7, where PAT1 is illustrated in Figure 4.7, would cause the cutter
to move to points 1, 4, 5, 6 and 8.
Figure 4.7. Sample Pattern 2
4.6.3. RETAIN Modifier
This modifier allows the specification of certain elements of a pattern to be included in a point-point motion
sequence by specifying RETAIN, N1,.N2,N3, ..., N, where N1, N2, N3, ..., N refer to the output order of the
referenced pattern (affected by CONST or INVERS). For example, GOTO/ PAT1, RETAIN, 4, 6, 7, where
PAT1 is illustrated in Figure 4.7, would cause the cutter to move to points 4, 6, and 7.
4.6.4. AVOID Modifier
A vertical displacement (n) from the normal path between points may be maintained While moving the
cutter from Nth point to the (N1 + 1}th point in the referenced pattern, from the Nth point to the (N2 + 1)th
point, by specifying AVOID n, N1, N2, ..., N. The point references refer to the output order of the pattern
(affected by INVERS and CONST). For example, GOTO/ PAT1, AVOID, 3, 2, 4, would result in the cutter
movement illustrated in Figure68h. (This figure is missing in the original manual -- SED)
4.6.5. THRU Modifier
This modifier is used to specify a range of points for the OMIT, RETAIN, and AVOID modifiers.
For example, GOTO/ PAT1, RETAIN, 2, THRU, 6 would cause the cutter to move to the 2, 3, 4, 5, and 6
points of PAT1.
When using the THRU modifier, the range does not have to be specified in the order of movement. For
example, GOTO/ PAT1, RETAIN, 6, THRU, 2 would also cause the cutter to move to the 2, 3, 4, 5 and 6
points of PAT1.
4.6.6. CONST Modifier
The CONST modifier allows the programmer to specify the point numbers for the OMIT, RETAIN, or
AVOID modifiers according to the definition order instead of according to the output order.
The example in Figure 4.8 illustrates the use of this modifier. GOTO/ PAT1, INVERS, RETAIN, 2, THRU,
4, 6, 8 and GOTO/ PAT1, INVERS, CONST, RETAIN, 11, THRU, 9, 7, 5 will both cause the cutter to
move to the points numbered 11, 10, 9, 7, 5.
Figure 4.8. Sample Pattern 1
4.7. Point-Point Programming Considerations
INVERS, AVOID, and either RETAIN or OMIT may be combined in a single GOTO/ SPAT statement. The
following considerations further explain the effect of combining these modifiers.
4.7.1. Ordering of the Operations Performed on a Pattern
The order of operations (OMIT/RETAIN or AVOID) must be specified in the output sequence of the points.
For example, an AVOID is to occur between the fourth and fifth points of a pattern, the seventh point is to
be omitted, and another AVOID is to occur between the tenth and eleventh points. The modifiers may be
stated as follows:
GOTO/ SPAT, AVOID, 3, 4, OMIT, 7, AVOID, 3, 10
It is permissible to overlap a range of operations of one type with a single operation of another type. For
example, if the fourth through the tenth points and the twelfth through the fifteenth points were to be
retained and AVOID was to occur between the thirteenth and fourteenth points, the following statement
would be permissible:
GOTO/ SPAT, AVOID, 2, 13, RETAIN, 4, THRU, $
10, 12, THRU, 15
If an AVOID was to occur between the sixth and seventh points and the eighth and ninth points, however,
the following statement would be used:
GOTO/ SPAT, RETAIN, 4, THRU, 10, AVOID, 2. 5, $
6, 8, RETAIN, 12, THRU, 15
Chapter 5. Programming a Tool Path
The APT language can be used to direct a cutter along a predetermined path. This chapter introduces the
fundamental language concepts required to accomplish this task. Expansion of some of the more complex
concepts and definition of additional language features are made in Chapter 14. Guidelines and suggested
procedures are stated only in general, since experience is the only way good techniques and reliable methods
are formulated.
Experience in the numerical control industry has shown that the geometric problems involved in APT must
be solved using iterative techniques. Other mathematical approaches are specific in nature and fail to
achieve the necessary degree of generality. Even the more desirable iterative approach used in this processor
may fail in unforeseeable situations. In such circumstances minor part program modifications can be made
to achieve the required results.
5.1. Introduction
Even a brief description of how the tool motion is controlled depends upon an understanding of several
concepts. The individual notations are discussed in Section 5.1.1 through Section 5.1.3, and there
relationships are discussed in Section 5.1.3.4.
5.1.1. Description of Cutter
The cutter shape must be defined before any cutter motion can be specified. The format of the statement that
defines the cutter is:
CUTTER/ d, r, e, f, , , h
Note
The parameters are as shown in Figure 5.1. The parameters must all be positive and and must be
between 0 and 90 (degrees).
Figure 5.1. CUTTER Parameters
Two alternative forms of the CUTTER statement can be used for simple cutters. These are:
CUTTER/ d
CUTTER/ d, r
The first alternate form defines either a ball or a filleted-end mill; the second specifies a flat-end mill (see
Figure 5.2 for examples). When these forms are used, the following assumptions are made by the APT
processor:
and are set equal to zero
f is set equal to r (in the second form, both are zero)
e is set equal to d / 2 - r
h (the tool height) is set to 5 (if r is less or equal to 5 or not given) or to r (if r is greater than 5)
Figure 5.2. Simple CUTTER Examples
5.1.2. Tolerance Specification
The APT language requires that the accuracy to which the part is to be machined must be defined. This is
done with the following statements:
INTOL/ t1
OUTTOL/ t2
TOLER/ t3
INTOL is defined as the amount by which the cutter can violate (gouge) the surface. OUTTOL is the
amount of excess stock that is permissible. Either OUTTOL or INTOL may be zero, but not simultaneously.
If neither is specified, OUTTOL is set to .0005, and INTOL is set to zero, unless TOLER was specified.
Then, OUTTOL is set equal to TOLER and INTOL is set to zero.
The Tolerance commands are modal; that is, they remain in effect for all subsequent motion statements until
another tolerance specification is given. Figure 5.3 depicts various tolerance specifications. Section 5.5
discusses an expanded tolerance statement.
Figure 5.3. CUTTER Tolerance
5.1.3. Surface Nomenclature
More than one geometric surface is usually involved in positioning a cutter in space. Therefore, the
following nomenclature is used to distinguish between surfaces that are simultaneously related to the cutter.
Figure 5.4. Surface Nomenclature
5.1.3.1. Part Surface
The part surface (PS) is one of two surfaces with which the cutter is in continual contact (within tolerance)
during a given machining motion. The PS is usually the surface that controls the depth of the cut (see
Figure 5.4).
5.1.3.2. Drive Surface
The drive surface (DS) is the second surface with which the cutter is in continual contact (within tolerance)
during a given machining motion. The DS guides the cutter through space, while a given relationship is
maintained between the cutter and the PS (see Figure 5.4).
5.1.3.3. Check Surface
The check surface (CS) is the limiting surface for a given motion statement. The cutter maintains a specified
relationship with the PS and DS until it reaches a given condition with regard to the check surface. When
this occurs, a new motion statement can be specified (see Figure 5.4).
5.1.3.4. Basic Problem Description
The surfaces to be machined are defined exactly by the processor. However, most N/C machines are capable
of moving only in a straight line. Therefore, a series of straight lines that approximate the desired contour
within tolerance must be generated. Each individual straight-line movement is called an "elementary cut
vector" A string of these movements that complete the motion defined by a given PS, DS and CS
combination is called an "elementary cut sequence"
For example, the cutter is located initially in space with regard to a PS and a DS. A given relationship is
described with regard to the PS. Then, the cutter is guided through space by the DS, maintaining the defined
relationship with the PS until a specific condition is reached with regard to the CS. As many elementary cut
vectors as required will be generated to maintain the specified tolerance.
5.2. CUTTER to Surface Relationships
The relationship between the cutter and each of the constituent surfaces must be established. This
relationship need not be the same for all the surfaces involve in a given elementary cut sequence, but it must
be clearly defined in the part program. The relationship is modal for the part and drive surfaces; that is, once
it has been specified, it is in effect until another specification is given.
5.2.1. Part Surface
The two vocabulary words that describe the relationship of the cutter to the part surface are TLONPS and
TLOFPS. TLONPS specifies that the tool end is to be located on the part surface (see Figure 5.5); TLOFPS
is assumed if neither is specified.
Figure 5.5. TLONPS
TLOFPS specifies that the tool end is to be located off the part surface. The too is tangent to the part surface
at some other point, as indicated by the tool configuration and the relationship of the tool to the drive surface
(see Figure 5.6).
Figure 5.6. TLOFPS
5.2.2. Drive Surface
The following APT words describe the relationship of the tool to the drive surface.
TLLFT
TLRGT
TLON
TLNDON
These modifiers are applied with regard to the direction of tool motion; that is, "left" means on the left of the
surface looking in the direction in which the tool is moving. Thus, TLLFT means place the tool tangent to
the surface on the left, and TLRGT means position the tool tangent to the surface on the right (see
Figure 5.7). TLON and TLNDON both specify that the end of the tool is to be on the surface. If no other
specification is given, TLON is assumed (see Figure 5.8).
Figure 5.7. TLLFT, TLRGT
Figure 5.8. TLON, TLNDON
5.2.3. Check Surface
The following APT words describe the relationship of the tool to the check surface.
TO
ON
PAST
TANTO
DSTAN
PSTAN
These modifiers apply when viewed from the tool to the check surface. TO indicates the cutter is to be
tangent to the check surface on the near (cutter) side. ON means the final cutter position is to be on the
check surface. PAST specifies the cutter is to be tangent to the check surface on the far (opposite the cutter)
side. If no modifier is given, TO is assumed (see Figure 5.9).
Figure 5.9. Check Surface to Cutter Relationships
The TANTO specification is to be used when the cutter motion is to be terminated at a point where the drive
surface is tangent to the check surface (see Figure 5.10). (The vocabulary word DSTAN may be used in
place of TANTO and the results would be identical.)
Note
Refer to Section 5.4.2.2 for further comments concerning TANTO.
Figure 5.10. TANTO
The PSTAN specification indicates the cutter motion is to terminate at a point where the part surface is
tangent to the check surface (see Figure 5.11).
Figure 5.11. PSTAN
5.3. Startup Procedures
The tool must be positioned properly with regard to the part surface and drive surface before any statement
can be given involving motion along these surfaces. Usually, the location of such a starting position is not
defined explicitly. This section discusses the startup procedures available to orient the cutter in space
properly.
5.3.1. Initialization
The tool must have a specific coordinate location before a command involving movement of the tool is
given. This is accomplished initially with a FROM command (see Section 4.1); subsequently, the location is
the final position after executing the last programmed movement.
In addition to a coordinate location, a sense of direction must be established. This can be done by one of the
following.
Specifying a point-to-point command (GOTO, GODLTA). The sense of direction is the direction
resulting from moving the tool to the specified location.
Specifying a previous command involving motion with regard to part, drive and check surfaces. The
sense of direction is taken to be the direction of the last cut vector in the cut sequence.
Specifying either an INDIRV/ or an INDIRP/ statement.
5.3.1.1. INDIRV
The general format for the INDIRV statement is:
INDIRV/ svector
The INDIRV statement indicates that the forward direction of the tool is the same as that of the vector
specified to the right of the slash (see Figure 5.12 for an example). Section Section 14.2 discusses an
expanded INDIRV statement.
Figure 5.12. INDIRV
VECA = VECTOR/ .8660254, 0, .5
FROM/ PTA
INDIRV/ VECA
5.3.1.2. INDIRP
The general format of the INDIRP statement is:
INDIRP/ spoint
A vector is established which originates at the current tool location and is directed toward the point defined
to the right of the slash in the INDIRP statement. This vector establishes the forward direction of the tool.
See Figure 5.13 for an example. Chapter Chapter 14 discusses an expanded INDIRP statement.
Note
The current tool location and the INDIRP point must not be identical.
Figure 5.13. INDIRP
FROM/ PTB
INDIRP/ PTC
5.3.2. GO Surface Command
The GO/ statement is used to position the cutter with regard to one, two, or three surfaces. The general
format is:
The positional modifiers TO, PAST, and ON (See Figure 5.14) indicate the relationship of the tool with
regard to the following surface in the GO/ statement. As viewed from the current location of the tool, the
final position of the tool for each modifier is:
TO
Tangent to the surface near (cutter) side.
PAST
Tangent to the surface far (opposite cutter) side.
ON
Tool end is on the indicated surface.
Figure 5.14. Position Modifiers TO, ON, PAST
FROM/ PTA
GO/ TO, S1
FROM/ PTB
GO/ ON, S2
FROM/ PTC
GO/ PAST, S3
The first surface to the right of the slash is the DS, the second is the PS, and, if given, the third surface is
called the startup check surface (CS). The third surface is used if it is necessary too specify more exactly
where the cutter is to be positioned. The cutter will be required to be positioned with regard to the CS as
well as the DS and PS. When the GO/ statement references only one surface (the DS), the APT processor
will position the cutter with respect to the specified DS and the current PS, if one has been defined. If no PS
has been defined, the XY-Plane is used as a PS to position the cutter properly.
5.3.2.1. One-Surface Startup
The format of the one-surface startup is:
The final cutter position will be at the indicated relationship (TO, ON, PAST) with the specified surface.
The direction in which the cutter moves is determined as follows:
The normal movement is such that the final tool position also satisfied a TO condition with regard to
the part surface (if no part surface has been defined, the XY-Plane is assumed). See Figure 5.15 for
examples.
The vocabulary word NOPS used before a one-surface startup causes the processor to ignore the part
surface and move only with regard to the surface designated in the GO/ statement. The final cutter
position is calculated such that the shortest possible movement is made from the current tool position
to the new one (see Figure 5.16 for examples).
Figure 5.15. TO, ON, PAST in One-Surface Startup
FROM/ PTA
PSIS/ S1
GO/ TO, S2
FROM/ PTA
PSIS/ S1
GO/ ON, S2
FROM/ PTA
PSIS/ S1
GO/ PAST, S2
Figure 5.16. NOPS in One-Surface Startup
FROM/ PTA
NOPS
GO/ TO, S1
FROM/ PTA
NOPS
GO/ ON, S1
FROM/ PTA
NOPS
GO/ PAST, S1
A problem may arise when the NOPS feature is used. A previously defined part surface, although ignored
when executing the startup, is still in effect for later motion statements. Upon completion of the startup
command, any attempt to move the cutter with a motion instruction results in failure if the cutter is not
within tolerance of the part surface.
Directed One-Surface Startup. Use of an INDIRV or an INDIRP statement with a NOPS command
indicates the cutter is to move exactly in the direction of the vector to the referenced surface without regard
to the ""shortest" or minimum movement (see Figure 5.17 for an example). Caution must be exercised when
using this feature of the processor, since it is easy to specify an impossible condition (see Figure 5.18 for
such a case). If a NOPS is not used, a part surface is in effect, and the INDIRV vector is used as an aid in
determining the general move in the direction of the referenced surfaces.
Figure 5.17. INDIRV or INDIRP with NOPS
FROM/ PTA
INDIRV/ VECA
NOPS
GO/ S1
Figure 5.18. Impossible One-Surface Startup
FROM/ PTA
INDIRV/ V1
NOPS
GO/ C1
The cutter will not necessarily move exactly in the vector direction because of the added restraint of having
to move within tolerance of the referenced surface and the part surface (see Figure 5.19 for an example).
Figure 5.19. Actual INDIRV Move
FROM/ PTA
PSIS/ PS
INDIRV/ V1
GO/S1
5.3.2.2. Two-Surface Startup
The format of the two-surface startup is:
The cutter is moved the shortest possible distance to the required relationship with the specified surfaces.
The second surface automatically becomes the part surface for later motion commands.
Examples of the possible combination of cutter positions are given in Figure 5.20.
Figure 5.20. Possible Two-Surface Startup Positions
FROM/ PTA
GO/ TO, S1, TO, S2
FROM/ PTA
GO/ TO, S1, ON, S2
FROM/ PTA
GO/ TO, S1, PAST, S2
FROM/ PTA
GO/ ON, S1, TO, S2
FROM/ PTA
GO/ ON, S1, ON, S2
FROM/ PTA
GO/ ON, S1, PAST, S2
FROM/ PTA
GO/ PAST, S1, TO, S2
FROM/ PTA
GO/ PAST, S1, ON, S2
FROM/ PTA
GO/ PAST, S1, PAST, S2
Use of INDIRV or INDIRP. An INDIRV or INDIRP used before a two-surface startup establishes a
"guiding" direction to be used in locating the proper final position. The tool will not necessarily move in the
referenced direction, since it must satisfy the given surface requirements. This feature permits proper
selection of the desired position from among more than one possibility. Figure 5.21 depicts the situation
where either PTB or PTC could be the result from a straight GO/ CIRC1, CIRC2 command -- the INDIRV is
used to show that PTC is the desired point.)
Figure 5.21. Two-Surface Startup INDIRV
FROM/ PTA
INDIRV/ V1
GO/ CIRC1, CIRC2
5.3.2.3. Three-Surface Startup
The format of the three-surface startup is:
The tool is moved to the closest position at which it can satisfy the given relationships. The TANTO
modifier can be used with the third surface only, and indicates that the second and third surfaces are tangent
at the desired tool location. An example of a three-surface startup is shown in Figure 5.22.
Figure 5.22. Three-Surface Startup
GO/ TO, SURF1, PAST, SURF2, ON, SURF3
Use of INDIRV or INDIRP. INDIRV or INDIRP has the same meaning with a three-surface startup as
with a two-surface startup. It is used only to establish a general looking direction and does not necessarily
define the actual tool movement (see Figure 5.23).
Figure 5.23. Three-Surface Startup with INDIRV
INDIRV/ V3
GO/ TO, SURF1, TO, SURF2, TO, SURF3
5.3.3. The OFFSET/ Statement
The OFFSET/ statement is used to provide additional means of controlling the final cutter position in a
startup situation. The format of the OFFSET/ statement is as follows:
Note the following items concerning the OFFSET/ statement.
The first surface to the right of the slash is the DS.
The second surface to the right of the slash, if specified, is the PS.
If the second surface is not specified, the previously defined PS is used, unless NOPS has bee given.
The OFFSET/ statement must be preceded by an INDIRV or INDIRP statement.
The specified direction from the INDIR statement must be such that a vector in that direction from
the current cutter location intersects the DS specified in the OFFSET/ statement.
The APT processor performs the following operations for the OFFSET/ statement:
1.
2.
3.
4.
5.
The vector defined by the INDIRV/ or INDIRP/ statement is used to intersect the drive surface.
At the point of intersection, the normal to the drive surface is found.
The cutter is moved along the surface normal until it is in valid position (TO, ON, or PAST).
If NOPS was specified, the resultant point from step 3 is the final output point.
When a part surface is in effect, either implicitly or explicitly, the cutter is moved (from the resultant
location of step 3) directly along its axis until the proper position (TO, ON, or PAST) is reached with
respect to the part surface. Only the final point is output for later processing.
Figure 5.24 and Figure 5.25 illustrate the usage of OFFSET/.
Figure 5.24. One-Surface OFFSET
FROM/ PTA
INDIRV/ VECA
OFFSET/ TO, SURF1
Figure 5.25. Two-Surface OFFSET
FROM/ PTA
INDIRV/ V1
OFFSET/ PAST, CYL, TO, PS
5.4. Motion Commands
A general motion command is used to describe the relationship of the cutter and the surfaces, once the
proper initial conditions have been attained. A general motion command differs from a positioning
command (that is, GOTO, GODLTA, GO, OFFSET) in that an entire cutting sequence is generated, rather
than a single cutter movement. Further, material is generally being removed with a set of MOTION
commands -- usually this is not so with a positioning command.
5.4.1. General Form
The basic general from of a motion command is as follows:
where:
TLLFT, TLRGT, TLON, and TLNDON are positional modifiers that describe the relationship between the
tool and the drive surface. When one of these modifiers is used, it remains in effect with later motion
statements until a new modifier is encountered. The meaning of each modifier is given in Section 5.2.2.
TLONPS and TLOFPS are positional modifiers that describe the relationship between the tool and the part
surface. When specified, they remain in effect until a new modifier is found. When neither has been
specified, TLOFPS is assumed (see Section 5.2.1).
GOLFT, GORGT, GOUP, GODOWN, GOFWD and GOBACK are directional modifiers that select the
proper path of travel. These modifiers, one of which must be present on any motion statement, are described
in Section 5.4.2.
SURF1 is the drive surface for this motion command. The concept of a drive surface was explained in
Section 5.1.3.2. TO, ON, PAST, and TANTO define the relationship of the final cutter position with regard
to the surface that follows in the motion statement. If none is used, TO is assumed. These modifiers are as
defined in Section 5.2.3.
SURF2 is the check surface for this motion command. The concept of a check surface was explained in
Section 5.1.3.3.
The reset of the general statement contains information regarding multiple check surfaces. This concept is
introduced in Section 5.4.3.4.
5.4.2. Directional Modifiers
At the completion of an elementary cut sequence, a new sequence can be started immediately, provided an
indication of the direction (or branch) the tool is to select has been defined. For instance, in Figure 5.26 a
startup sequence resulted in locating the cutter at PTB. The cutter is to be moved along CIRC1 (within
tolerance) until the cutter center is on CIRC2. There are two possible routes: move clockwise around CIRC1
to PTC, or move counter-clockwise around CIRC1 to PTD. Both choices satisfy the given requirements.
Therefore, a direction modifier is needed to delineate the specified motion. Three pairs of such modifiers are
available in the APT language: GOLFT, GORGT, GOFWD, GOBACK, and GOUP, GODOWN.
Figure 5.26. Directional Modifiers
5.4.2.1. GOLFT, GORGT
The modifiers GOLFT and GORGT indicate the cutter is to turn left or right, respectively, at the designated
intersection. The meaning of left and right is determined by viewing the cutter path from the current
reference point. Figure 5.27 indicates the implication of left and right in this sense. GORGT would cause the
movement along S1 toward PL2, while GOLFT would cause the cutter to move toward PL1.
Figure 5.27. GOLFT, GORGT Nomenclature
FROM/ PTA
GO/ ON, S1
TLON, GORGT/ S1
$$ or
FROM/ PTA
GO/ ON, S1
TLON, GOLFT/ S1
In Figure 5.26 the instructions:
FROM/ PTA
GO/ ON, CIR1
TLON, GOLFT/ CIRC1, ON, CIRC2
would result in motion being terminated at PTC, while GORGT in the last statement would yield PTD. The
results are shown in Figure 5.28.
Figure 5.28. GOLFT, GORGT Example
5.4.2.2. GOFWD, GOBACK
Example 5.1 shows where neither GOLFT nor GORGT could be used. Making the transition between
LINEA and CURVA does not involve either a left or a right turn with regard to the current direction of
travel. However, it does consist of a continuation of the current forward movement of the cutter. Hence,
GOFWD is the proper modifier.
Example 5.1. GOFWD Usage
FROM/ PTA
GO/ ON, LINEA
TLON, GOLFT/ LINEA, TANTO, CURVA
GOFWD/ CURVA, TO, LINEB
The general concept of the modifiers GOFWD and GOBACK is shown in Figure 5.29. GOFWD would
cause movement along S1 toward PL1; GOBACK would cause the cutter to be directed toward PL2.
Figure 5.29. GOFWD, GOBACK General Concept
FROM/ PTA
GO/ ON, PL5
TLON, GOLFT/ PL5, TANTO, S1
GOFWD/ S1
$$ or
FROM/ PTA
GO/ ON, PL5
TLON, GOLFT/ PL5, TANTO, S1
GOBACK/ S1
5.4.2.3. GOUP, GODOWN
In isolated circumstances, neither GORGT, GOLFT nor GOFWD, GOBACK describe the desired motion
adequately. Then, and only then should GOUP or GODOWN be used.
The previous directional modifiers were applied with regard to the current sense of direction of the cutter
motion GOUP and GODOWN, however, are applied with regard to the tool axis. GOUP specifies that the
motion is to be in a direction similar to withdrawing the tool (that is, move up the tool axis). GODOWN
specifies that the motion is to be in a direction similar to plunging the tool (that is, move down the tool axis).
The use of GOUP and GODOWN does not replace the current sense of direction if the movement resulting
from the GOUP or GODOWN is directly along the tool axis. The sense of direction for later motion
commands will be taken as that of the last motion command which did not result in a motion directly along
the tool axis. Figure 5.30 shows the use of GOUP and GODOWN.
Figure 5.30. GOUP, GODOWN Usage
FROM/ P1
GO/ PLB, ON, PL, PLA
TLONPS, GODOWN/ PLB, PLC
GOFWD/ PLC, PLD
Note
When using GOUP and GODOWN, an implicit check surface (see Section 5.4.3.3) is not allowed.
Where the GOUP, GODOWN directional modifier appears must be designated explicitly in the motion
command.
5.4.3. Surface Specification
The surfaces involved in the execution of a motion command most be properly designated as to which is the
part surface (PS), drive surface (DS), and the check surface (CS). The alternatives available to identify the
surfaces properly are discussed in the following sections.
5.4.3.1. Part Surface (PS)
The part surface must be defined before any motion statements. The XY-Plane is used as the part surface if
one has not been defined explicitly. The part surface designation is in effect until a new surface is so
designated. There are three ways to define a part surface explicitly -- with a PSIS statement, with an
AUTOPS statement, or with a two- or three-surface startup/command.
1. PSIS
The format of a PSIS statement is as follows:
PSIS/ SURF1
This statement indicates that SURF1 is the part surface that is to be in effect until a new one is
defined.
2. AUTOPS
The vocabulary word AUTOPS, appearing by itself as a complete APT statement, causes the
processor to define a plane parallel to the XY-Plane at the current Z-height of the tool. This plane
becomes the part surface and is in effect until a new one is defined (see Figure 5.31 for an example).
Figure 5.31. AUTOPS Usage
FROM/ PTA
INDIRV/ VECA
NOPS
GO/ S1
AUTOPS
3. Multisurface GO/ command
The second surface indicated in a multisurface GO/ statement is defined as the part surface (see
Section 5.2). This surface is in effect as a part surface until a new one is defined.
5.4.3.2. Drive Surface (DS)
The drive surface must be defined explicitly in each motion command. It is the first surface specified to the
right of the slash in the motion statement. It cannot be defined implicitly, and is not modal.
5.4.3.3. Check Surface (CS)
Check surfaces can be defined either explicitly or implicitly. If more than one surface is given in a motion
command, the second and later surfaces are defined as check surfaces. If only one surface was specified, the
first surface in the following motion command is used as the check surface for the current movement.
Figure 5.32 shows a desired series of cutter movements, together with two sets of motion commands that
would work properly. In the first set, each motion command has two surfaces associated with it. The second
surface is then the check surface in each instance. However, in the second set, statements labeled C and D
have only one surface specified. Therefore, the first surface in the following statements, D and E,
respectively are used as check surfaces. This results in the same movement as was obtained with the first set
of instructions.
Figure 5.32. Check Surface in Motion Command
A)
B)
C)
D)
E)
FROM/ PTA
GO/ PLANEA, PL3
TLLFT, GOLFT/ PLANEA, TO, CURVEB
GOLFT/ CURVEB, TO, PLANEC
GOLFT/ PLANEC, TO, PLANED
$$ OR
A)
B)
C)
D)
E)
FROM/ PTA
GO/ PLANEA, PL3
TLLFT, GOLFT/ PLANEA
GOLFT/ CURVEB
GOLFT/ PLANEC, TO, PLANED
5.4.3.4. Multiple Check Surfaces
There are instances when the exact check surface designation is not precisely known. The APT processor
can determine which of several possible check surfaces is encountered first. On the basis of the results, the
processor will transfer to the location in the program defined by the statement identification following the
check surface in the given motion command. For example, if the motion command was GOLFT/ S1, TO, S2,
ID1, ON, S3, ID2, the processor would GO left along the surface S1 until it was "TO" the surface S2 or
"ON" the surface S3, whichever occurred first. If "TO" S2 occurred first, the processor would transfer to the
part program statement with the label "ID1" If, however, "ON" S3 happened first, the transfer would be to
the statement labeled "ID2"
Figure 5.33 and Figure 5.34 show a situation whereby the selection of the proper check surface depends on
the size of the cutter used. In the first instance, a small tool results in PL2 being the first surface reached.
The second case shows that a larger tool would meet PL3 first. (See Section 14.1.7 for further usage.)
Figure 5.33. Check Surface with Small Cutter
Figure 5.34. Check Surface with Large Cutter
5.5. Expanded Tolerance Statement
There are situations where tolerance on the surfaces being machined is not the same for each surface. The
amount of tolerance for each surface can be specified using an expanded tolerance statement, as indicated
below:
OUTTOL/ tolps [, tolds] [, tolcs] [, tolcs1]
INTOL/ tolps [, tolds] [, tolcs] [, tolcs1]
TOLER/ tolps [, tolds] [, tolcs] [, tolcs1]
In each instance the four parameters indicated to the right of the slash have the following meaning:
tolps
tolerance to the part surface
tolds
tolerance to the drive surface
tolcs
tolerance to the check surface
tolcs1
tolerance to the second check surface (if any)
If fewer than four tolerances are specified, the processor takes the last specified tolerance and applies it to
the remaining fields. For example OUTTOL/ .005 would result in the same tolerance as OUTTOL/ .005,
.005, .005, .005; and INTOL/ .1, .2, .3 would be the same as INTOL/ .1, .2, .3, .3 and so on.
As was the case in the FROM and GOTO statements, a feed rate can be specified in any general motion
command by adding a scalar variable or number to the end of the statement. For example:
TLLFT, GORGT/ S1, TANTO, S2, 10.0
The feed rate for this command will be 10.0 inches/minute, and it will be in effect until another feed rate is
specified.
Chapter 6. Postprocessor Statements
Table of Contents
6.1. Postprocessor Commands without Parmeters
6.2. Postprocessor Commands with Parmeters
6.3. Fixed-Field Words
6.4. Special Feedrate Option
The APT language provides the part programmer with a means of controlling certain functions at the
machine tool that are auxiliary to the cutter-part relationship. For instance, through proper part program
statements, the feed fate is controlled, the spindle rpm can be selected, the coolant can be turned on and off,
and if the machine is so equipped, the tool can be changed--all automatically.
There are capabilities and restrictions peculiar to almost every machine tool-control system combination in
use today. As a result, not all systems recognize all the postprocessor words available in the APT language.
Further, different postprocessors may interpret the same word in a variety of ways. For these reasons, the
definition of the postprocessor vocabulary words is meaningful only in the environment of a particular
postprocessor. However, certain classifications and rules can be stated concerning the use of such words.
6.1. Postprocessor Commands without Parmeters
Certain postprocessor words are definitive without additional information. For example, the usual meaning
conveyed by two of these words is as follows:
END
This is the end of a logical section of a part program. Turn off all the auxiliary functions, stop the
reader, and thus, the machine tool.
STOP
Stop the reader and machine tool at this point to permit changing of clamps, inspection of cutter, etc.
The following is a list of postprocessor words without parameters.
DRAWLI
DRESS
END
FACEML
GOCLER
GOHOME
ISTOP
LOCKX
OPSTOP
PENUP
PENDWN
PROBY
PROBX
RAPID
RESET
RETRACT
REWIND
STOP
SWITCH
UNLOKX
UNLOAD
ZERO
6.2. Postprocessor Commands with Parmeters
Certain postprocessor words require additional information to convey any meaning to the processor. The
general form is WORD/parameters, where the parameters are scalars, floating-point numbers, or vocabulary
words. Examples of these parameters are
FEDRAT/ f
where f is a scalar or floating-point number. This statement indicates the desired feed rate that should be
used for best finish, chip removal, etc. The actual feed rate will be as close to f as possible without
exceeding the dynamic limitations of the machine tool (overshoot, synchronization, etc.).
The first four modifiers turn the coolant on in a variety of ways; the last modifier specifies that the coolant is
to be turned off.
Four of the postprocessor words with modifiers affect other parts of the processor, in addition to the
postprocessor. They are: MACHIN, INDEX, COPY, and TRACUT. A full discussion of these special words
appears later in the manual.
The APT processor will allow any combination of vocabulary modifier words, floating-point numbers,
arithmetic expressions, and scalar symbols as minor modifiers except where an alphanumeric string of
characters or other restrictions are specified.
The following is a list of postprocessor words that require parameters, together with sample parameters that
are used by many postprocessors.
ASLOPE/ n, ...
CHECK/ x, y, z, AUTO
CLAMP/ n
Note
For a discussion of COPY, see Section 13.2
CORNFD/ n, ...
COUPLE/ n, ...
CYCLE/ n, ...
DELAY/ t
DISPLAY/ C1, C2, C3, ..., CN
DRAFT/ n, ...
DWELL/ n, ...
Note
For more on FEDRAT, see Section 6.4.
IFRO/ n, ...
INDEX/ i
Note
For a discussion of INDEX, see Section 13.2.
INSERT Alphanumeric string of characters
INTCOD/ n
LEADER/ n
LETTER/ x, y, s, n
LOADTL/ n, ...
LPRINT/ n, ...
MACHIN/ Name, n1, n2, etc.
Where Name is the appropriate postprocessor title (see Section 7.3.2).
MAGTAP/ n, ...
MAXVEL/ n, ...
MCHTOL/ e
MCHFIN/ e
MDEND/ n, ...
MDWRIT/ n, ...
MODE/ n, ...
MOVETO/ n, ...
ORIGIN/ x, y, z
OVPLOT/ n
PARTNO Alphanumeric string of characters
Note
For more on PARTNO, see Section 7.1.2.
PBS/ n, ...
PITCH/ n, ...
PIVOTZ/ z
PLABEL/ n, ...
PLUNGE/ d, f
INT Alphanumeric string of characters
PREFUN/ n, ...
REGBRK/ n, ...
REWIND/ n, ...
SELCTL/ n, ...
SEQNO/ n
SLOWDN/ n, ...
THREAD/ n, ...
Note
For a discussion on TRACUT, see Chapter 13.
TRANS/ x, y, z
VTLAXS/ n, ...
Note
For a discussion on VTLAXS, see Section 13.4.
WCORN/ n, ...
Note
For a discussion on WCORN, see Section 13.4.
6.3. Fixed-Field Words
The following words transmit alphanumeric information to the postprocessor and must appear in columns 1
through 6 of the original input card.
PPRINT
INSERT
PARTNO
A full discussion of these words appears in Section 7.1
6.4. Special Feedrate Option
The majority of the postprocessor words discussed in this section have no effect on the operation of the basic
processor. They are simply transmitted to the postprocessor, which performs the necessary calculations to
achieve the desired results.
The one major exception to the above general rule is a special feed rate option.
The general format used to exercise this option is:
The significance of each of these three statement formats is:
FEDRAT/ fb
The desired feed rate is fb, and it should be maintained constant at fb until respecified. This is a
normal feed rate condition.
FEDRAT/ fb, dm, fm
The basic feed rate is to be fb. However, at a distance dm from each check, surface, the feed rate is to
be changed to fm. After the check surface is reached, the feed rate reverts to fb. This is a modal
override condition.
FEDRAT/ d1, f1
The previously specified basic feed rate is to be used until distance d1 from the check surface, at
which time the feed rate is changed to f1. The basic feed rate is to be restored after the CS is reached.
This is a one-shot override. That is, the feed rate change is to take place only for the next check
surface approach. Thereafter, the processor reverts to whatever mode was previously in effect, either
basic only or modal override.
The following rules apply to the special feed rate option.
Feedrate overrides occur only as check surfaces are approached, that is, as the result of GOLFT/,
GORGT/, GOFWD/, GOBACK/, GOUP/ or GODOWN/ commands. GO/, GOTO/, GODLTA/
,OFFSET, and POCKET/ motions will not be affected by the feed rate overrides.
The distance from the check surface (dm or d1) at which the feed rate change is to occur may in
some cases be greater than the total distance to the check surface for a given cut sequence. (A cut
sequence is defined as the resultant motion from a single GOXXX command.) If this occurs, the
processor will change the feed rate before the entire cut sequence, and the total motion for that
sequence will be at the appropriate fm or f1 value. No diagnostic message is issued.
The basic feed rate fb may be established either with the FEDRAT/ statement or by tagging the
motion commands FROM/, GOT, GODLTA, or GOXXX as described in Section 4.1, Section 4.2,
Section 4.3, and Section 5.7. Any such basic feed rate specification destroys a modal override
condition, and restores a normal condition.
The distance from the check surface at which the feed rate is to be changed must be short enough
that no more than 70 cut vectors (35 if MULTAX is in effect) are required to reach the check surface
after the feed rate change occurs. If this condition is not met, the feed rate change will occur closer to
the check surface than specified. No diagnostic message is given.
Chapter 7. Special Words in the APT Language
Table of Contents
7.1. Fixed-Field Words
7.1.1. The REMARK Statement
7.1.2. The PARTNO Statement
7.1.3. The PPRINT Statement
7.1.4. The INSERT Statement
7.1.5. The TITLES Statement
7.2. The Auxiliary Symbol Definition (OBTAIN) Statement
7.3. APT Processor Control Words
7.3.1. The NOPLOT Statement
7.3.2. The MACHIN Statement
7.3.3. The NOPOST Statement
7.3.4. The CLPRNT Statement
7.3.5. The CLTV Statement
7.3.6. The PTONLY Statement
7.3.7. The FINI Statement
The APT vocabulary words discussed in this chapter either have special effect on the APT processor or
require certain precautions to be exercised in their use, or both.
7.1. Fixed-Field Words
The APT words covered in this section are the only vocabulary words in the APT language that are required
to be in specific card columns. Each of these words is six characters in length and must appear in columns 1
through 6. Columns 7 through 72 are used to define an alphanumeric string of characters. These vocabulary
words are REMARK, PARTNO, PPRINT, INSERT and TITLES.
7.1.1. The REMARK Statement
The REMARK statement is used only to indicate part program commentary. A string of any alphanumeric
characters is permitted in columns 7 through 71. The REMARK statement is printed out with the other APT
statements that comprise the part program; from then on it has no other effect on the APT processor or the
part program. This feature allows inclusion of explanatory information at key locations in the part program.
Note
See double dollar and single dollar for more on program commentary.
7.1.2. The PARTNO Statement
The string of alphanumeric characters that appear in columns 7 through 72 of the PARTNO statement is
passed on to later phases of the APT processor for labeling and identification purposes. The postprocessor
phase of the APT processor generally uses this information to identify the punch output resulting from the
postprocessor.
7.1.3. The PPRINT Statement
The string of alphanumeric characters that appear in columns 7 through 72 of the PPRINT statement is
passed on to later phases of the APT processor for purposes of part programmer commentary. The
postprocessor phase usually makes use of this APT feature. The PPRINT statement has no other effect in the
phases of the APT processor where it is used.
7.1.4. The INSERT Statement
The string of alphanumeric characters that appear in columns 7 through 72 of the INSERT statement us used
in the postprocessor phase of the APT processor as direct output to the machine tool. Thus, the INSERT
statement provides a means for inserting manually coded commands in the midst of the automatic
calculations provided by the postprocessor. In this context, care must be exercised when using the INSERT
statement. Some postprocessor use this information to energize a display device on the machine tool which
provides machine tool operator guidance on the procedures to be followed during the machining of the part.
7.1.5. The TITLES Statement
The TITLES statement us used exclusively during the compiler phase of the APT processor. The
alphanumeric information is to be used by the part programmer to serve as a heading for the tabular
information that is to be generated by later PRINT statements in the part program. The TITLES statement
must be followed by a PRINT statement; otherwise it will have no effect on the output of the APT system.
For a full discussion of the use of TITLES and PRINT in the APT program, see Section 11.1.
7.2. The Auxiliary Symbol Definition (OBTAIN) Statement
The OBTAIN statement defines (or assigns a value to) a scalar variable with reference to a particular
geometric type. The general form of the OBTAIN statement is:
OBTAIN, type/ S1, [a], [b], [c], etc.
The foregoing statement defines the scalar variable a, b and c as follows:
a
The value of the first parameter of the canonical form of S1.
b
The value of the second parameter of the canonical form of S1.
c
The value of the third parameter of the canonical form of S1.
The following rules are to be observed when using the OBTAIN statement.
The surface type given must correspond to the surface type S1.
Commas to the right of S1 denote position. Hence, care must be exercised in specifying the number
and positions of the commas.
The variables a, b and c must be scalar variable.
The number of parameters referred to in the OBTAIN statement cannot exceed the total number of
parameters in the canonical form of the referenced surface type (see Chapter 16 for a discussion of the
canonical form for the various APT surfaces).
Example 7.1. OBTAIN Usage
C1 = CIRCLE/ PT1, PT2, PT3
OBTAIN/ CIRCLE/ C1, X, Y, , , , , RAD
The first statement defines C1 as a circle through the three points PT1, PT2 and PT3. The OBTAIN
statement is then used to define the scalar variables X, Y and RAD as follows:
X
The X coordinate for the center of the circle C1
Y
The Y coordinate for the center of the circle C1
RAD
The radius of the circle C1
7.3. APT Processor Control Words
Certain APT vocabulary words are used to define and/or alter the way the apt processor executes a particular
part program. These words include NOPLOT, MACHIN, NOPOST, CLPRINT, CLTV, PTONLY and FINI.
7.3.1. The NOPLOT Statement
The NOPLOT statement suppresses execution of all the PLOT/ ... statements in the part program. The
NOPLOT statement can appear anywhere in the part program. The NOPLOT statement can be specified on
a card by itself of in conjunction with another APT statement; for example:
NOPLOT
or
NOPLOT, CUTTER/ d, r ... etc.
7.3.2. The MACHIN Statement
The MACHIN statement in the APT part program specifies the postprocessor that is to be executed. The
MACHIN statements should appear at the beginning of the part program to use the APT processor most
efficiently. The MACHINE statement is specified as follows:
MACHIN/ NAME, par2, par3, par4
The first parameter (to the right of the slash), NAME, is the alphanumeric name of the postprocessor to be
executed. The other parameters are defined (as to type and number) by the individual postprocessors.
A part programmer can specify up to nine postprocessors for multiple postprocessing in one part program. if
no MACHIN statement appears in the part program, the APT processor assumes that no postprocessor is to
be executed.
The following is a list of the postprocessor names available in the APT vocabulary:
EMC
7.3.3. The NOPOST Statement
The NOPOST statement suppresses execution of all postprocessors specified or implied anywhere in the part
program. The NOPOST statement may appear anywhere in the part program. The NOPOST statement can
be specified on a line by itself or in conjunction with another APT statement; for example:
NOPOST
or
NOPOST/ d, r ... etc.
7.3.4. The CLPRNT Statement
The CLPRNT statement causes the input to the postprocessor to be printed out in the edit phase of the APT
processor, immediately preceding the postprocessor phase. The CLPRNT statement must be specified on a
line by itself. The allowable forms of the CLPRNT statement are as follows:
CLPRNT
Specifies that the entire input to the postprocessor is to be printed. The statement takes precedence
over any of the other CLPRNT forms, if more than one should occur in a given part program.
CLPRNT/ ON
Specifies that printing of the information is to begin at the location in the part program where the
statement occurs.
CLPRNT/ OFF
Indicates that printing of the information is to cease from this point on in the part program.
CLPRNT/ OPTION
The CLPRNT/ OPTION is used in conjunction with the cutter transformation feature (TRACUT) of
the APT processor (see Chapter 13 for a discussion of TRACUT). Normally, the information is
printed out after the transformation has occurred. However, the CLPRINT/ OPTION statement
causes the information to be printed out before transformation. The CLPRNT/ OPTION statement in
every other regard is identical to the CLPRNT/ ON statement; that is, the printing of the information
begins at the spot in the part program where the statement appears.
7.3.5. The CLTV Statement
The CLTV statement is used to specify the conditions by which the APT processor is to use an alternate
arithmetic element. This alternate arithmetic element would be part of the APT system, although it is to be
provided by the user's installation. The format of the CLTV statement is as follows:
CLTV
Specifies that the auxiliary arithmetic element is to be used in place of the standard program. This
form of the statement takes precedence over the alternate format.
CLTV/ OPTION
Specifies that the auxiliary arithmetic element is to be used only if difficulty is encountered in the
standard version.
The CLTV statement must appear on a line by itself.
7.3.6. The PTONLY Statement
The PTONLY statement can be specified in the following three ways. Each variation has a different effect
on the APT processing.
PTONLY/ 1
Causes the omission of the arithmetic element phase of the APT processor; that is, the APT
processor bypasses the arithmetic element phase and goes directly from the compiler phase to the
edit or postprocessor phase of the APT processor. It is assumed that the tool positioning data is
defined enough so that arithmetic calculations are minor and can be handled by the edit or
postprocessor phases.
PTONLY/ 2
Causes the arithmetic element phase of the APT processor to be omitted -- the cutter location data
(CLTAPE) from a previous computer run is available to the APT processor for later phases of the
APT system.
PTONLY/ 3, n
Informs the arithmetic element phase of the APT processor to use a previously calculated cutter
location data set, up to logical record n, as a starting basis for a new cutter location data set. The
remainder of the cutter location data set is to be generated by the arithmetic element as defined in the
part program.
The PTONLY statement should appear on a line by itself or as the last item of another APT statement.
7.3.7. The FINI Statement
The FINI statement defines the end of the part program; it should be the only statement on a line and must
be the last line in the part program.
Chapter 8. Loops and Macros in the APT Language
Table of Contents
8.1. The Loop Definition
8.1.1. The Loop Start (LOOPST) Statement
8.1.2. The Loop End (LOOPND) Statement
8.1.3. The Conditional Branching (IF) Statement
8.1.4. The Unconditional Branching (JUMPTO) Statement
8.1.5. Constructing a Loop
8.2. The Macro Definition
8.2.1. The Macro Definition Start (MACRO) Statement
8.2.2. The Macro Definition End (TERMAC) Statement
8.2.3. The Macro Execution (CALL) Statement
8.2.4. Definition of Macro Variables
8.2.5. Sample Macro Definition and Execution
8.2.6. Rules Concerning the Macro Language
8.2.7. Looping and Computing within a Macro
8.2.8. Nesting of Macros
8.3. System Macros
8.3.1. The LIBRY Statement
8.3.2. Executing System Macros
8.3.3. System Macro Example
8.4. Multiple Usage of Statement Labels
The loop capability of the APT processor permits the definition and use of geometric surfaces and scalar
variables in an iterative manner. In effect, it supplies the branching logic required to support the computing
facilities discussed in Chapter 2. The macro capability permits the definition of a series of statements that
are to be accessed at one or more subsequent locations in the part program. In addition, input parameters to
the macro can be varied each time the macro is accessed.
8.1. The Loop Definition
The language that provides the loop capability consists of the IF and JUMPTO statements that permit
repetitive calculations, plus the LOOPST and LOOPND statements that define the bounds (extent) of the
group of statements within which looping and jumping are to be performed. More than one loop may be
included between a single set of LOOPST-LOOPND statements, but inserting a LOOPST-LOOPND
sequence within a larger LOOPST-LOOPND area is not allowed.
8.1.1. The Loop Start (LOOPST) Statement
The LOOPST statement must be the first of a series of statements making up a loop. The statement has no
meaning other than to indicate the start of a loop; it does not generate any output.
8.1.2. The Loop End (LOOPND) Statement
The LOOPND statement must be the last of a series of statements making up a loop. The statement has no
meaning other than to indicate the end of a loop; it does not generate any output.
8.1.3. The Conditional Branching (IF) Statement
The IF statement provides a means of branching conditionally to other portions of the part program. The
general form of this statement is as follows:
IF(S) ID1, ID2, ID3
The parenthetical expression (S) is evaluated, and the processor proceeds as follows:
If S is equal to zero, control of processing is transferred to the statement labeled by ID2.
If S is less than zero, control of processing is transferred to the statement labeled by ID1.
If S is greater than zero, control of processing is transferred to the statement labeled by ID3.
The parenthetical expression S can be a number, a scalar variable, or an arithmetic expression.
The IF statement and all the statements With labels referenced by the IF statement must be in the same loop
(or macro).
8.1.4. The Unconditional Branching (JUMPTO) Statement
The JUMPTO statement provides a means of transferring unconditionally to another statement in the part
program. The format of this statement is as follows:
JUMPTO/ ID
When the processor encounters this statement, control is transferred immediately to the statement labeled by
ID.
The JUMPTO statement and the statement with the label referenced by the JUMPTO statement must be in
the same loop (or macro).
8.1.5. Constructing a Loop
The APT processor treats a loop similarly to a single part program statement; that is, the statements making
up the entire loop are read into storage, and then the loop is processed., Storage requirements of the APT
processor are thereby minimized if the loop contains only those statements which are absolutely required.
This provides the most efficient use of memory space for any given part program.
Operating under the above concept, an example is now given where a set of grid lines will be constructed
and the points of intersection of these lines computed.
Example 8.1. Looping
RESERV/ LH, 100, LV, 100, PI, 100
I = 1
LOOPST
1A) LH(I) = LINE/ CANON, 0, 1, 0, (I-1)
LV(I) = LINE/ CANON, 1, 0, O, (1-1)
PI(I) = POINT/ INTOF, LH(I), LV(I)
IF(I - 100) 2A, 3A, 3A
2A) I= I-I-1
JUMPTO/ 1A
3A) LOOPND
In this example, 100 horizontal (LH) and vertical (LV) lines are defined one unit apart. The intersection of
these lines (PI) forms a diagonal pattern of points going through the origin. From the example the following
can be noted:
1. The statement setting I=1 is not required Within the bounds of the loop; thus, it is placed ahead of
the LOOPST statement.
2. The conditional IF statement tests the index value, I, against the upper bound (100) for the geometric
quantities as defined in the RESERV statement. If the index, I, is less than the upper bound, I is
increased by one, and flow is returned to the beginning of the loop by the JUMPTO statement. When
the index, I, is equal to or greater than the upper bound, processing branches to the statement labeled
3A.
3. The statement labeled 3A is a LOOPND statement which, in this case, serves to define the end of the
loop as Well as the terminal flow point for the computing. Both the LOOPND and LOOPST
statements can have statement labels and thus can be used as branching markers in a computing loop.
Any APT statement can be used within the limits of a loop, except the following:
8.2. The Macro Definition
The language that provides the macro capability consists of the MACRO and TERMAC statements, which
define the bounds of the macro definition, and the CALL statement, which defines the location in the part
program where the macro is to be executed.
8.2.1. The Macro Definition Start (MACRO) Statement
The macro definition start (MACRO) statement is used to indicate the beginning of a definition of a macro.
The general format of this statement is:
SMAC = MACRO/ list
The statements that make up the macro being defined can now be referred to by the symbol SMAC. The
symbol used to name the macro is subject to the same restrictions that apply to any variable symbol (see
Section 1.1.4). The definition of any macro variable appears in the list immediately following the slash in
the MACRO statement. Macro variables and their methods of definition are discussed in Section 8.2.4.
8.2.2. The Macro Definition End (TERMAC) Statement
The TERMAC statement is used to indicate the conclusion of a macro definition. The TERMAC statement
must be the only APT statement on the line.
8.2.3. The Macro Execution (CALL) Statement
The macro is executed by means of the CALL statement. The format for this statement is:
CALL/ NAME, list
This specifies that the macro defined and labeled NAME is to be executed at this time. Before this
statement, all of the program bounded by the statements NAME = MACRO/ list and TERMAC was stored
internally for later processing. When the CALL/ NAME, list statement is encountered, the macro is
processed statement by statement exactly as it was originally defined. The process is repeated if later CALL/
NAME, list statements occur in the part program.
Definition or redefinition of macro variables appears in the list immediately following the macro name in the
CALL statement. Macro variables are discussed in the following section.
8.2.4. Definition of Macro Variables
Macro variables permit communication between information defined in the basic part program and that
which is contained in the macro. A macro variable is usually used so that a particular APT statement can be
altered in later CALL statements. For example, in the following statements, the symbols A, B, and C are
macro variables:
$$
$$ Other APT Statements Here
$$
1) NAME = MACRO/ A, B, C
2) FEDRAT/ A
3) COOLNT/ B
4) GODLTA/ 0, 0, C
5) TERMAC
$$
$$ Other APT Statements Here
$$
ID1) CALL/ NAME, A=20, B=FLOOD, C=1
ID2) CALL/ NAME, A=50, B=MIST, C=1
ID3) CALL/ NAME, A=30, B=ON, C=5
The macro referred to as NAME would be stored as defined at statements 1 through 5. The statement labeled
as ID1 would produce the following result: Where A occurred in the macro, the value 20 Would be inserted;
where B occurred, the vocabulary word FLOOD Would be used; and where C occurred, the value 1 Would
be used. In effect, then, the result- ant statements would be:
FEDRAT/ 20
COOLNT/ FLOOD
GODLTA/ 0, 0, 1
In a similar fashion, the CALL statement labeled ID2 would result in:
FEDRAT/ 50
COOLNT/ MIST
GODLTA/ 0, 0, 1
and the CALL statement at ID3 would result in:
FEDRAT/ 30
COOLNT/ ON
GODLTA/ 0, 0, 5
A Macro variables can be used to represent other unsubscripted APT symbols, vocabulary words (except for
the fixed-field Words and the word CALL), or numbers. They cannot be used to represent statement labels,
subscripted symbols, or arithmetic expressions. A macro variable must satisfy the rules that apply to a
variable symbol (see Section 1.1.4), with the exception that it can appear elsewhere in the same part
program; that is, the same symbolic name can be used as a macro variable in more than one macro in the
same part program; also, the same symbol can be used as a statement label or variable symbol external to
macros that use it as a macro variable. A macro variable cannot be subscripted; to be used within the macro,
each macro variable must be listed to the right of the slash in the MACRO statement.
The maximum number of macro variables for any given macro is 50.
8.2.4.1. Normal Values
A normal value for a macro variable is that value which is assigned to the variable at macro definition time
(as listed to the right of the slash in the MACRO statement). If a normal value is not specified for a macro
variable, a value must be assigned at each CALL statement for the macro in which the variable is used.
Examples of macro variables and normal values appear below:
NAME1 = MACRO/ A, B, C, D
NAME2 = MACRO/ AA=2.3, BB=TLLFT, CC=X
NAME3 = MACRO/ E, F, G=4.5, H
For the macro defined as NAME1, the four macro variables A, B, C, and D do not have a normal value
assigned to them. Hence, a value must be given for each macro variable on the CALL statement that
activates this macro.
The macro defined as NAME2 has normal values assigned to each of the macro variables AA, BB, CC.
These Would be used at execution of the macro if no value was assigned in the CALL statement.
NAMES has a combination of macro variables with and without normal values. Values must be assigned at
the CALL statement for macro variables E, F, and H; if no value was assigned for G, 4.5 Would be used.
8.2.4.2. Assigned Values
A macro variable may be assigned a value at execution time (that is, in the CALL statement) in the same
manner as a normal value was assigned at definition time (on the MACRO statement). The names of the
macro variables in the CALL statement must be the same as those used in the referenced macro; however,
they need not be in the same order. The following example indicates the use of assigned values for macro
variables:
CALL/ MAC2, D=1, E=OFF
The values of 1 and OFF are assigned to the macro variables D and E, respectively, in the execution of the
macro NAME2. In this instance, it makes no difference whether any normal values were assigned for the
macro variables D and E -- the values specified in the CALL statement take precedence. Only the macro
variables for which an assigned value is specified may be referenced in the CALL statement.
The assigned values replace the normal values only for the CALL statement in which they appear; that is,
the normal value is still in effect for future CALL commands.
8.2.5. Sample Macro Definition and Execution
The sample loop shown in Section 8.1.5 could be programmed using the macro capability as indicated
below. The result would be the identical set of grid lines and corresponding points of intersection as
discussed in Section 8.1.5.
Example 8.2. MACRO Usage
RESERV/ LH, 100, LV, 100, PI, 100
MAC1 = MACRO/ K
LH(K) = LINE/ CANON, 0, 1, 0, (K - 1)
LV(K) = LINE/ CANON, 1, 0, 0, (K - 1)
PI(K) = POINT/ INTOF, LH(K), LV(K)
TERMAC
I = 1
LOOPST
2A) CALL/ MAC1, K=I
I = I + 1
IF(I - 100) 2A, 2A, 3A
3A) LOOPND
8.2.6. Rules Concerning the Macro Language
The following rules must be observed when using the macro capability:
A macro definition cannot be nested within another macro definition; that is, two statements of the
general form SMAC = MACRO/ list cannot be specified without an intervening TERMAC
statement.
A macro variable must have a value assigned to it either as a normal value from the MACRO
statement or by assigning a specific value in the CALL statement.
The following vocabulary words are not allowed in a macro definition: RESERV, SYN, FINI,
LOOPST, and LOOPND.
A macro definition must occur in the part program before the CALL statement that references it.
Note
LOOPST and LOOPND are not permitted in a macro, since the macro definition mode itself permits all
of the computing and looping logic (for example, IF, JUMPTO, etc.) inherent in the loop definition.
In addition to the above rules, it is not desirable to specify those words within a macro which, by their very
nature, are not repetitive; for example, CLPRNT, NOPOST, etc. The processor will not treat this condition
as an error, but it will result in the needless execution of these statements over and over. Further, since a
macro is handled in much the same manner as a loop, it is also advisable to keep the macro as small as
possible, eliminating statements that could be specified without error outside the bounds of the macro.
8.2.7. Looping and Computing within a Macro
The following example indicates how looping, computing, and branching can all be used within the same
macro. In this example, a given number of holes along a line will be drilled. The number of holes, the depth
of each hole, and the feed rate are macro variables; they can thus be varied in the CALL statement.
Example 8.3. MACRO with Loop
NAME = MACRO/ A, B, C, D, E, F
N = 1
R1) GOTO/ A(N), D
GODLTA/ 0, 0, -E,
GODLTA/0, 0, E, C
N = N + 1
IF(N - F) R1, R1,
R2) TERMAC
CALL/ NAME, A=PT,
E=.5,
B
R2
B=2, C=5, D=10, $
F=30
In this example assuming PT to be a previously defined array of points, the CALL statement would result in
30 holes being drilled at a depth of .5, with the following feed rates: 10 inches/minute (D) moving between
holes, 2 inches/minute (B) during the plunge movement, and 5 inches/minute (C) during the withdraw
movement. By using another CALL statement and altering the parameters, the pattern can be located
elsewhere and repeated.
8.2.8. Nesting of Macros
The APT language permits the nesting of macros by recognizing a CALL statement for one macro within
the definition of another. For example, if the macro MACA had within its definition the statement CALL/
MACB, at execution of MACA (that is, when the CALL/ MACA, list statement is encountered), MACA
would be executed up to the CALL/ MACB statement. The entire macro denoted by MACB would be
executed at this time, and the rest of MACA, from the CALL/ MACB statement on, would then be executed.
The maximum level of nesting for macros is five; that is, the first macro can call a second macro, which can
call a third, and so on until a fifth macro has been called. The fifth macro must then return control to the
fourth called macro before another macro can be called.