[vtkusers] Problem conversion vtkStructuredPoints to mesh/Polydata

agatte agatakrason at gmail.com
Wed Mar 28 08:15:03 EDT 2012


I have already made it.  I used another filter. It works well ;) 

This is a code :


	 vtkSmartPointer<vtkStructuredPointsReader> reader =
     vtkSmartPointer<vtkStructuredPointsReader>::New();
     reader->SetFileName("Points.vtk");
     reader->Update();

	 vtkSmartPointer<vtkImageDataGeometryFilter> geometryFilter =
     vtkSmartPointer<vtkImageDataGeometryFilter>::New();
     geometryFilter->SetInputConnection(reader->GetOutputPort());
     geometryFilter->Update();


    vtkContourFilter * contour = vtkContourFilter::New();
    contour->SetInput(geometryFilter->GetOutput());
    contour->SetValue(0, 128);



	// Save mesh as vtk Poly Data
    vtkPolyDataWriter * writerMesh = vtkPolyDataWriter::New();
	writerMesh->SetFileName("MeshVTK.vtk");
    writerMesh->SetInput(contour->GetOutput());
    writerMesh->Write();

    contour->Delete();
    writerMesh->Delete();



--
View this message in context: http://vtk.1045678.n5.nabble.com/Problem-conversion-vtkStructuredPoints-to-mesh-Polydata-tp5598716p5600262.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list