[vtk-developers] vtkClipPolyData

David Doria daviddoria+vtk at gmail.com
Mon Dec 21 11:58:09 EST 2009


On Mon, Dec 21, 2009 at 9:17 AM, Jerald Zhao <jeraldzh at gmail.com> wrote:

> Hi everyone,
>
> I'm a new to VTK.
>
>
>
>
> http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Graphics/Testing/Tcl/capCow.tcl?root=VTK&content-type=text/plain
>  Is it possible to apply above code to vtkstructuredpointsreader class.
>
> ###
> # Read the polygonal data and generate vertex normals
> vtkBYUReader cow
>   cow SetGeometryFileName "$VTK_DATA_ROOT/Data/Viewpoint/cow.g"
> vtkPolyDataNormals cowNormals
>   cowNormals SetInputConnection [cow GetOutputPort]
> ###
>
> In my sight, these codes should be changed to below
>
>  ###
> # Read the polygonal data and generate vertex normals
> vtkStructuredPointsReader cow
>   cow SetFileName "g";
> vtkPolyDataNormals cowNormals
>   cowNormals SetInputConnection [cow GetOutputPort]
> ###
>
> However, the result were below
> ###
> ERROR: In C:\vtk\src\Filtering\vtkDemandDrivenPipeline.cxx, line 828
> 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.
> ERROR: In C:\vtk\src\Filtering\vtkDemandDrivenPipeline.cxx, line 828
> 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.
> ERROR: In C:\vtk\src\Filtering\vtkDemandDrivenPipeline.cxx, line 828
> 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.
> ERROR: In C:\vtk\src\Filtering\vtkDemandDrivenPipeline.cxx, line 828
> 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.
> ###
>
> where did I make a mistake?
>
>
> Regards,
> Jerald
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>
Jerald,

This type of question is much more appropriate for the vtk users list rather
than the developers list:
vtkusers at vtk.org

The error:
port index 0 for algorithm vtkPolyDataNormals is of type
vtkStructuredPoints, but a vtkPolyData is required.

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.

Anyone know why there are no normal filters for non-polydata objects?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20091221/1397f26d/attachment.html>


More information about the vtk-developers mailing list