[vtkusers] Isosurface for randomly distributed data (part II)

Andreu, Jean-Philippe jean-philippe.andreu at joanneum.at
Wed May 22 13:57:20 EDT 2002


Thanx to Christian and William for their help on my previous question.

I looked at vtkContourFilter and I think that vtkContourGrid should also
make it (please correct me if I am wrong).

I am still fighting to get the isosurface.

I copied a part of my code (assume that 'pts' is properly initialized with
the pts 3D coordinates).

--------------------------------------------------------
vtkPolyData* polydata = vtkPolyData::New();
polydata->SetPoints(pts);

vtkFloatArray *scalars = vtkFloatArray::New();
scalars->SetNumberOfValues(NbOfPts);
for (i=0; i<NbOfPts; i++)
	scalars->SetValue(i,1.0); // arbitrary value
polydata->GetPointData()->SetScalars(scalars);

// Delaunay triangulation
vtkDelaunay3D *del = vtkDelaunay3D::New();
del->SetInput(polydata);

// Isosurface
vtkContourGrid *iso = vtkContourGrid::New();
iso->SetInput(del->GetOutput());
iso->SetValue(0,0.1);

vtkPolyData *outdata = iso->GetOutput(); 
vtkIdType numCells = outdata->GetNumberOfCells();
--------------------------------------------------------

...numCells remains desesperately at zero... :-(

I perhaps misunderstood the setting of the value for the isosurface
(iso->SetValue(0,0.1)).

thanx in advance for your help,

Jean-Philippe



More information about the vtkusers mailing list