[vtkusers] create a polyData from selected cell

David Doria daviddoria at gmail.com
Fri May 18 10:21:45 EDT 2012


On Fri, May 18, 2012 at 10:15 AM, tasnim <hanene-jeder at hotmail.fr> wrote:

> 1)I used now the triangleFilter for my sphereSource, you mean that i have
> to
> use it for my new polyData also !!! , but what shall I make as an
> InputConnection for this new triangleFilter  please??
>

The triangle filter should go between the thing you want to subdivide and
the subdivision filter. It doesn't seem like there is a need to triangle
filter the sphere source in this case.


> 2) I followed the subdivision example by doing this:
>  vtkSmartPointer<vtkPolyDataAlgorithm> subdivisionFilter;
>                subdivisionFilter =
> vtkSmartPointer<vtkLoopSubdivisionFilter>::New();
>       dynamic_cast<vtkLoopSubdivisionFilter *>
>
> (subdivisionFilter.GetPointer())->SetNumberOfSubdivisions(numberOfSubdivisions);
>

Ah, I see. I added a comment about why this is done to the example. You
should typically not do it like this. Also, you should remove the VTK
version conditionals from your code to make it easier/shorter.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120518/4df19049/attachment.htm>


More information about the vtkusers mailing list