<div dir="ltr">Kurt,<div><br></div><div>Nothing immediately jumps out at me as a problem in your code.</div><div><br></div><div>Do you have a small sample file that shows the problem that you can share?</div><div><br></div><div>Thanks,</div><div>Cory</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 4, 2016 at 4:44 PM, Kurt Sansom <span dir="ltr"><<a href="mailto:kayarre@gmail.com" target="_blank">kayarre@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 dir="ltr">Hi, <div>   I have some unstructured data, no triangles, just points and normals.</div><div><br></div><div>I am trying to write those to a file in the vtp format using the python bindings and then load the data in paraview and apply a glyph filter to view the vectors. but the glyph filter doesn't appear to work eventhough the data looks alright in the vtp file, what am I missing?</div><div><br></div><div>here is the code snippet.</div><div><br></div><div><div>       #write normals</div><div>        points = vtk.vtkPoints()</div><div>        verts = vtk.vtkCellArray()</div><div>        polydata_pts = vtk.vtkPolyData()</div><div>         </div><div>        pointNormalsArray = vtk.vtkDoubleArray()</div><div>        pointNormalsArray.<wbr>SetNumberOfComponents(3)</div><div><br></div><div>        for i in range(clipSeedIds.<wbr>GetNumberOfIds()):</div><div><br></div><div>            seedId = clipSeedIds.GetId(i)</div><div><br></div><div>            locator = vtk.vtkPointLocator()</div><div>            locator.SetDataSet(<wbr>clippedSurface)</div><div>            locator.BuildLocator()</div><div><br></div><div>            seedPoint = self.Surface.GetPoint(seedId)</div><div>            seedPointId = locator.FindClosestPoint(<wbr>seedPoint)</div><div><br></div><div>            planeEstimator = vtkvmtk.<wbr>vtkvmtkPolyDataNormalPlaneEsti<wbr>mator()</div><div>            planeEstimator.SetInputData(<wbr>clippedSurface)</div><div>            planeEstimator.<wbr>SetOriginPointId(seedPointId)</div><div>            planeEstimator.Update()</div><div><br></div><div>            plane = vtk.vtkPlane()</div><div>            plane.SetOrigin(<wbr>planeEstimator.GetOrigin())</div><div>            plane.SetNormal(<wbr>planeEstimator.GetNormal())</div><div><br></div><div>            #testing the normal vector</div><div>            </div><div>            origin_pt = planeEstimator.GetOrigin()</div><div>            normal_pt = planeEstimator.GetNormal()</div><div>            </div><div>            id = points.InsertNextPoint(origin_<wbr>pt)</div><div>            verts.InsertNextCell(1) </div><div>            verts.InsertCellPoint(id)</div><div>            pointNormalsArray.<wbr>InsertNextTuple(normal_pt)</div><div>            </div><div><br></div><div><br></div><div>        #Add the points to the polydata container</div><div>        polydata_pts.SetPoints(points)</div><div>        polydata_pts.SetVerts(verts)</div><div>        </div><div>        # Add the normals to the points in the polydata</div><div>        #polydata_pts.GetCellData().<wbr>SetNormals(pointNormalsArray)</div><div>        polydata_pts.GetPointData().<wbr>SetNormals(pointNormalsArray)</div><div>        polydata_pts.Modified()</div><div>        </div><div>        </div><div>        writer = vtk.vtkXMLPolyDataWriter()</div><div>        writer.SetDataModeToAscii()</div><div>        writer.SetFileName(os.path.<wbr>join(</div><div>          "/Users/sansomk/caseFiles/<wbr>ultrasound/cases/DSI003LER/<wbr>other",    </div><div>          "pts_out.vtp"))</div><div>        writer.SetInputData(polydata_<wbr>pts)</div><div>        writer.Write()</div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div><div>~Kurt</div><div><div><br></div>-- <br><div class="m_-3855305662885353987gmail_signature">Kurt Sansom<br></div>
</div></font></span></div></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>