Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site uw-beaver Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!laser-lovers From: laser-lovers@uw-beaver Newsgroups: fa.laser-lovers Subject: Re: Apple Laserwriter graphics ? Message-ID: <977@uw-beaver> Date: Tue, 2-Apr-85 02:08:18 EST Article-I.D.: uw-beave.977 Posted: Tue Apr 2 02:08:18 1985 Date-Received: Wed, 3-Apr-85 02:27:05 EST Sender: daemon@uw-beaver Organization: U of Washington Computer Science Lines: 41 From: Brian Reid I thought I had explained this in gruesome detail already. The Apple LaserWriter can print any image that can be described by a PostScript file. While it can certainly do bitmaps, that is a wasteful and boring way to use the machine; it can also do vectors, Bezier cubics (curves), filled polygons, circular arcs, halftoning and greyscales, generalized matrix transformations, and (perhaps best of all) fonts. Just for fun, as a simple example, here is a PostScript file that will make a solid-area 4-inch 5-pointed star in the middle of the page, in 50% gray. If you send this file, exactly as you see it here, to an Apple LaserWriter, it will print this star. You can even send it with the comments on it, just as I have typed it, though obviously in practice you will not be putting comments like this on most machine-generated files. This is a cute example because it shows, in a trivially simple example, the power of coordinate system transformations in drawing graphics. If you want to see how it works, take a piece of graph paper, stick a compass point through its center, put a pencil down at (4,0), and then do 4 iterations of rotating the paper 2/5 turn clockwise, then drawing a line from the place that the pencil has moved to (because of the rotation) to the place that is 4 inches to the right of the compass point (i.e. the new (4,0) point after the coordinate system rotation). %! % magic number--identifies it as a PS file 72 72 scale % converts scale to inches (in both x and y axis) 4.25 5.5 translate % move (0,0) origin to center of 8.5x11 page newpath % start new path 4 0 moveto % move to (x=4 in,y=0) 4 % push a repeat count on the stack {144 rotate 4 0 lineto} % push a block of code to be repeated repeat % this goes through 4 iterations of rotating the % coordinate system 144 degrees clockwise, then % drawing a line from the current point to % the point (x=4 inches,y=0) closepath % loop the path back to itself 0.5 setgray % set gray scale to 50% gray fill % fill that path with 50% gray showpage % print the page