<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I used vtkpolydatanormals to calculate
normals. I uses a cone to visualize if the calculation is correct. i tried
severel input dataset, only vtkplanesource works well. if i use vtksperesource,
the normal"cone" shows in the wrong direction. My code looks like
this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>vtkSphereSource *cylinder =
vtkSphereSource::New();<BR> cylinder->SetRadius( 1 );<BR>
cylinder->SetThetaResolution(50); <BR>
cylinder->SetPhiResolution(50);</FONT></DIV>
<DIV><FONT face=Arial size=2>vtkTriangleFilter *Triangles =
vtkTriangleFilter::New();<BR>
Triangles->SetInput(cylinder->GetOutput());</FONT></DIV>
<DIV><FONT face=Arial size=2>vtkDecimatePro *deci =
vtkDecimatePro::New();<BR> deci->SetInput(Triangles->GetOutput());<BR> deci->SetTargetReduction(0.0);<BR> deci->PreserveTopologyOn();</FONT></DIV>
<DIV><FONT face=Arial size=2>vtkPolyDataNormals *ViewNormals =
vtkPolyDataNormals::New
();<BR> ViewNormals->SetInput(deci->GetOutput());<BR> ViewNormals->SetFeatureAngle(60.0);<BR> ViewNormals->FlipNormalsOff();</FONT></DIV>
<DIV><FONT face=Arial size=2> ViewNormals->Update();</FONT></DIV>
<DIV><FONT face=Arial size=2>......</FONT></DIV>
<DIV><FONT face=Arial size=2> vtkPoints
*datapoints=vtkPoints::New();<BR> datapoints=ViewNormals->GetOutput()->GetPoints();<BR> float
points[3];<BR> float *normalen;<BR> vtkPolyData
*profile=vtkPolyData::New();<BR> profile=(ViewNormals->GetOutput());</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2> for(ID=0;ID<nPoints;ID++)<BR> {</FONT></DIV>
<DIV><FONT face=Arial
size=2> datapoints->GetPoint(ID,points);<BR></FONT><FONT
face=Arial
size=2> normalen=profile->GetPointData()->GetNormals()->GetTuple(ID);<BR> }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>vtkConeSource *cone =
vtkConeSource::New();<BR> cone->SetHeight( 0.5 );<BR>
cone->SetRadius( 0.05 );<BR> cone->SetResolution( 20 );<BR>
cone->SetCenter(points[0],points[1],points[2]);<BR>
cone->SetDirection(normalen[0],normalen[1],normalen[2]);<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>I expect that the cone shows in the direction of
the normal (SetDirection), but it doesnīt. I tried a lot, but i canīt find the
mistake. Maybe you have some ideas.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks a lot</FONT></DIV>
<DIV><FONT face=Arial size=2>Bernhard</DIV></FONT>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>