[vtk-developers] vtkGL2PSExporter: need feedback.

Jeff Lee jeff at cdnorthamerica.com
Thu Jan 2 11:00:26 EST 2003


Hi Prabhu,
See embedded comments...

Prabhu Ramachandran wrote:

>Hi,
>
>Thanks for the feedback.  I'm sorry if this post appears wrongly
>threaded.  I'm replying off the web because my departmental machines
>are in a bit of a mess and its vacation time till the 2nd.
>
>  
>
>>>>>>"JL" == Jeff Lee <jeff at cdnorthamerica.com> writes:
>>>>>>            
>>>>>>
>
>    JL> In my experience, converting directly to postscript produces
>    JL> notoriously bad images, and is generally not a huge benefit
>    JL> (except for very simple scenes).  One reason is that the
>[snip]
>    JL> there are many sacrifices.  For example, transparency doesn't
>    JL> work (well if at all).  The overall idea is nice, but in
>    JL> practice doesn't work well in all situations.  That being
>
>I beg to differ.  Very few classes are used in every situation.  If
>vtkXYPlotActor belongs in VTK, a gl2ps writer would also make a good
>addition.  
>
I don't understand your comparison with vtkXYPlotActor here, but it 
looks like you misunderstood my argument.  If someone has a scene and 
wants a hardcopy and uses your class, there is a good chance that the 
resulting picture will be unacceptable.  There is no adjustable 
parameter to make your class produce an acceptable picture if the user 
has transparency.  You will also need to provide hooks for the sorting 
and culling options.  In contrast, vtkWindowToImageFilter does work well 
in all situations, with an adjustable parameter of magnification, and 
produces quality hardcopy without trying to turn your printer's 
postscript rendering engine into a gl rendering engine.

>I've seen a recent PhD thesis full of 2d contour plots made
>with VTK.  All the pictures were made using PNG's but a proper
>postscript generator would have made things much nicer.
>  
>
>The point is
>there certainly are situations where generating vector PS files make a
>lot of sense.  Especially if the plot is 2D.  The output in this case
>is definitely nice and the file size is small.  I also tried a
>reasonbly complex 3D case.  I tried the lox example (page 304, plate
>61 in the 2nd edition -- flow past a cylinder placed on a flat
>surface) and the vector PS file generated was about 6.5 MB.  By todays
>standards I'm not sure I'd call that *huge*.  It is large I agree.
>However, if you did generate a bitmapped PS file (at about 1024x768)
>via WindowToImageFilter you'd get a file size thats about 2.6MB and
>the quality is nothing that can be compared with the vector PS output.
>
so send in a magnification of 2, use a png/tif writer and you are still 
way under 6.5 mb and you have acceptable resolution.

>I'll admit that transparent actors will cause problems and so will
>volume rendering.  However, I think there is enough use for a gl2ps
>writer in VTK.  Besides we have seen that over the years quite a few
>folks have built their own gl2ps writers.  Even as recently as October
>2002 Goodwin Lawlor mentioned the need for a proper eps writer.
>  
>
Agreed, a bitmapped postscript is inferior, until you get to an 
acceptable resolution (at the cost of storage). 

>Also, note that if gl2ps works nicely with text we can generate TeX
>output for the text which means that you can print complex math stuff
>relatively easily.  So even if the image generated is not suitable for
>PS output, the TeX output can be used with the png/jpeg/bmp'd ps
>output.
>
>    JL> said, I don't think it is a good addition to vtk.  I am not on
>    JL> the ARB, but I would not like to see vtk polluted with
>    JL> external libraries without a really good reason.  I think that
>    JL> vtkWindowToImageFilter serves this need the best right now.
>
>I think there is some misunderstanding.  I am not planning on adding
>the gl2ps library itself to VTK.  I asked about that in an earlier
>email but no one responded.  I am planing to do the following:
>
> 1. Add vtkGL2PSExporter to Rendering.
>
> 2. Modify CMakeLists.txt to provide the user with options so that
> they can *optionally* link to gl2ps at build time.
>
> 3. If the user choses gl2ps, compile the exporter and also add hooks
> (via ifdefs etc.) to the text mappers so that text output works well
> with gl2ps.
>
>
>I know how to get up to step 2.  Step 3 will require some work but is
>worth doing only if the vtkGL2PSExporter does get into VTK.  So I'd
>really appreciate if the ARB or whoever decides these things lets me
>know if this is OK?
>
>
>  
>
There is no such thing as gl to ps.  I feel like I'm arguing about the 
principle of using postscript as a rendering engine.  I would rather 
start over and say "Here is a proposed requirement/feature I would like 
to see in VTK".  We can discuss the requirement/feature, and then if 
enough people agree, discuss the implementation.  I don't know what the 
requirement is, and I am really arguing about what I think the 
requirement is, not what you think the requirement is, and not the 
implementation.  Why hasn't anyone else from vtk or any other vtk 
developers responded?  I think it is our responsibility to give some 
comment on any additions to vtk, whether it is "hey, this is a good 
idea" or "you are very ugly" or whatever constructive criticism we can 
provide.
Regards,
-Jeff

-- 
Jeff Lee <jeff at cdnorthamerica.com>
Software Engineer
CD North America
21 Lafayette Street, Suite 230
Lebanon, NH 03766
Tel:    (603) 643-9993 ext. 109
Fax:    (603) 643-9994





More information about the vtk-developers mailing list