I just downloaded the bunny dataset. I modified this wiki example: <a href="http://vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataExtractNormals">http://vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataExtractNormals</a> to use a vtkPLYReader.<br>
<br>The bunny data has no normals defined.<br><br><div class="gmail_quote">On Tue, Oct 18, 2011 at 2:36 PM, Bill Lorensen <span dir="ltr">&lt;<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">After<div class="im"><br>reader1-&gt;SetFileName ( inputFilename.c_str() );<br></div>try<br>
reader1-&gt;Update();<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Tue, Oct 18, 2011 at 10:40 AM, andon <span dir="ltr">&lt;<a href="mailto:antoniod987@gmail.com" target="_blank">antoniod987@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Well, the code is quite standard:<br>
<br>
-<br>
-<br>
-<br>
 std::string inputFilename = &quot;../data/bunny.ply&quot;;<br>
<br>
   vtkSmartPointer&lt;vtkPLYReader&gt; reader1 =<br>
    vtkSmartPointer&lt;vtkPLYReader&gt;::New();<br>
  reader1-&gt;SetFileName ( inputFilename.c_str() );<br>
<br>
  // Visualize<br>
  vtkSmartPointer&lt;vtkPolyDataMapper&gt; mapper1 =<br>
    vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();<br>
  mapper1-&gt;SetInputConnection(reader1-&gt;GetOutputPort());<br>
<br>
  vtkSmartPointer&lt;vtkPolyData&gt; polydata =<br>
vtkSmartPointer&lt;vtkPolyData&gt;::New();<br>
    polydata-&gt;DeepCopy(reader1-&gt;GetOutput());<br>
<br>
vtkDoubleArray* normalDataDouble =<br>
vtkDoubleArray::SafeDownCast(polydata-&gt;GetPointData()-&gt;GetArray(&quot;Normals&quot;));<br>
<br>
  vtkSmartPointer&lt;vtkActor&gt; actor1 =<br>
    vtkSmartPointer&lt;vtkActor&gt;::New();<br>
  actor1-&gt;SetMapper(mapper1);<br>
 //bunny2<br>
   std::string inputFilename2 = &quot;../data/bunny.ply&quot;;<br>
<br>
  vtkSmartPointer&lt;vtkPLYReader&gt; reader2 =<br>
    vtkSmartPointer&lt;vtkPLYReader&gt;::New();<br>
  reader2-&gt;SetFileName ( inputFilename2.c_str() );<br>
<br>
  // Visualize<br>
  vtkSmartPointer&lt;vtkPolyDataMapper&gt; mapper2 =<br>
    vtkSmartPointer&lt;vtkPolyDataMapper&gt;::New();<br>
  mapper2-&gt;SetInputConnection(reader2-&gt;GetOutputPort());<br>
<br>
  vtkSmartPointer&lt;vtkActor&gt; actor2 =<br>
    vtkSmartPointer&lt;vtkActor&gt;::New();<br>
  actor2-&gt;SetMapper(mapper2);<br>
<br>
  // A renderer and render window<br>
  vtkSmartPointer&lt;vtkRenderer&gt; renderer =<br>
    vtkSmartPointer&lt;vtkRenderer&gt;::New();<br>
  vtkSmartPointer&lt;vtkRenderWindow&gt; renderWindow =<br>
    vtkSmartPointer&lt;vtkRenderWindow&gt;::New();<br>
  renderWindow-&gt;AddRenderer(renderer);<br>
<br>
<br>
<br>
   // An interactor<br>
  vtkSmartPointer&lt;vtkRenderWindowInteractor&gt; renderWindowInteractor =<br>
    vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();<br>
<br>
  renderWindowInteractor-&gt;SetRenderWindow(renderWindow);<br>
  actor1-&gt;SetPosition(1,0,0);<br>
  actor2-&gt;SetPosition(1.2,0,0);<br>
  renderer-&gt;AddActor(actor1);<br>
  renderer-&gt;AddActor(actor2);<br>
  renderer-&gt;SetBackground(1,1,1);<br>
<br>
  vtkSmartPointer&lt;vtkInteractorStyleSwitch&gt; style =<br>
vtkSmartPointer&lt;vtkInteractorStyleSwitch&gt;::New();<br>
  renderWindowInteractor-&gt;SetInteractorStyle(style);<br>
-<br>
-<br>
-<br>
The rest of the code is not necessary....I&#39;m trying than I&#39;m using some ply<br>
files from here: <a href="http://graphics.im.ntu.edu.tw/%7Erobin/courses/cg03/model/" target="_blank">http://graphics.im.ntu.edu.tw/~robin/courses/cg03/model/</a><br>
<br>
and i need to extract normals from the actor that i create from the ply<br>
file, in particular in relation with some cells (that i will pick from<br>
cellpicker) , because i have to make some consideration about cells<br>
orientation.....can you help me??? i try to use &quot;polydata&quot; for extract<br>
normals but the array normalsDataDouble that i obtain is not<br>
initialized...if i try to use this array i throw in an exception....<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Extract-Normals-tp4905504p4913930.html" target="_blank">http://vtk.1045678.n5.nabble.com/Extract-Normals-tp4905504p4913930.html</a><br>
</font><div>Sent from the VTK - Users mailing list archive at Nabble.com.<br>
</div><div><div></div><div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>