[vtkusers] Buggy behaviour of vtkSTLReader with wxPython

Petr Lorenz petr.lorenz at ieee.org
Mon Mar 14 16:30:40 EDT 2011


Hello,

I have a simple STL file (tst.stl) which is read using the vtkSTLReader. 
The reading succeeds if Update() is done at "POSITION 1" and fails if 
Update() is done at "POSITION 2" (see test1.py) after wx APP was initiated.

You can see that the code failed on the number of points and triangles 
read - using DebugOn(). To debug the problem in more detail, I have 
included more debugging messages in the vtkSTLReader.cxx code showing 
the read data. The different results are shown below. You can clearly 
see that the data read in the case of "POSITION 2" is wrong.

The code fails on Mac OS X 10.6.6 system with WX 2.9.1.1, Python 2.7 and 
VTK 5.6.1. On another Windows 7 system with WX 2.8.10.1, Python 2.7 and 
VTK 5.6.0 the code runs correctly.

Does anybody have an idea how to fix/debug the problem?

Thanks
Petr

--- test1.py:

import wx
import vtk

reader = vtk.vtkSTLReader()
reader.DebugOn()
reader.SetFileName("tst.stl")

#reader.Update()            # POSITION 1

app = wx.PySimpleApp()
frame = wx.Frame(None, -1, "STL Test", size = (800, 600))
frame.Show(True)

reader.Update()        # POSITION 2

app.MainLoop()


--- tst.stl:

solid SLD1
   facet normal 0.000000e+000 0.000000e+000 1.000000e+000
     outer loop
       vertex 0 0 0
       vertex 1 0 0
       vertex 1 1 0
     endloop
   endfacet
endsolid SLD1


-----------------------------------------
--- Output when Update() called at POSITION 1:

vtkSTLReader (0x103a6b710): vtkSTLReader (0x103a6b710): setting FileName 
to tst.stl

Debug: In /Users/lorenz/install/VTK/Filtering/vtkAlgorithm.h, line 150
vtkSTLReader (0x103a6b710): vtkSTLReader (0x103a6b710): setting 
AbortExecute to 0

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 309
vtkSTLReader (0x103a6b710):  Reading ASCII STL file

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 315
vtkSTLReader (0x103a6b710):  First line: solid SLD1

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 326
vtkSTLReader (0x103a6b710):  First data. line: facet, x: 0, x+1: 0, x+2: 1

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 338
vtkSTLReader (0x103a6b710):  line: outer loop

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 345
vtkSTLReader (0x103a6b710):  Vertex 1. line: outer loop
, x: 0, x+1: 0, x+2: 0

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 352
vtkSTLReader (0x103a6b710):  Vertex 2. line: outer loop
, x: 1, x+1: 0, x+2: 0

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 359
vtkSTLReader (0x103a6b710):  Vertex 3. line: outer loop
, x: 1, x+1: 1, x+2: 0

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 362
vtkSTLReader (0x103a6b710):  line: endloop

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 364
vtkSTLReader (0x103a6b710):  line:   endfacet

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 143
vtkSTLReader (0x103a6b710): Read: 3 points, 1 triangles

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 204
vtkSTLReader (0x103a6b710): Merged to: 3 points, 1 triangles

Debug: In /Users/lorenz/install/VTK/Filtering/vtkAlgorithm.h, line 151
vtkSTLReader (0x103a6b710): vtkSTLReader (0x103a6b710): returning 
AbortExecute of 0

Debug: In /Users/lorenz/install/VTK/Common/vtkObject.cxx, line 850
vtkSTLReader (0x103a6b710): Registered by NULL, ReferenceCount = 3

Debug: In /Users/lorenz/install/VTK/Common/vtkObject.cxx, line 870
vtkSTLReader (0x103a6b710): UnRegistered by NULL, ReferenceCount = 2

Debug: In /Users/lorenz/install/VTK/Common/vtkObject.cxx, line 870
vtkSTLReader (0x103a6b710): UnRegistered by NULL, ReferenceCount = 1

Debug: In /Users/lorenz/install/VTK/Common/vtkObject.cxx, line 845
vtkSTLReader (0x103a6b710): Registered by vtkGarbageCollectorImpl 
(0x7fff5fbff280), ReferenceCount = 3

Debug: In /Users/lorenz/install/VTK/Common/vtkObject.cxx, line 865
vtkSTLReader (0x103a6b710): UnRegistered by 
vtkStreamingDemandDrivenPipeline (0x103a6bb30), ReferenceCount = 2

Debug: In /Users/lorenz/install/VTK/Common/vtkObject.cxx, line 865
vtkSTLReader (0x103a6b710): UnRegistered by vtkGarbageCollectorImpl 
(0x7fff5fbff280), ReferenceCount = 0

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.h, line 59
vtkSTLReader (0x103a6b710): vtkSTLReader (0x103a6b710): setting FileName 
to (null)

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 38
vtkSTLReader (0x103a6b710): vtkSTLReader (0x103a6b710): setting Locator to 0

Debug: In /Users/lorenz/install/VTK/Filtering/vtkAlgorithm.cxx, line 46
vtkAlgorithm (0x103a6b710): vtkAlgorithm (0x103a6b710): setting 
Information to 0

