AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
newpath () typedict.Path
 
Clears this path, which means the current point and all subpaths are discarded. newpath does not complain if this path is already empty. Most of the built-ins defined in Graphics that fill, stroke, or clip perform an implicit newpath before they return.
 
 Example:   The program,
import yoix.stdio.*;

Path p;

moveto(x, y) = printf(" moveto(%.1f, %.1f);\n", x, y);
lineto(x, y) = printf(" lineto(%.1f, %.1f);\n", x, y);
closepath() = printf(" closepath();\n");

p.moveto(100, 100);
p.lineto(200, 100);
p.rlineto(200, 150);
p.closepath();

printf("Output before newpath:\n");
p.pathforall(moveto, lineto, NULL, NULL, closepath);
p.newpath();
printf("\nOutput after newpath:\n");
p.pathforall(moveto, lineto, NULL, NULL, closepath);
prints something like
Output before newpath:
 moveto(100.0, 100.0);
 lineto(200.0, 100.0);
 lineto(400.0, 250.0);
 closepath();

Output after newpath:
on standard output.
 
 Return:   Path
 
 See Also:   arc, arcn, closepath, currentpath, currentpoint, curveto, flattenpath, Graphics, lineto, moveto, pathbbox, pathforall, quadto, rcurveto, rlineto, rmoveto, rquadto

 

Yoix is a registered trademark of AT&T Inc.