[vtkusers] How to write vtkDelaunay3D into .vtk file
M. Jordan
mjordan at live.at
Tue Jan 17 04:32:38 EST 2017
Hi,
I use this code for it.
(the extract surface/smooth part is optional)
// clean the polydata
vtkSmartPointer<vtkCleanPolyData> cleanPolyData =
vtkSmartPointer<vtkCleanPolyData>::New();
cleanPolyData->SetInputConnection(INPUT->GetOutputPort());
cleanPolyData->Update();
// use delaunay3D
vtkSmartPointer<vtkDelaunay3D> delaunay3DAlpha =
vtkSmartPointer<vtkDelaunay3D>::New();
delaunay3DAlpha->SetInputData(cleanPolyData->GetOutput());
//delaunay3DAlpha->SetTolerance(0.0001);
//delaunay3DAlpha->SetAlpha(20);
//delaunay3DAlpha->SetAlphaLines(0);
//delaunay3DAlpha->SetAlphaTris(0);
// delaunay3DAlpha->SetAlphaTets(1);
//delaunay3DAlpha->SetAlphaVerts(0);
//delaunay3DAlpha->SetBoundingTriangulation(0);
delaunay3DAlpha->Update();
// extract surface
vtkGeometryFilter* geom = vtkGeometryFilter::New();
geom->SetInputData(delaunay3DAlpha->GetOutput());
geom->Update();
// smooth
vtkSmoothPolyDataFilter* smooth22 = vtkSmoothPolyDataFilter::New();
smooth22->SetInputConnection(geom->GetOutputPort());
smooth22->SetNumberOfIterations(15);
smooth22->SetRelaxationFactor(0.3);
smooth22->Update();
// write output file
vtkSmartPointer<vtkPolyDataWriter> writer =
vtkSmartPointer<vtkPolyDataWriter>::New();
writer->SetInputData(smooth22->GetOutput());
writer->SetFileName(PATH + FILENAME.vtk);
writer->Write();
________________________________
Von: vtkusers <vtkusers-bounces at vtk.org> im Auftrag von Kailu Shan <kailushan at 163.com>
Gesendet: Dienstag, 17. Jänner 2017 10:05
An: VTK Users
Betreff: [vtkusers] How to write vtkDelaunay3D into .vtk file
How to write the vtkDelaunay3D data into .vtk file?
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170117/469ab433/attachment.html>
More information about the vtkusers
mailing list