[vtkusers] vtkContourFilter on an OBJ file
Anestis Koutsoudis
akoutsou at ipet.gr
Mon Jul 28 05:54:22 EDT 2008
Hi all,
Is it possible to generate the contours of a 3D model (e.g. obj format)
using the vtkContour Filter?
This is what I have been trying and it doesn't work.
Any ideas are really welcomed.
vtkOBJReader *importer = vtkOBJReader::New();
importer->SetFileName(argv[1]);
importer->Update();
vtkTriangleFilter *tri = vtkTriangleFilter::New();
tri->SetInput(importer->GetOutput());
tri->Update();
vtkContourFilter *contour = vtkContourFilter::New();
contour->SetInput(tri->GetOutput());
contour->Update();
vtkPolyDataMapper *contourMapper = vtkPolyDataMapper::New();
contourMapper->SetInput(contour->GetOutput());
contourMapper->SetScalarRange(0,7);
vtkActor *telikosactor = vtkActor::New();
telikosactor->SetMapper(contourMapper);
vtkRenderer *ren = vtkRenderer::New();
ren->AddActor(telikosactor);
Cheers
More information about the vtkusers
mailing list