[vtkusers] Strange vtkCell::GetEdge results

David Doria daviddoria+vtk at gmail.com
Mon Apr 19 10:40:23 EDT 2010


On Sun, Apr 18, 2010 at 9:25 AM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:

> I am trying to get all vertices connected by an edge to a particular vertex
> in a mesh.
>
> I tried this:
> http://www.vtk.org/Wiki/VTK/Examples/CellEdges
>
> However, all of the point ids seem to be 0.
>
> The output is:
>
> The cell has 3 edges.
> Edge 0 has 2 points.
> Edge 0 uses point 0
> Edge 0 uses point 0
> Edge 1 has 2 points.
> Edge 1 uses point 0
> Edge 1 uses point 0
> Edge 2 has 2 points.
> Edge 2 uses point 0
> Edge 2 uses point 0
>
> Where I would expect something like
>
> <http://www.vtk.org/Wiki/VTK/Examples/CellEdges>
> The cell has 3 edges.
> Edge 0 has 2 points.
> Edge 0 uses point 0
> Edge 0 uses point 1
> Edge 1 has 2 points.
> Edge 1 uses point 1
> Edge 1 uses point 2
> Edge 2 has 2 points.
> Edge 2 uses point 0
> Edge 2 uses point 2
>
> Can anyone see where this is going wrong?
>
> Thanks,
>
> David
>

I guess you have to explicitly setup the topology for the triangle. When I
added:

  triangle->GetPointIds()->SetId ( 0, 0 );
  triangle->GetPointIds()->SetId ( 1, 1 );
  triangle->GetPointIds()->SetId ( 2, 2 );

it worked as expected.

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100419/5860c7ca/attachment.htm>


More information about the vtkusers mailing list