Article View: comp.lang.postscript
Article #1843Re: Big polygons
From: Jim DeLaHunt
Date: Fri, 21 Aug 1992 03:44
Date: Fri, 21 Aug 1992 03:44
30 lines
1714 bytes
1714 bytes
In article <4eVm0Lq00awAMCPkkW@andrew.cmu.edu> am2q+@andrew.cmu.edu
(Andrew Newell Mickish) writes:
>I need a strategy for printing polygons with an arbitrary number of
>vertices. So I guess the question comes down to how do I deal with a
>very large number of parameters to a function?
In general, write your script in such a way that it the interpreter
consumes code as soon as it receives it. For instance, don't do
143.2 246.0 .... (1000 coordinate pairs in reverse order here)
1000 {moveto} repeat
Send the coordinates and consume them at once.
143.2 246.0 lineto 141.59 240.0 lineto ... (998 more "x y lineto" sets)
If you are concerned about data size, then define an abbreviation for
"lineto". You can also reduce data size by sending the difference between
coordinates, and by eliminating insignificant digits etc.
% in prolog
/l /lineto load def /r /rlineto load def
% in script
143.2 246.0 l -1.41 -6 r ... (998 more "x y r" sets)
>Thanks,
>
>--Andrew Mickish
You're welcome!
--Jim DeLaHunt, Developer Support, Adobe Systems Incorporated
delahunt@adobe.com ...!{apple,decwrl}!adobe!delahunt +1-415-962-3790
In matters of style my word is law! I work for Developer Support. :-)
Technical Details
Message-ID:
<1992Aug21.034404.29633@adobe.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!decwrl!adobe!delahuntReferences:
<4eVm0Lq00awAMCPkkW@andrew.cmu.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!adobe!delahunt From: delahunt@adobe.com (Jim DeLaHunt) Subject: Re: Big polygons Message-ID: <1992Aug21.034404.29633@adobe.com> Followup-To: comp.lang.postscript Summary: Consume parameters immediately if possible Sender: usenet@adobe.com (USENET NEWS) Organization: Adobe Systems Incorporated References: <4eVm0Lq00awAMCPkkW@andrew.cmu.edu> Date: Fri, 21 Aug 1992 03:44:04 GMT Lines: 33