Open klonuo opened 11 years ago
Cannot reproduce on OSX. Can reproduce on Linux Ubuntu. Investigating.
Currently building VTK to debug the problem. Will leave pending until done and move to something else.
The freeze seems to happen in int vtkBandedPolyDataContourFilter::RequestData
. Very substantial routine, so it will take some time.
Apparently, it is stuck in this part of the RequestData
for ( mR=idx, intersectionPoint=0; !intersectionPoint; )
{
numPointsToAdd++;
mR = (mR + 1) % numFullPts;
if ( isContourValue[mR] && s[mR] != s[idx] ) intersectionPoint = 1;
}
never finding an intersection point, so the loop becomes infinite.
I start to think that nans are not the reason. do you get reasonable contour curves if you remove the nans, or do they look tangled and broken?
managed to reduce the dataset to the minimalistic
from numpy import array, nan
from mayavi import mlab
z=array([
[ -2.0, 4.7, 4.1],
[ 23.9, 27.4, nan],
[ 28.2, 26.6, nan],
])
mlab.surf(z)
mlab.show()
both the negative and the two nans seem to be important to obtain the problem. In any case, I am confident it's a vtk problem. I will write a pure vtk example and then submit it to the vtk bug tracker. I am unsure I can do much more than this.
I give up on this. I wanted to create the exact vtk pipeline that generates the bug to post a bug report to vtk, but I can't find a way to extract the runtime generated vtk pipeline from mayavi, short of going low-level.
I will do a bug report anyway, and I hope they can come up with a better understanding of what happens at low level. Will update this comment with a link to the vtk bug report.
Reported here
http://www.vtk.org/Bug/view.php?id=16065
@prabhuramachandran maybe you have some useful hints about the mayavi pipeline that might help me in providing a "working" vtk case.
If I draw with
mlab.surf(z)
, and change surface preferences to contours, I get line contours as expected. If I set filled contours CPU is maxed and process never finishes.z
is array with nans, and I guess that's the reason for this behavior as otherwise filled contours works fine.For example: