[vtk-developers] vtkGL2PSExporter: need feedback.

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Thu Jan 2 22:00:55 EST 2003


>>>>> "JL" == Jeff Lee <jeff at cdnorthamerica.com> writes:

    >>  Unfortunately, it is not good enough in all situations.  Just
    >> imagine generating 20 graphs (even simple 2D ones) and then
    >> realize that you have to rescale the plots and the images show
    >> up badly.  Its worse if its a paper that you sent a year ago
    >> and then they want nicer pictures now and you need to figure
    >> out how to re-generate those 20 images.  If the images were
    >> postscript there are no such issues.
    >> 
    JL> These are new requirements.  It sounds like you have found
    JL> gl2ps and are now coming up with requirements on-the-fly to
    JL> justify it.  Please, just state why we need this.  Every time
    JL> we argue, a new requirement appears.

Well, I thought these requirements were as old as vector graphics. :)

    JL> Postscript is a very powerful language.  Why don't we write a
    JL> vtkPostscriptRenderWindow?  How about
    JL> vtkPostscriptActor/Mapper.

This is not about rendering.  Its about having an option to produce
vector PS output.

[snip]

I agree that a formal summary of the arguments is a good thing.  So
here is my attempt at that.


Requirements:

 1. The option to produce some reasonable vector PS output when
 desired.

 2. Possibly produce LaTeX output for the text actors.  This makes it
 easy to embed reasonably complex math in pictures produced by VTK for
 print.

Rationale:

 1. Vector graphics output is useful in many situations.  

   a. Almost every 2D graph is typically produced in some vector
   graphic format (PS/PDF/SVG).  Take pretty much any 2d plotter as an
   example -- gnuplot, xmgrace.  I wont belabor the obvious advantages
   of such output.

   b. VTK does produce 2D plots.  We all know that it is capable of
   complex scenes, volume rendering etc. but 2d plots and reasonably
   simple 3d plots without transparency are also produced.

 2. Currently the text actors only support three fonts (please correct
 me if I'm wrong here).  Complex math is not easy to render.  In order
 to embed math formulae in VTK output one would have to edit the file
 externally (I use xfig).  If gl2ps's LaTeX output worked well, this
 should be much easier to do.  Although the output would be rendered
 on screen as LaTeX code by the vtkTextActor, the gl2ps LaTeX output
 can be used to produce the hard copy.  Also note that this option can
 be used even if a bitmapped PS file or even a JPEG (PNG?) file were
 generated.


Issues:

 1. The gl2ps writer seems to be a hack and uses PS as a GL rendering
 engine.  PS is not suitable as a GL rendering engine.  PS was not
 designed to handle complex 3d rendering.  Consequently, converting
 complex 3d scenes to PS can be painful and produces huge files.  Some
 visualizations will not be generated properly at all.  Transparency
 and volume viz are most likely impossible to handle.

 2. If we do add the class there are 2 options. 

   a. Dont add gl2ps itself to VTK. Simply add the class and allow the
   user to choose it at compile time.  This is convenient but would
   require modification of the CMakeLists.  This is not difficult at
   all!

   b. Build gl2ps as part of VTK.  The issues with this are obvious 
 
     i. License issues? gl2ps is LGPLd.

     ii. Increased size of VTK (gl2ps is just two files but we would
     build another library).  More complexity and yet another thing to
     maintain.

 For now I think option 2a is better.


Defence:

 1. Its obvious that the exporter is not useful in all situations.
 However it is useful in certain situations.

   i. Simple 3D scenes, almost all 2d plots.

   ii. LaTeX output would be useful whenever math text is required.

 I think that justifies its inclusion.  By making it a compile time
 option folks can choose to compile it.

 2. Arguments about the correctness of gl2ps seem irrelavant.  Right
 now gl2ps is the best available option to produce vector graphics.
 vtkWindowToImageFilter is nice definitely but is not the same as a
 vector graphic output.

 3. I think every form of output is limited in some respect or
 another.  Arguments about the limitation of PS as a GL rendering
 engine are not really important.  If we go down that path its
 possible to argue about many other VTK classes as well.

 4. The fact that gl2ps is limited will be documented in the class
 docs in the Caveats section.

 5. Many users in the past seem to have desired this capability.  Some
 even have their own classes to do the job.


I think that about covers it.

I am rather surprised why I should have to justify its inclusion so
formally.  Admittedly its nice for everyone but I have never seen
anyone else doing this.  Perhaps everyone should write a proposal
before they add a class to VTK?

cheers,
prabhu



More information about the vtk-developers mailing list