7.4

Table Of Contents
Code Sample Examples
Example 1
Example 1 draws a 180 degree arc 3 inches in length. The center of the circle is at (0,0). The rmoveto() command that pre-
cedes the arc() command ensures the current point is set at the center of the circle and prevents a line from being drawn from
the current point to the start point of the arc.
rmoveto(3,0)
arc(0,0,3,0,180)
stroke()
Example 2
Example 2 draws an arc 2.5 inches in length. The center for the arc is four inches from the left edge of the page and three
inches from the top edge. The arc starts at 30 degrees and ends at 60 degrees. The rmoveto() command that precedes the
arc() command moves the current point to the center of the circle, resulting in a line that is drawn from the center of the circle
to the start point of the arc.
rmoveto(4,3)
arc(4,3,2.5,30,60)
stroke()
ClosePath (procedure)
Closes any open path and completes the current shape, if need be, by drawing a line from the last point in the shape to the
starting point. This ensures the shape is closed, thus enabling filling to take place if specified. Only closed shapes can be filled.
Syntax
closepath()
Argument
None
Code Sample Example
The first line of code sets the starting point of a triangle, the second and third lines of code draw the first and second lines (or
sides) of the triangle, the fourth line of code closes the triangle shape by implicitly issuing a moveto command.
Example
moveto(1.0,1.0)lineto(1.5,2.0)
lineto(0.5,2.0)
closepath()
fill()
CurveTo/RCurveTo (procedure)
Creates a Bezier curve. Bezier curves are shapes defined using 4 points: the starting and ending points are physical posi-
tioning points while the second and third points are control points on the curve. In PlanetPress Talk, the starting point is implicit
©2010 Objectif Lune Inc - 574 -