<div dir="ltr">How did you generate the arrow glyphs? My guess is that the problem is there rather than in the generation of the cell normals, which appears to me to be correct.<div><br></div><div>Thanks,</div><div>Cory</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 28, 2017 at 8:20 AM, <a href="mailto:woshizyc@gmail.com">woshizyc@gmail.com</a> <span dir="ltr"><<a href="mailto:woshizyc@gmail.com" target="_blank">woshizyc@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>
<div><span></span>Hi, experts,</div><div><br></div><div>I want to visualize the normal vectors of a polydata to be centered in the center of each triangle.</div><div>I tried to do this for a sphere generated from vtkSphereSource.</div><div><br></div><div>I used the following python codes to calculate the normal vectors of the sphere:</div><div><span>sphere = vtk.vtkSphereSource()<br>sphere.SetCenter(0, 0, 0)<br>sphere.SetRadius(5.0)<br>arrow = vtk.vtkArrowSource()<br>arrow.Update()<br><br>normals = vtk.<wbr>vtkPolyDataNormals()<br>normals.SetInputConnection(<wbr>sphere.GetOutputPort())<br><br>normals.<wbr>ComputePointNormalsOff()<br>normals.ComputeCellNormalsOn()<br>normals.SplittingOff()<br>normals.FlipNormalsOff()<br>normals.ConsistencyOn()<br>normals.AutoOrientNormalsOn()<br>normals.Update()</span></div><div><br></div><div>However, it seemed that I did not get the correct normal vectors of each triangle, as<span style="font-size:10.5pt;line-height:1.5;background-color:window"> you can see in the attached figure. </span></div><div>In addition, I also do not know how to move the vectors to the center of each triangle.</div><div><br></div><div>Could any experts give me some clue for solving this problem.</div><div><br></div><div>Are there any example for doing this?</div><div><br></div><div>Thanks in advance.</div><div><br></div><div>Best,</div><div><br></div><div>Yuanchao</div><div><span style="font-size:10.5pt;line-height:1.5;background-color:window"><br></span></div>
<div><br></div><hr style="width:210px;height:1px" color="#b5c4df" size="1" align="left"><span class="HOEnZb"><font color="#888888">
<div><span><div style="MARGIN:10px;FONT-FAMILY:verdana;FONT-SIZE:10pt"><div><a href="mailto:woshizyc@gmail.com" target="_blank">woshizyc@gmail.com</a></div></div></span></div>
</font></span></div><br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>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" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Cory Quammen<br>Staff R&D Engineer<br>Kitware, Inc.</div>
</div>