[vtkusers] Access violation clipping quadratic hex's + fix
John Platt
jcplatt at dsl.pipex.com
Sun Jan 13 14:57:53 EST 2008
Hi,
Clipping an unstructured grid containing (theoretically) more than 8
quadratic hex's with a plane may fail with an access violation copying
the cell data. In practice, at least 24 cells are needed on Win XP and
probably many more for nix.
I think the problem is in vtkQuadraticHexahedron::Clip() with the call
this->Hex->Clip( , , , , , , this->CellData, cellId, , );
this->CellData stores 8 identical copies of the quadratic hex's cell
data for each subdivided linear hex but cellId has a maximum value of
the number of cells in the grid - 1. The access violation occurs in
vtkTetra::Clip() in the calls outCD->CopyData() where an attempt is made
to copy cell data for cellId.
I think the call should be
this->Hex->Clip( , , , , , , this->CellData, i, , );
where 'i' is the index of the linear hex.
BUT .
I don't understand why it is necessary to copy the cell data in the
first place. I would have thought that all subdivided cells have the
same cell data as the parent. In this case, dispense with this->CellData
and just use
this->Hex->Clip( , , , , , , inCd, cellId, , );
Note that this is a problem in VTK 5.0 but I have patched
vtkQuadraticHexahedron to the latest CVS version and the problem still
repeats. A similar problem may also exist in
vtkQuadraticHexahedron::Contour().
John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080113/4d3fae8f/attachment.htm>
More information about the vtkusers
mailing list