[vtkusers] How to create triangle strips?

David Gobbi david.gobbi at gmail.com
Mon Nov 22 11:57:33 EST 2010


Hi Hugo,

The vtkPolyData stores the strips in an array called "Strips", that is
how it knows what cells are strips.  And all vtkDataSet objects have a
GetCellType(i) method that VTK can use to check the type of cell "i".
I have some code here that generates several shapes with triangle
strips:
https://github.com/dgobbi/ToolCursor/blob/master/vtkGeometricCursorShapes.cxx

  David


On Mon, Nov 22, 2010 at 5:55 AM, Hugo Valdebenito <hugo at maptek.cl> wrote:
>
> You should to see the triangles, maybe it's wrong. with 4 ids you define 2
> triagles, with 5 --> 3 and so on (that structure saves memory). How does you
> said to vtk that you are using Strips?  I don't know how to define that on
> VTK.
>
>
> Thanks!
>
>
>
> 2010/11/19 David Doria <daviddoria at gmail.com>
>>
>> On Fri, Nov 19, 2010 at 3:22 PM, Hugo Valdebenito <hugo at maptek.cl> wrote:
>> > Thanks david!!
>> >
>> > vtkCellArray object is defined, but never used....
>> >
>> > Anyone can suggest a fix?, I'm beginner on VTK
>> > Hugo
>>
>> Try it now. It doesn't show the line through the middle of the square
>> (the center edge of the triangles), but maybe that is expected with a
>> triangle strip?
>>
>>
>> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/GeometricObjects/TriangleStrip
>>
>> David



More information about the vtkusers mailing list