[vtkusers] (Python) Extracting strips from vtkStripper?

James Urquhart j_urquhart at btinternet.com
Tue Jan 6 11:02:10 EST 2004


On Sunday 04 January 2004 6:41 pm, James Urquhart wrote:
> Hi there,
>
> I am currently using the vtkStripper  class in VTK to generate triangle
> strips for my 3d models.
>
> However, i am pretty much unfamiliar with the python vtk bindings, so i
> have become stuck.
> I seem to have gotten my data into VTK properly, as the stripper seems to
> function with my test mesh (generates 16 strips).
> My question is,  how do i get the data *OUT* of VTK and back into python?
> I need to get the strip indices (indexing into my mesh vertices), however i
> cannot seem to figure out a way to do it.
>

Ok,

I seem to have been able to get the strip indices via :
stripData = vtkNewStrips.GetData()
indices = []
for inds in range(0, stripData.GetSize()):
	indices.append(stripData.GetValue(inds))
print indices

(presuming vtkNewStrips is a set of triangle strips)

However, whilst this gives me indices, it gives me the whole lot (for every 
single triangle strip), so its a bit useless unless i can tell where each 
strip starts in the indices list. (which of course i can't seem to)
Oddly enough, it also seems to give me some strange data at the end, not part 
of the original set of primitives. 

e.g(2 seperate triangles) :
[3, 0, 1, 2, 3, 0, 2, 3, 1076517916, 1076517916, 1077011456, 257, 1076517916, 
1076517916, 1077007856]

I have no idea what these extra values are, but im pretty sure i didn't put 
them there :)

Regardless, does anyone know how i could access this data properly in python?
(This is in the latest release of VTK btw)

Thanks,
-James




More information about the vtkusers mailing list