Structure of APT Program
Initial statements
Definition of geometric entities
Part surfaces
Definition of machining conditions
Cutter specifications, tolerance
Spindle speed, coolant, etc.
Motion statements
Termination.
Geometric Expressions Geometric Expressions (Cont’d)
• A geometric expression defines a
geometric shape or form. • In APT language, a geometric entity is
mostly defined by a reserved word
• For each geometric form, there are 1 to 14
different methods of definition. defining the entity (object) type, followed
by various modifiers and data associated
• APT contains 16 geometric elements. The
most common ones are with that entity.
– 1-D: Point • An entity is assigned to a symbol for easy
– 2-D: Line, Circle, Ellipse, Hyperbola reference.
– 3-D: Plane, Cylinder, Cone, Sphere. Symbol = Entity / Descriptive Data
Defining a POINT Definition #1 for Point
• In APT, there are 26 different formats to • Definition of a point by its Cartesian
define a point in space. All of these can be coordinates:
classified into three categories: – POINT/x,y,z
– Define a point by its coordinates, – POINT/x,y
– Define a point with respect to an entity,
• As an example,
– Define a point as the intersection of two (or
more) entities. – P1 = POINT/1.0,2.0,-5.0
• Only seven of these formats will be – P1 = POINT/1.0,2.0
covered here. • Note that when z coordinate is omitted, z = 0.
Definition #2 for Point Definition #3 for Point
• Definition of a point by its polar • Definition of a point by its
coordinates in various planes: Y polar coordinates with Y
– POINT/RTHETA,{plane},r, respect to a given point:
P2
– POINT/THETAR,{plane},,r – POINT/x,y,RADIUS,r, r=2
P1
– POINT/P1,RADIUS,r, 30o
• Here, is in degrees. r=1
• For {plane} modifier, choose • Again, in degrees. P1
1
45o • P1 is a point entity.
– XYPLAN XY plane X X
– YZPLAN YZ plane • This definition is only valid 1
– ZXPLAN ZX plane. P1=POINT/RTHETA,XYPLAN,1.0,45 in XY plane. P1=POINT/1.0,1.0
or P2=POINT/P1,RADIUS,2.0,30
P1=POINT/THETAR,XYPLAN,45,1.0 or
P2=POINT/1.0,1.0,RADIUS,2.0,30
Definition #4 for Point Definition #5 for Point
• Definition of a point on a geometric entity:
– POINT/{directional modifier},ON,<line entity>,
• Definition of a point on or Y DELTA,d,<point entity>
relative to a geometric entity: • {directional modifier} is used to select a point by their coordinates:
1. POINT/<entity>,ATANGL, P1 – XLARGE picks the entity with larger x coordinate.
2. POINT/CENTER,C1 – XSMALL picks the entity with smaller x coordinate.
– YLARGE picks the entity with larger y coordinate.
• ATANGL is a vocabulary word – YSMALL picks the entity with smaller y coordinate.
meaning “at an angle of.” P2 45o • This definition is only valid in XY plane.
• Here, is in degrees. C1 Y
• C1 is a circle entity defined P1
P2=POINT/XLARGE,ON,L1,DELTA,3,P1
d
earlier. P3 P3=POINT/XSMALL,ON,L1,DELTA,3,P1
X
• First definition is only valid in d=3 or alternatively,
XY plane. P2=POINT/YSMALL,ON,L1,DELTA,3,P1
P1=POINT/C1,ATANGL,45 P2
P3=POINT/YLARGE,ON,L1,DELTA,3,P1
P2=POINT/CENTER,C1 L1
X
Definition #6 for Point Definition #7a for Point
• Definition of a point in the Y
intersection of two given • Definition of a point in the
Y intersection of a given line C1
lines: entity and a given circle
L2
– POINT / INTOF, <line entity: L1
entity 1>, <line P1 – POINT / {directional P2
entity 2> modifier} INTOF,
<line entity>,
• INTOF is a vocabulary <circle entity>
P1
word meaning “the L1 • {directional modifier} is as X
intersection of.” X defined in Slide 13. P1=POINT/XSMALL,INTOF,L1,C1
• This definition is only P2=POINT/XLARGE,INTOF,L1,C1
P1=POINT/INTOF,L1,L2 valid in XY plane. or alternatively,
P1=POINT/YSMALL,INTOF,L1,C1
P2=POINT/YLARGE,INTOF,L1,C1
Definition #7b for Point Defining a LINE
• Definition of a point in the Y
intersection of two given C1
circle entities: • In APT, there are 27 different formats to define a
– POINT / {directional P1 line. All of these can be classified into three
modifier} INTOF, categories:
<circle entity 1>,
<circle entity 2> – Define a line by two given points or by its relationship
• {directional modifier} is as P2 with a given point or a given line or both,
defined in Slide 13. C2 – Define a line using a circle or circles as the
• This definition is only valid X references,
in XY plane. – Define a line by a point on it and its relationship with a
P1=POINT/XSMALL,INTOF,C1,C2
given geometric entity.
P2=POINT/XLARGE,INTOF,C1,C2 • Only seven of these formats will be covered
or alternatively, here.
P1=POINT/YLARGE,INTOF,C1,C2
P2=POINT/YSMALL,INTOF,C1,C2
Definition #1 for Line Definition #2 for Line
• Definition of a line passing through two given Y
points: • Definition of a line passing P1 L1
through two given points in
– LINE/x1,y1,z1,x2,y2,z2
polar coordinates:
– LINE/x1,y1,x2,y2 – LINE/RTHETA,r1,1,r2,2 P2 r=2
– LINE/<point entity 1>,<point entity 2> – LINE/THETAR,1,r1,2,r2 150 o
r=1 30o
• As examples, X
– L1=LINE/1.0,1.0,2.0,2.0
– L1=LINE/P1,P2 L1=LINE/RHETA,2.0,30,1.0,150
Definition #3 for Line Definition #4 for Line
• Definition of a line which is
Y parallel to and at a
Y
• Definition of a line which is L2 L1 distance, d, from a given
parallel to and at a distance, line:
d, from the X or Y axis: 3 – LINE/PARLEL,<line
3
entity>,{directional
– LINE/XAXIS,d L3 modifier},d
– LINE/YAXIS,d 3 • PARLEL is a vocabulary 3
X word meaning “parallel to.” 2
• {directional modifier} is as
L1=LINE/YAXIS,3.0 X
defined in Slide 13 L2 L1 L3
L2=LINE/YAXIS,-3.0
L3=LINE/XAXIS,3.0 L2=LINE/PARLEL,L1,XSMALL,2.0
L3=LINE/PARLEL,L1,YLARGE,3.0
Definition #5 for Line Definition #6 for Line
• Definition of a line which has a slope, s , with respect to
+X axis and an intercept value, d, on the X or Y axis: • Definition of a line which passes through a given point
– LINE/SLOPE,s,INTERC,{XAXIS or YAXIS},d
P(x,y) and is at an angle, , with the +X or +Y axis:
– LINE/x,y,ATANGL,,{XAXIS or YAXIS}
• INTERC is a vocabulary word meaning “intercept.”
– LINE/<point entity>,ATANGL,,{XAXIS or YAXIS}
Y Y
L1=LINE/SLOPE,-1,INTERC,XAXIS,2.0 L1
L1 -60o
or alternatively, P1(2,1)
2 L1=LINE/ATANGL,-45,INTERC,XAXIS,2.0
Slope = -1 L1=LINE/2.0,1.0,ATANGL,-60,YAXIS
(tan -45o = -1)
X X
2
Definition #7 for Line Definition #8 for Line
• Definition of a line which passes through a given point • Definition of a line which is perpendicular to a given line
P(x,y) and is at an angle, , with a given line: and at a distance, d, from a given point:
– LINE/x,y,ATANGL,,<line entity> – LINE/{directional modifier},PERPTO,<line
– LINE/<point entity>,ATANGL,,<line entity> entity>,DELTA,d,<point entity>
• PERPTO is a vocabulary word meaning “perpendicular to.”
Y L2
Y
L1 3 P1 L2=LINE/XSMALL,PERPTO,L1,DELTA,3.0,P1
L
3
5 L3=LINE/XLARGE,PERPTO,L1,DELTA,5.0,P1
L2=LINE/P1,ATANGL,-30,L1 or alternatively,
-30o
or L2=LINE/YLARGE,PERPTO,L1,DELTA,3.0,P1
L2=LINE/3.0,1.0,ATANGL,-30,L1 L3=LINE/YSMALL,PERPTO,L1,DELTA,5.0,P1
P1(3,1) L1
L2
X X
Definition #9 for Line Defining a CIRCLE
• Definition of a line which passes through a given point P(x,y) and is
tangent to a given circle:
– LINE/x,y,{RIGHT or LEFT},TANTO,<circle entity>
– LINE/<point entity>,{RIGHT or LEFT},TANTO,<circle • In APT, there are 27 different formats to define a
entity>
circle. All of these can be classified into four
• TANTO is a vocabulary word meaning “tangent to.”
• Modifier LEFT or RIGHT indicates the line is on the left or right side categories:
of the circle as one looks from the given point P.
– Define a circle by a point or points as the reference(s)
Y
– Define a circle by points and lines as references
L1 – Define a circle by lines as references
P1(x,y) L1=LINE/P1,LEFT,TANTO,C1 – Define a circle by a circle or circles as the
C1 L2=LINE/P1,RIGHT,TANTO,C1 reference(s)
• Only four of these formats will be covered here.
L2
X
Definition #1a for CIRCLE Definition #1b for CIRCLE
• Definition of a circle which has a center at P1(x,y,z) with a • Definition of a circle which has a center at P1 and passes
given radius, r: through a given point P2:
– CIRCLE/CENTER,x,y,z,RADIUS,r
– CIRCLE/CENTER,x,y,RADIUS,r – CIRCLE/CENTER,<point entity 1>,<point entity 2>
– CIRCLE/CENTER,<point entity>,RADIUS,r
Y
Y
C1
C1
r=2 r=2
C1=CIRCLE/CENTER,3.0,4.0,RADIUS,2.0
P1(3,4) C1=CIRCLE/CENTER,P1,P2
P1(3,4) C1=CIRCLE/CENTER,P1,RADIUS,2.0
P2 P2
X X
Definition #2 for CIRCLE Definition #3 for CIRCLE
• Definition of a circle which passes through two given
points with a given radius, r: • Definition of a circle Y
– CIRCLE/{directional modifier},<point entity 1>, which passes through P1
<point entity 2>,RADIUS,r. three given points:
• Directional modifier is selected by comparing the – CIRCLE/<point C1
coordinates of the centers for the two possible solutions. entity 1>, <point P2
Y entity 2>, <point
entity 3>
P1 5 C1 C1=CIRCLE/XLARGE,P1,P2,RADIUS,5.0
C2=CIRCLE/XSMALL,P1,P2,RADIUS,5.0 P3
5 or alternatively,
C1=CIRCLE/YLARGE,P1,P2,RADIUS,5.0 X
P2 C2=CIRCLE/YSMALL,P1,P2,RADIUS,5.0
C2
C1=CIRCLE/P1,P2,P3
X
Definition #4 for CIRCLE Definition #5 for CIRCLE
• Definition of a circle which Y
• Definition of a circle which is tangent to a given line, with passes through two given C1
its center at a given point: points and is tangent to a
– CIRCLE/CENTER,x,y,TANTO,<line entity> L1
given line: P2
– CIRCLE/CENTER,<point entity>,TANTO,<line entity> – CIRCLE/{directional
Y modifier},TANTO, C
P1 2
<line entity 1>,
THRU,<point entity
C1 C1=CIRCLE/CENTER,P1,TANTO,L1 1>,<point entity 2> X
L1 or
P1(4,4) C1=CIRCLE/CENTER,4.0,4.0,TANTO,L1 C1=CIRCLE/YLARGE,TANTO,L1,THRU,P1,P2
C2=CIRCLE/YSMALL,TANTO,L1,THRU,P1,P2
or alternatively,
C1=CIRCLE/XSMALL,TANTO,L1,THRU,P1,P2
X C2=CIRCLE/XLARGE,TANTO,L1,THRU,P1,P2
Defining a PLANE Some Plane Definitions
• Planes are among the most frequently • A plane passing through 3 given points:
used geometric entities for defining cutter – PLANE/P1,P2,P3
path. • A plane defined by ax + by + cz = d:
• There are 13 different formats to define a – PLANE/a,b,c,d
plane on the basis of various gives • A plane which is parallel to and at a
conditions distance, d, from coordinate plane XY, YZ,
• Only three of these formats will be covered or ZX:
here. – PLANE/{XYPLAN,YZPLAN,or ZXPLAN},d