[vtkusers] Segmentation fault on call to FindCell()

David Doria daviddoria at gmail.com
Fri Oct 22 13:09:58 EDT 2010


On Fri, Oct 22, 2010 at 12:54 PM, John Haiducek <jhaiduce at gmail.com> wrote:

> After obtaining and examining a traceback, I found the segmentation fault
> was occurring in vtkHexahedron::InterpolationFunctions, which apparently
> expects the double*weights to be an array of 8 doubles. This is aggravating,
> since the documentation says nothing about the expected length of *weights.
> The example at
> http://www.cmake.org/Wiki/VTK/Examples/Cxx/PolyData/PointInsideObject2uses double weights[3], which also makes no sense since there's no way to
> make a 3-dimensional cell with only 3 faces/vertices. Can anyone tell me
> exactly what's expected to be passed to vtkPointSet::FindCell()??
>

John,

>From this:
http://www.vtk.org/doc/nightly/html/classvtkCell.html#a463203095c011df36980b4677e8825b0
(vtkCell::EvaluatePosition, the function that is eventually called by
FindCell), I believe the length of weights array must be the same as the
number of points in the cell. I'm not sure how you are supposed to know this
ahead of time in general...

In the example you mentioned the array was made length 3 because all of the
cells are triangles (3 points).

Hopefully someone else will be able to shed some light on the typical
process of determining the number of points in the cell before the cell id
is known.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101022/63034dc5/attachment.htm>


More information about the vtkusers mailing list