Debug: In /Users/lorenz/install/VTK/Common/vtkObject.cxx, line 153
vtkObject (0x103a6b710): Destructing!

-----------------------------------------
--- Output when Update() called at POSITION 2:

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.h, line 59
vtkSTLReader (0x1037b88a0): vtkSTLReader (0x1037b88a0): setting FileName 
to tst.stl

Debug: In /Users/lorenz/install/VTK/Filtering/vtkAlgorithm.h, line 150
vtkSTLReader (0x1037b88a0): vtkSTLReader (0x1037b88a0): setting 
AbortExecute to 0

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 309
vtkSTLReader (0x1037b88a0):  Reading ASCII STL file

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 315
vtkSTLReader (0x1037b88a0):  First line: solid SLD1

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 326
vtkSTLReader (0x1037b88a0):  First data. line: facet, x: 0, x+1: 
4.59163e-41, x+2: 7.38784e-37

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 338
vtkSTLReader (0x1037b88a0):  line: .000000e+000 0.000000e+000 1.000000e+000

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 345
vtkSTLReader (0x1037b88a0):  Vertex 1. line: .000000e+000 0.000000e+000 
1.000000e+000
, x: 0, x+1: 4.59163e-41, x+2: 7.38784e-37

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 352
vtkSTLReader (0x1037b88a0):  Vertex 2. line: .000000e+000 0.000000e+000 
1.000000e+000
, x: 0, x+1: 4.59163e-41, x+2: 7.38784e-37

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 359
vtkSTLReader (0x1037b88a0):  Vertex 3. line: .000000e+000 0.000000e+000 
1.000000e+000
, x: 0, x+1: 0, x+2: 0

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 362
vtkSTLReader (0x1037b88a0):  line: vertex 1 0 0

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 364
vtkSTLReader (0x1037b88a0):  line:       vertex 1 1 0

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 338
vtkSTLReader (0x1037b88a0):  line: endsolid SLD1

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 345
vtkSTLReader (0x1037b88a0):  Vertex 1. line: endsolid SLD1
, x: 0, x+1: 0, x+2: 0

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 352
vtkSTLReader (0x1037b88a0):  Vertex 2. line: endsolid SLD1
, x: 0, x+1: 0, x+2: 0

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 359
vtkSTLReader (0x1037b88a0):  Vertex 3. line: endsolid SLD1
, x: 0, x+1: 0, x+2: 0

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 362
vtkSTLReader (0x1037b88a0):  line: endsolid SLD1

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 364
vtkSTLReader (0x1037b88a0):  line: endsolid SLD1

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 143
vtkSTLReader (0x1037b88a0): Read: 6 points, 2 triangles

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 204
vtkSTLReader (0x1037b88a0): Merged to: 2 points, 0 triangles

Debug: In /Users/lorenz/install/VTK/Filtering/vtkAlgorithm.h, line 151
vtkSTLReader (0x1037b88a0): vtkSTLReader (0x1037b88a0): returning 
AbortExecute of 0

Debug: In /Users/lorenz/install/VTK/Common/vtkObject.cxx, line 850
vtkSTLReader (0x1037b88a0): Registered by NULL, ReferenceCount = 3

Debug: In /Users/lorenz/install/VTK/Common/vtkObject.cxx, line 870
vtkSTLReader (0x1037b88a0): UnRegistered by NULL, ReferenceCount = 2

Debug: In /Users/lorenz/install/VTK/Common/vtkObject.cxx, line 870
vtkSTLReader (0x1037b88a0): UnRegistered by NULL, ReferenceCount = 1

Debug: In /Users/lorenz/install/VTK/Common/vtkObject.cxx, line 845
vtkSTLReader (0x1037b88a0): Registered by vtkGarbageCollectorImpl 
(0x7fff5fbff280), ReferenceCount = 3

Debug: In /Users/lorenz/install/VTK/Common/vtkObject.cxx, line 865
vtkSTLReader (0x1037b88a0): UnRegistered by 
vtkStreamingDemandDrivenPipeline (0x1030d6c20), ReferenceCount = 2

Debug: In /Users/lorenz/install/VTK/Common/vtkObject.cxx, line 865
vtkSTLReader (0x1037b88a0): UnRegistered by vtkGarbageCollectorImpl 
(0x7fff5fbff280), ReferenceCount = 0

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.h, line 59
vtkSTLReader (0x1037b88a0): vtkSTLReader (0x1037b88a0): setting FileName 
to (null)

Debug: In /Users/lorenz/install/VTK/IO/vtkSTLReader.cxx, line 38
vtkSTLReader (0x1037b88a0): vtkSTLReader (0x1037b88a0): setting Locator to 0

Debug: In /Users/lorenz/install/VTK/Filtering/vtkAlgorithm.cxx, line 46
vtkAlgorithm (0x1037b88a0): vtkAlgorithm (0x1037b88a0): setting 
Information to 0

Debug: In /Users/lorenz/install/VTK/Common/vtkObject.cxx, line 153
vtkObject (0x1037b88a0): Destructing!






More information about the vtkusers mailing list