[vtkusers]  about use vtkPolyDataNormals
    renlishen 
    renlishen at gmail.com
       
    Wed Nov 25 01:29:48 EST 2009
    
    
  
Hi everyone
I have a question about vtkpolyDataNormals...
My data is a point data set
----------------------------------------------------------------------
vtkPoints *trianglePoints = vtkPoints::New() ;
trianglePoints->InsertPoint( 0, 0, 5, 0 ) ;
trianglePoints->InsertPoint( 1, 5, 0, 0 ) ;
trianglePoints->InsertPoint( 2, 0, -5, 0 ) ;
trianglePoints->InsertPoint( 3, -5, 0, 0 ) ;
trianglePoints->InsertPoint( 4, 0, 0, 5 ) ;
static vtkIdType pts[6][3]={{0,1,3}, {1,2,3}, {0,4,1}, {1,4,2}, {2,4,3},
{3,4,0}};
vtkCellArray *polys = vtkCellArray::New();
for (int i=0; i<5; i++) polys->InsertNextCell(3,pts[i]);
vtkPolyData *triangle = vtkPolyData::New();
triangle->SetPoints( trianglePoints ) ;
triangle->SetPolys( polys ) ;
----------------------------------------------------------------------
If I don't use vtkPolyDataNormals, I get correct number of points
but when I use
	vtkPolyDataNormals *triangleCellNormals = vtkPolyDataNormals::New() ;
             triangleCellNormals->SetInput( triangle ) ;
	triangleCellNormals->ComputeCellNormalsOff() ;
	triangleCellNormals->ComputePointNormalsOn() ;
	triangleCellNormals->ConsistencyOn() ;
	triangleCellNormals->Update() ;
I get the wrong number of points....
does anyone tell me why is it?
thanks for your help~
-- 
View this message in context: http://old.nabble.com/about-use-vtkPolyDataNormals-tp26508126p26508126.html
Sent from the VTK - Users mailing list archive at Nabble.com.
    
    
More information about the vtkusers
mailing list