[vtkusers] vtkStripper SegFaults on a simple mesh (but works on other meshes)

Brice Due bricedue at verizon.net
Fri May 18 12:08:36 EDT 2007


Hello, I am learning python-vtk and I have run into something very  
strange. I have a short python script which takes a simple .vtk poly data  
file and converts the triangle list to triangle strips (listing below).  
The input .vtk file is generated by a Blender export script. The  
vtkStripper script works fine on all my test data *except* one paricular  
mesh. On that mesh vtkStripper segfaults and vtkPolyDataWriter outputs  
nothing.

I have disected the mesh and found that the problem involves only a small  
area (listing below). There are no duplicate points, or wrong-way normals,  
or anything obviously degenerate about this mesh. I don't understand what  
is causing this one mesh to fail when going through vtkStripper. Just this  
small sub-mesh (listed below) is enough to cause vtkStripper to segfault.  
The original mesh is a closed surface, which topologicaly seems equivalent  
to a cylinder. This fragment is at one end of that cylinder.

Can anyone please identify the problem with this mesh fragment? And can  
anyone recommend a pipeline that will correct such issues before the mesh  
reaches vtkStripper? Adding vtkTriangleFilter does not solve the mesh  
issue. Does vtkStripper have data set restrictions that aren't listed on  
the doxygen man page? Or is this a bug?

I am using VTK 4.4.2-5 bound to python 2.3 on a linux (debian derived)  
system. The vtk libs were installed from the python-vtk package version  
4.4.2-5.

Thank You Very Much!

-brice

############################
 from vtk import vtkPolyDataReader, vtkStripper, vtkPolyDataWriter

reader = vtkPolyDataReader()
reader.SetFileName("stripify-vtkinput.vtk")

stripper = vtkStripper()
stripper.SetInput(triangles.GetOutput())
stripper.Update()

stripper = vtkStripper()
stripper.SetInput(triangles.GetOutput())
stripper.Update()

newmesh = None
newmesh = stripper.GetOutput()

writer = vtkPolyDataWriter()
writer.SetInput(newmesh)
writer.SetFileName("stripify-vtkoutput.vtk")
writer.Write()

############################
# vtk DataFile Version 3.0
vtk PolyData input
ASCII
DATASET POLYDATA
POINTS 41 float
0.010 -0.014 -21.389
-3.754  2.721 -20.773
-1.428  4.411 -20.773
3.774  2.721 -20.773
4.663 -0.014 -20.773
3.774 -2.749 -25.096
3.774 -2.749 -20.773
4.663 -0.014 -25.096
1.448 -4.439 -25.096
1.448 -4.439 -20.773
-1.428 -4.439 -25.096
-1.428 -4.439 -20.773
-3.754 -2.749 -25.096
-3.754 -2.749 -20.773
-4.643 -0.014 -25.096
-4.643 -0.014 -20.773
-3.754  2.721 -25.096
-1.428  4.411 -25.096
1.448  4.411 -25.096
1.448  4.411 -20.773
3.774  2.721 -25.096
6.965  5.040 -23.944
8.607 -0.014 -23.944
11.243 -0.014 -22.524
9.098  6.589 -22.524
2.667  8.163 -23.944
3.481  10.670 -22.524
-2.647  8.163 -23.944
-3.461  10.670 -22.524
-6.946  5.040 -23.944
-9.078  6.589 -22.524
-8.588 -0.014 -23.944
-11.223 -0.014 -22.524
-6.946 -5.067 -23.944
-9.078 -6.616 -22.524
-2.647 -8.190 -23.944
-3.461 -10.697 -22.524
2.667 -8.190 -23.944
3.481 -10.697 -22.524
6.965 -5.067 -23.944
9.098 -6.616 -22.524
POLYGONS 70 280
3 0 1 2
3 0 3 4
3 5 6 7
3 5 7 8
3 9 10 6
3 9 6 5
3 11 12 10
3 11 10 9
3 13 14 12
3 13 12 11
3 15 16 14
3 15 14 13
3 17 18 15
3 18 16 15
3 19 20 18
3 19 18 17
3 21 22 20
3 21 20 19
3 23 24 22
3 23 22 21
3 8 7 24
3 8 24 23
3 2 25 0
3 25 3 0
3 26 27 0
3 27 1 0
3 28 29 0
3 29 26 0
3 4 30 0
3 30 28 0
3 23 31 32
3 23 32 8
3 31 33 32
3 34 33 31
3 31 35 34
3 35 36 34
3 23 21 31
3 21 35 31
3 21 19 37
3 21 37 35
3 35 37 38
3 35 38 36
3 37 39 40
3 37 40 38
3 17 39 19
3 39 37 19
3 15 41 17
3 41 39 17
3 39 41 40
3 41 42 40
3 41 43 42
3 43 44 42
3 15 13 43
3 15 43 41
3 13 11 45
3 13 45 43
3 43 45 44
3 45 46 44
3 45 47 46
3 47 48 46
3 11 9 47
3 11 47 45
3 9 5 47
3 5 49 47
3 47 49 48
3 49 50 48
3 32 33 50
3 32 50 49
3 8 32 5
3 32 49 5
################################

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



More information about the vtkusers mailing list