[vtkusers] Normal Computation

Mysore Siddu siddumd at yahoo.co.in
Thu Oct 24 10:10:18 EDT 2002


Hi vtk Users,

I have some 3D points in vtkPolyData; I want to compute normal for them. I tried the following way, the code is working till triangulation but vtkPolyDataNormals is not working. I have two questions on this problem:

1. Why vtkPolyDataNormals is not working?

2. What is the probable reason for getting the following error? if I try to execute vtkDataArray *p = Snormals->GetOutput()->GetPointData()->GetNormals(); 

I'll get the error as error C2039: 'GetNormal' : is not a member of 'vtkDataArray'

Can someone throw light on this 

Here is the code I am working on:

vtkGeometryFilter *geoms = vtkGeometryFilter::New();

geoms->SetInput(Polydata output);

geoms->Update();

vtkDelaunay2D *Ttriangulate =vtkDelaunay2D::New();

Ttriangulate->BoundingTriangulationOff();

Ttriangulate->SetTolerance(stltolerance);

Ttriangulate->SetAlpha(0.01);

Ttriangulate->ReleaseDataFlagOn();

Ttriangulate->SetInput(geoms->GetOutput());

Ttriangulate->Update();

vtkPolyDataNormals *Snormals=vtkPolyDataNormals::New();

Snormals->SetInput(Ttriangulate->GetOutput());

Snormals-> SetFeatureAngle(30.0);

Snormals->SetComputePointNormals(1);

Snormals->SplittingOff();

Snormals->ConsistencyOn();

Snormals->Update();

float *n = Snormals->GetOutput()->GetPointData()->GetNormals()->GetNormal(ptId);

Thanks in advance  

Siddu

 

Post your ad on Yahoo! India Autos.Check out the used Maruti, Fiat and Ford models on sale now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20021024/05735408/attachment.htm>


More information about the vtkusers mailing list