[vtkusers] vtkNormals bug???

Jonathan Bailleul Jonathan.Bailleul at greyc.ismra.fr
Tue Apr 29 14:33:06 EDT 2003


Sorry, the involved filter is vtkPolyDataNormals

I've recently tried with no success:


virtual void vtkPolyDataNormals::ConsistencyOn()
         Turn on/off the enforcement of consistent polygon ordering



Jonathan Bailleul wrote:
> 
> Dear all,
> 
> I think I've found some inconsistent behaviour in using the vtkNormals
> filter with the simple program provided below.
> I just read a vtk file and wnat in output a file with the same polygons
> plus computed normals. What I get in output is apparently the same, but
> when I read the files, I can see that a *random* number of points is
> added to the file!
> 
> All my input files have exactly 66 vertices, but the resullting output
> files have between 99 and 123 vertices! Please notice that additional
> vertices occupy the same coordinates as original vertices, so "there is
> no obvious difference visually".
> 
> I might have done something wrong in my program, but in that case, can
> you tell me what?
> 
> PS: my vtk version is a nighlty release 4.0x.
> 
> #include "vtkSphereSource.h"
> #include "vtkPolyDataMapper.h"
> #include "vtkActor.h"
> #include "vtkRenderWindow.h"
> #include "vtkRenderer.h"
> #include "vtkRenderWindowInteractor.h"
> #include "vtkPolyDataNormals.h"
> #include "vtkPolyDataReader.h"
> #include "vtkPolyDataWriter.h"
> #include "vtkProperty.h"
> #include "vtkCamera.h"
> 
> #include <assert.h>
> #include <stdlib.h>
> 
> /* GLOS (Graphic Library in Open Source), an ANSI Common Lisp OpenGL
> subset.
>    Copyright (C) 2000 the GLOS development team
> (http://glos.sourceforge.net) */
> 
> static void
> usage(int argc, char **argv)
> {
>   if (argc != 3)
>     {
>       printf("(re)compute normals for .vtk object files\n");
>       printf("Usage: %s <vtk input object filename> <vtk output file>
> \n", argv[0]);
>       exit(1);
>     }
> }
> 
> int
> main(int argc, char* argv[])
> {
>   usage(argc, argv);
> 
>   // create object geometry
>   vtkPolyDataReader *reader = vtkPolyDataReader::New();
>   reader -> SetFileName(argv[1]);
>   reader -> Update();
> 
>   vtkPolyDataNormals *normals = vtkPolyDataNormals::New();
>   normals -> SetInput(reader -> GetOutput());
>   normals -> Update();
> 
>   vtkPolyDataWriter *writer = vtkPolyDataWriter::New();
>   writer -> SetInput(normals -> GetOutput());
>   writer -> SetFileName(argv[2]);
>   writer -> SetFileTypeToASCII();
>   writer -> Update();
> 
>   return EXIT_SUCCESS;
> }
> 
> --
> -----------------------------------
> Jonathan BAILLEUL, Doctorant
> GREYC Image - Université de Caen
> http://www.greyc.ismra.fr/~bailleul
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers

-- 
-----------------------------------
Jonathan BAILLEUL, Doctorant
GREYC Image - Université de Caen 
http://www.greyc.ismra.fr/~bailleul



More information about the vtkusers mailing list