[vtkusers] Constructing closed surface (please help!)
yfl at doc.ic.ac.uk
yfl at doc.ic.ac.uk
Tue Mar 29 16:31:10 EST 2005
Thanks Brad for helping me, it works after i include vtkImageData.h and now I
can run the program. But I find that it renders nothing instead of a surface.
vtkPolyData *point_data = vtkPolyData::New();
point_data->SetPoints(points);
point_data->Modified();
point_data->Update();
vtkSurfaceReconstructionFilter *reconstruct =
vtkSurfaceReconstructionFilter::New();
reconstruct->SetInput(point_data);
reconstruct->Modified();
reconstruct->Update();
vtkContourFilter *contour = vtkContourFilter::New();
contour->SetInput(reconstruct->GetOutput());
contour->SetValue(0, 0.0);
vtkReverseSense *reverse = vtkReverseSense::New();
reverse->SetInput(contour->GetOutput());
reverse->ReverseCellsOn();
reverse->ReverseNormalsOn();
vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();
mapper->SetInput(reverse->GetOutput());
mapper->ScalarVisibilityOff();
mapper->Modified();
mapper->Update();
vtkActor *file1_actor = vtkActor::New();
file1_actor->SetMapper(mapper);
file1_actor->GetProperty()->SetOpacity(1);
file1_actor->Modified();
I learn from the example of the vtk reference book that it is the method to
generate surface from unorganised points. So what is wrong with my program?
Does anyone know?
Thank you
Krista
----- End forwarded message -----
More information about the vtkusers
mailing list