<br><div class="gmail_quote">On Mon, Dec 21, 2009 at 9:17 AM, Jerald Zhao <span dir="ltr"><<a href="mailto:jeraldzh@gmail.com">jeraldzh@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Hi everyone,</div>
<div> </div>
<div>I'm a new to VTK.</div>
<div> </div>
<div> </div>
<div> </div>
<div><a href="http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Graphics/Testing/Tcl/capCow.tcl?root=VTK&content-type=text/plain" target="_blank">http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Graphics/Testing/Tcl/capCow.tcl?root=VTK&content-type=text/plain</a></div>


<div>
<div>Is it possible to apply above code to vtkstructuredpointsreader class.</div>
<div> </div>
<div>###</div>
<div># Read the polygonal data and generate vertex normals<br>vtkBYUReader cow<br>  cow SetGeometryFileName "$VTK_DATA_ROOT/Data/Viewpoint/cow.g"<br>vtkPolyDataNormals cowNormals<br>  cowNormals SetInputConnection [cow GetOutputPort]<br>

###</div>
<div> </div></div>
<div>In my sight, these codes should be changed to below</div>
<div> </div>
<div>
<div>###</div>
<div># Read the polygonal data and generate vertex normals<br>vtkStructuredPointsReader cow<br>  cow SetFileName "g";</div>
<div>vtkPolyDataNormals cowNormals<br>  cowNormals SetInputConnection [cow GetOutputPort]<br>###</div>
<div> </div>
<div>However, the result were below</div>
<div>###</div>
<div>ERROR: In C:\vtk\src\Filtering\vtkDemandDrivenPipeline.cxx, line 828<br>vtkStreamingDemandDrivenPipeline (0x087C5730): Input for connection index 0 on input port index 0 for algorithm vtkPolyDataNormals(0x087C58A8) is of type vtkStructuredPoints, but a vtkPolyData is required.</div>


<div>ERROR: In C:\vtk\src\Filtering\vtkDemandDrivenPipeline.cxx, line 828<br>vtkStreamingDemandDrivenPipeline (0x087C5730): Input for connection index 0 on input port index 0 for algorithm vtkPolyDataNormals(0x087C58A8) is of type vtkStructuredPoints, but a vtkPolyData is required.</div>


<div>ERROR: In C:\vtk\src\Filtering\vtkDemandDrivenPipeline.cxx, line 828<br>vtkStreamingDemandDrivenPipeline (0x087C5730): Input for connection index 0 on input port index 0 for algorithm vtkPolyDataNormals(0x087C58A8) is of type vtkStructuredPoints, but a vtkPolyData is required.</div>


<div>ERROR: In C:\vtk\src\Filtering\vtkDemandDrivenPipeline.cxx, line 828<br>vtkStreamingDemandDrivenPipeline (0x087C5730): Input for connection index 0 on input port index 0 for algorithm vtkPolyDataNormals(0x087C58A8) is of type vtkStructuredPoints, but a vtkPolyData is required.</div>


<div>###</div>
<div> </div>
<div>where did I make a mistake?</div>
<div> </div>
<div> </div>
<div>Regards,</div>
<div>Jerald</div></div>
<br>_______________________________________________<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>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
<br></blockquote><div> </div></div>Jerald,<br>
<br>This type of question is much more appropriate for the vtk users list rather than the developers list:<br>
<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br><br>The error:<br>port index 0 for algorithm vtkPolyDataNormals is of type vtkStructuredPoints, but a vtkPolyData is required.<br>
<br>Means that you are passing the vtkPolyDataNormals filter the wrong data type. An easy way to fix this is to first convert your vtkStructuredPoints to a vtkPolyData, since poly data is more "general" than structured points.<br>
<br>Anyone know why there are no normal filters for non-polydata objects?<br><br clear="all">Thanks,<br><br>David