Re: How can I print large PS polygons from PV-WAVE? [message #3300] |
Mon, 19 December 1994 01:01 |
sigut
Messages: 12 Registered: February 1994
|
Junior Member |
|
|
In article <3csir7$qfg@lyra.csx.cam.ac.uk> iarla@atm.ch.cam.ac.uk
(Iarla Kilbane-Dawe) writes:
> As many of you will be aware, there is a limit on the maximum size
> of polygon that PV-WAVE thinks postscript can print, being a polygon
> of 750 points. I routinely deal with complex contours made up of
> several thousand point polygons and currently can't print them.
>
> Does anybody have a work around for this; even a satisfactory way
> of splitting up the polygons would be grateful.
I think, that I've got an answer in an old posting which is attached below.
In the meantime, let me just make a comment about the way your phone
number is written:
> Centre for Atmospheric Science Phone: ++44 (01223) 336524
==
Please, please, please; write +44 ... i.e. use just ONE plus sign before
the country code. It was originally agreed, (sorry, can't find the article)
that ONE plus stands for whatever is used in the respective country to
gain the international exchange (e.g. 010 in Britain, 07 in Spain, 990 in
Finnland etc.). Unluckily in Germany and Switzerland where the code is 00
(two zeroes) people misunderstood the original intent and started using
two plus signs for the two zeroes. Apart from the fact, that this undermines
the intent (being able to give a clearly defined country code usable from
ANY country), it needs just a bit of imagination to draw various scenarios
with potentionally deadly outcome when ++ instead of + is used in automatic
service.
OK, I am stepping down from the soap box. Here is the old posting:
Date: 13 May 1994 14:36:15 GMT
In-reply-to: frp@ssec.wisc.edu's message of 12 May 1994 16:25:56 GMT
In article <2qtlak$im1@spool.cs.wisc.edu> frp@ssec.wisc.edui
(Francois Pomport) writes:
I am trying to print some filled contour graphics on a color
printer, but the printer seems to ignore them. Each time IDL warns
us that the number of polygon vertices may exceed some printer
capabilities when it is generating the postscript file. I have
tried to reduce the number of contour levels up to 7 (which is
not very much) in order to be below the limitations but it
doesn't work. Does anyone have encountered this warning message
before? How did you succeed in printing your files? I know that my
problem is related to the printer (Tektronix Pahser II). Do you
have any other references for new color printers with an estimated
price?
Francois
frp@ssec.wisc.edu
University of Wisconsin
Hi there,
I believe that your problem is NOT related to your printer, but to
the POLYFILL routine used by CONTOUR,/FILL or POLYCONTOUR.
This routine takes each closed contour as a polygon and sends it
to the PostScript device to be filled. When the POLYFILL routine
was developed, there was (and perhaps still is) a limit as to the
number of vertices the PostScript device would be able to handle.
If it is larger then 750 (or somesuch), it gives you a warning
and might do anything between ignoring the request and breaking off,
depending on the software version.
I wrote a hack to avoid this problem in the PV-Wave version of the
POLYCONTOUR routine, which could be reworked easily for IDL. The only
problem is, that in IDL you are discouraged to use POLYCONTOUR, because
it was replaced by the /FILL option to CONTOUR. Of course, the source
for CONTOUR is not available...
Anyway, since I started let's have a look. The tested change for
PV-Wave looks as follows:
pro polycontour, ...
...
if col ge 100 then col = 199-col ;Drawing index = 1 less than orig
col = color_index(col+1)
; This add-on was written to avoid the problem with
; "Too many vertices for PostScript polygon fill."
; The solution is to "thin out" the polygon and hope
; that it will still look the same.
sec_dim=size(xyarr)
gms_siz=sec_dim(2)
if gms_siz gt 750 then begin
gms_siz = gms_siz/2
while gms_siz gt 750 do gms_siz = gms_siz/2
xyarr=congrid(xyarr,2,gms_siz)
endif
; end-of-the-hack
if n_elements(pat) ne 0 then begin
s = size(pat)
if s(0) ne 3 then message, 'Pattern array not 3d.'
...
(you can find easily where to plug it in)
The UNTESTED version for IDL would look as follows:
pro polycontour, ...
...
if col ge 100 then col = 199-col ;Drawing index = 1 less than orig
col = color_index(col+1)
; This add-on was written to avoid the problem with
; "Too many vertices for PostScript polygon fill."
; The solution is to "thin out" the polygon and hope
; that it will still look the same.
sec_dim=size(xyarr)
gms_siz=sec_dim(1)
if gms_siz gt 750 then begin
gms_siz = gms_siz/2
while gms_siz gt 750 do gms_siz = gms_siz/2
xyarr=congrid(xyarr,gms_siz,2)
endif
; end-of-the-hack
if n_elements(pat) ne 0 then begin
s = size(pat)
if s(0) ne 3 then message, 'Pattern array not 3d.'
...
The file polycontour.pro can be found for Wave in .../wave/lib/std
and for IDL in .../idl/lib/userlib
Well, that's all.
Good luck,
George
--
------------------------------------------------------------ ------------------
George M.Sigut ETH Informatikdienste, Beratung & Schulung, CH-8092 Zurich
Swiss Federal Inst. of Technology, Computing Services, User Support & Training
email: sigut@bs.id.ethz.ch Phone: +41 1 632 5763 Fax: +41 1 632 1225
>>>> >>>>> in case of email problems send the mail to "sigut@acm.org" <<<<<<<<<
------------------------------------------------------------ ------------------
|
|
|