<!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> </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> </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></BLOCKQUOTE></BODY></HTML>