<!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>The code works now(with specific ID). The Problem 
was a method which modified the data which was not expected.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Bernhard</FONT></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=bernhard@wien-zentral.kolping.at 
  href="mailto:bernhard@wien-zentral.kolping.at">Bernhard</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=vtkusers@vtk.org 
  href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, March 15, 2004 6:24 
PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [vtkusers] help with 
  vtkPolyDataNormals</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=Arial size=2>Hi!</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>I&nbsp;used vtkpolydatanormals to calculate 
  normals.&nbsp; 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>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>vtkSphereSource *cylinder = 
  vtkSphereSource::New();<BR>&nbsp; cylinder-&gt;SetRadius( 1 );<BR>&nbsp; 
  cylinder-&gt;SetThetaResolution(50); <BR>&nbsp; 
  cylinder-&gt;SetPhiResolution(50);</FONT></DIV>
  <DIV><FONT face=Arial size=2>vtkTriangleFilter *Triangles = 
  vtkTriangleFilter::New();<BR>&nbsp; 
  Triangles-&gt;SetInput(cylinder-&gt;GetOutput());</FONT></DIV>
  <DIV><FONT face=Arial size=2>vtkDecimatePro *deci = 
  vtkDecimatePro::New();<BR>&nbsp;deci-&gt;SetInput(Triangles-&gt;GetOutput());<BR>&nbsp;deci-&gt;SetTargetReduction(0.0);<BR>&nbsp;deci-&gt;PreserveTopologyOn();</FONT></DIV>
  <DIV><FONT face=Arial size=2>vtkPolyDataNormals *ViewNormals = 
  vtkPolyDataNormals::New&nbsp; 
  ();<BR>&nbsp;ViewNormals-&gt;SetInput(deci-&gt;GetOutput());<BR>&nbsp;ViewNormals-&gt;SetFeatureAngle(60.0);<BR>&nbsp;ViewNormals-&gt;FlipNormalsOff();</FONT></DIV>
  <DIV><FONT face=Arial size=2>&nbsp;ViewNormals-&gt;Update();</FONT></DIV>
  <DIV><FONT face=Arial size=2>......</FONT></DIV>
  <DIV><FONT face=Arial size=2>&nbsp;vtkPoints 
  *datapoints=vtkPoints::New();<BR>&nbsp;datapoints=ViewNormals-&gt;GetOutput()-&gt;GetPoints();<BR>&nbsp;float 
  points[3];<BR>&nbsp;float *normalen;<BR>&nbsp;vtkPolyData 
  *profile=vtkPolyData::New();<BR>&nbsp;profile=(ViewNormals-&gt;GetOutput());</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial 
  size=2>&nbsp;for(ID=0;ID&lt;nPoints;ID++)<BR>&nbsp;{</FONT></DIV>
  <DIV><FONT face=Arial 
  size=2>&nbsp;&nbsp;datapoints-&gt;GetPoint(ID,points);<BR></FONT><FONT 
  face=Arial 
  size=2>&nbsp;&nbsp;normalen=profile-&gt;GetPointData()-&gt;GetNormals()-&gt;GetTuple(ID);<BR>&nbsp;}</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>vtkConeSource *cone = 
  vtkConeSource::New();<BR>&nbsp; cone-&gt;SetHeight( 0.5 );<BR>&nbsp; 
  cone-&gt;SetRadius( 0.05 );<BR>&nbsp; cone-&gt;SetResolution( 20 );<BR>&nbsp; 
  cone-&gt;SetCenter(points[0],points[1],points[2]);<BR>&nbsp; 
  cone-&gt;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>&nbsp;</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>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>