<div dir="ltr">Hi David,<br><br>I'll try to explain again:<br><br>How I can calculate the normal at a specific point (id) on polydata.<br>I'd like to visualize that normal too, so how to write that normal (as an arrow)?<br>
<br>this is what I use, but it doesn't write the normals:<br>void generateNormals(vtkPolyData* polydata)<br>{ <br><br> // Generate normals<br> vtkSmartPointer<vtkPolyDataNormals> normalGenerator = vtkSmartPointer<vtkPolyDataNormals>::New();<br>
normalGenerator->SetInput(polydata);<br><br> normalGenerator->ComputePointNormalsOn();<br> normalGenerator->ComputeCellNormalsOff();<br> normalGenerator->Update();<br> <br> polydata = normalGenerator->GetOutput();<br>
<br> vtkPolyDataWriter* writer = vtkPolyDataWriter::New();<br> writer->SetInput(polydata);<br> writer->SetFileName("normals.vtk");<br> writer->Write();<br>}<br><br><div class="gmail_quote">
On Sun, Mar 11, 2012 at 7:48 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Sun, Mar 11, 2012 at 11:25 AM, Hila Hiler <<a href="mailto:hilahiler@gmail.com">hilahiler@gmail.com</a>> wrote:<br>
> Hi All,<br>
><br>
> How should I get and WRITE a normal of a specific point from polyData.<br>
> The writing on .vtk file in order to examine what I got ...<br>
><br>
> I use this example, but only three first normals set. and again, how I can<br>
> write them?<br>
> <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataPointNormals" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataPointNormals</a><br>
><br>
><br>
> Thanks<br>
<br>
</div></div>I'm not sure I understand your question, but if it is "how do I write<br>
a PolyData to a file?", then the answer is:<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/WriteVTP" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/WriteVTP</a><br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
</font></span></blockquote></div><br></div>