[vtkusers] ActiViz C# | Get Cells of a Polydata | Get Points of every cell in PolyData

David Gobbi david.gobbi at gmail.com
Wed Jan 15 12:49:38 EST 2014


I think you are just missing this final piece inside your loop:

  {

    ...
    double[] pa = new double[3];
    double pa = polys.GetPoint(a);
    double[] pb = new double[3];
    double pb = polys.GetPoint(b);
    double[] pc = new double[3];
    double pc = polys.GetPoint(c);
  }

The details of the syntax are just guesswork on my part, because I've
never used C# or Activiz.

  David

On Wed, Jan 15, 2014 at 9:45 AM, Matias Montroull <matimontg at gmail.com> wrote:
> Hi,
>
> I'm trying to get the Cells out of a PolyData. So far I've done this:
>
>               vtkCellArray Cellarray = new vtkCellArray();
>               Cellarray = polys.GetPolys(); //where polys is a vtkpolydata
> instance
>               int numcells = Cellarray.GetNumberOfCells(); //I get the
> number of cells, I want to iterate through each cell..
>
> I've done this:
>               vtkIdList idlist = new vtkIdList();
>
>               Cellarray.InitTraversal();
>
>               for (int j = 0; j < polys.GetNumberOfPolys(); j++)
>               {
>                   Cellarray.GetNextCell(idlist);
>
>                   double a = idlist.GetId(0);
>                   double b = idlist.GetId(1);
>                   double c = idlist.GetId(2);
>               }
> but I don't get the points in the cell, what I'm doing wrong?


More information about the vtkusers mailing list