[gl2ps] Nan filtering?

Christophe Geuzaine cgeuzaine at ulg.ac.be
Tue May 28 19:03:55 CEST 2013


On 28 May 2013, at 18:52, David Lonie <david.lonie at kitware.com> wrote:

> Just so I can keep VTK in sync with GL2PS upstream -- I assume the silence means this patch will not be accepted?
> 

Hi Dave - actually I'm just not sure if you should include it ;-)

Anybody else on the list has an opinion?

Thanks,

Christophe

> Thanks,
> Dave
> 
> 
> On Fri, May 10, 2013 at 8:27 AM, David Lonie <david.lonie at kitware.com> wrote:
> After a good night's sleep and a peek at the OpenGL specification,
> this patch may not be needed. The spec states:
> 
> Any representable floating-point value is legal as input to a GL
> command that requires floating-point data. The result of providing a
> value that is not a floating point number to such a command is
> unspecified, but must not lead to GL interruption or termination. In
> IEEE arithmetic, for example, providing a negative zero or a
> denormalized number to a GL command yields predictable results, while
> providing a NaN or an infinity yields unspecified results.
> 
> We may not want to add the overhead of explicitly checking each
> coordinate for Nan, when passing Nans in is a user error. GL2PS does
> adhere to the standard -- it does not crash or terminate, and rather
> gracefully passes the Nans through to the output.
> 
> Feel free to reject this patch, I'm on the fence about it as it.
> 
> Dave
> 
> On Thu, May 9, 2013 at 5:14 PM, David Lonie <david.lonie at kitware.com> wrote:
> > This bit is also needed to get this working on windows.
> >
> > diff --git a/ThirdParty/gl2ps/vtkgl2ps/gl2ps.c
> > b/ThirdParty/gl2ps/vtkgl2ps/gl2ps.c
> > index 6c98d81..d256bde 100644
> > --- a/ThirdParty/gl2ps/vtkgl2ps/gl2ps.c
> > +++ b/ThirdParty/gl2ps/vtkgl2ps/gl2ps.c
> > @@ -55,6 +55,10 @@
> >  #include <vtk_png.h>
> >  #endif
> >
> > +#ifdef _MSC_VER
> > +#define isfinite _finite
> > +#endif
> > +
> >  /*********************************************************************
> >   *
> >   * Private definitions, data structures and prototypes
> >
> > On Thu, May 9, 2013 at 4:57 PM, David Lonie <david.lonie at kitware.com> wrote:
> >> Hi list,
> >>
> >> We've run into an issue exporting plots that contain Nan values.
> >> OpenGL seems to handle these gracefully on most implementations by
> >> discarding the primitive and moving on. The attached patch does the
> >> same for GL2PS.
> >>
> >> Can this be included in the next release?
> >>
> >> Thanks,
> >>
> >> Dave
> 
> _______________________________________________
> gl2ps mailing list
> gl2ps at geuz.org
> http://www.geuz.org/mailman/listinfo/gl2ps

-- 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science 
http://www.montefiore.ulg.ac.be/~geuzaine