[vtkusers] Fwd: Help with finding points inside a cell.

Guðni Karl Rosenkjær grosenkj at eos.ubc.ca
Wed May 22 14:47:34 EDT 2013


Hello all,

I have a problem where I want to find cells in a rectilinear grid that are
within a unstructured grid. The unstructured grid has only 1 cell that is a
polyhedron (types=42).

I have written up a python script (testCellLocator.py in the attachment)
where I use vtkCellLoctor.FindCell embedded in a if statement to check if
the cell centers are in the polyhedron. I am not sure if this is the best
way to do this. However I have gotten the script to work, except there are
cells that are incorrectly determined inside and outside the polyhedron (in
pvScreenShot.png). It is clear that some of the cells are outside the
polyhedron cell and there are cells missing from within it.

The questions that I have are:
Is using the vtkCellLoctor.FindCell best way locate points with in the
polyhedron cell?
Using the vtkCellLoctor.FindCell method, what could be the reason for the
error in locating the cells?

Thank you very much in advance.

Cheers,
Gudni
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130522/720c8674/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pvScreenShot.png
Type: image/png
Size: 12775 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130522/720c8674/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testCellLocator.py
Type: application/octet-stream
Size: 2021 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130522/720c8674/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: polyhedronTest.vtu
Type: application/octet-stream
Size: 1111 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130522/720c8674/attachment-0001.obj>


More information about the vtkusers mailing list