<html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><style>body { line-height: 1.5; }body { font-size: 10.5pt; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }body { font-size: 10.5pt; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<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 style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'="">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.vtkPolyDataNormals()<br>normals.SetInputConnection(sphere.GetOutputPort())<br><br>normals.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">
<div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>woshizyc@gmail.com</div></div></span></div>
</body></html>