[vtkusers] Fw: get only normals from extracted surface

Johannes Holzmeister johannes.holzmeister at umit.at
Fri Aug 25 06:31:07 EDT 2006


Hi vtk-users!
Found the answer to this problem!
Before using vtkPolyDataNormals use vtkCleanPolyData to get just the points of the surface!

code:
vtkExtractPolyDataGeometry* extract1 = vtkExtractPolyDataGeometry::New();

extract1->SetInput(extract->GetOutput());

extract1->SetImplicitFunction(plane);

extract1->ExtractInsideOn();

extract1->ExtractBoundaryCellsOn();

extract1->Update();

 

vtkCleanPolyData* clean= vtkCleanPolyData::New();

clean->SetInput(extract1->GetOutput());

clean->Update();



vtkPolyDataNormals* norm = vtkPolyDataNormals::New();

norm->SetInput(clean->GetOutput());

norm->ComputeCellNormalsOn();

norm->Update();


Regards,
Johannes



----- Original Message ----- 
From: Johannes Holzmeister 
To: vtkusers at vtk.org 
Sent: Friday, August 18, 2006 2:09 PM
Subject: get only normals from extracted surface


Hi!

I extracted a surface with "vtkExtractPolyDataGeometry". Now I want to get the normals of the extracted surface, then I would like to add up the vectors and get a main vector. 
But how can I only get the Normals of the points which are insinde or at the surface? 
If I try "vtkPolyDataNormals" I get the normals of every single point of the image not only the normals of the surfacepoints.


code:
vtkExtractPolyDataGeometry* extract = vtkExtractPolyDataGeometry::New();

extract->SetInput(objectContainer4);

extract->SetImplicitFunction(plane);

extract->ExtractInsideOff();

extract->ExtractBoundaryCellsOn();

extract->Update();

 

vtkExtractPolyDataGeometry* extract1 = vtkExtractPolyDataGeometry::New();

extract1->SetInput(extract->GetOutput());

extract1->SetImplicitFunction(plane);

extract1->ExtractInsideOn();

extract1->ExtractBoundaryCellsOn();

extract1->Update();

 

vtkPolyDataNormals* norm = vtkPolyDataNormals::New();

norm->SetInput(extract1->GetOutput());

norm->Update();



Thank you for your help!!
Johannes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060825/67e4797b/attachment.htm>


More information about the vtkusers mailing list