[vtkusers] vtkPolygon::PoinInPolygon and normals

Jothy jothybasu at gmail.com
Fri Jul 22 05:43:55 EDT 2011


Hi all,

I have a vtkPolyData (generated from vtkDiscreteMarchingCubes) and I
need to find out the points inside this 3D polygon. I looked at this
example in wiki

http://www.vtk.org/Wiki/VTK/Examples/Cxx/Utilities/PointInPolygon.

I tried to calculate the normal like

vtkSmartPointer<vtkPolygon> polygon =
    vtkSmartPointer<vtkPolygon>::New();
double n[3];
//pd=vtkPolyData (mesh)
  polygon->ComputeNormal(pd->GetPoints()->GetNumberOfPoints(),
          static_cast<double*>(pd->GetPoints()->GetData()->GetVoidPointer(0)),
n);

but qDebug()<<n;//similar to std::cout

it prints a hexadecimal number.

I don't understand how to do this correctly.

Also, should I calculate this normal for each point I am testing.

Thanks

Jothy



More information about the vtkusers mailing list