hi, <br>Thanks for your reply!<br>which version are you using? I am using vtk 5.10 and also test with vtk 6.1.<br>Below is my revised code:<br><br>vtkSmartPointer<vtkDataWriter> writer=<br> vtkSmartPointer<vtkDataWriter>::New();<br> writer->SetFileName("delaunay3.vtk");<br> writer->SetInputData(delaunay->GetOutput());<br> writer->Write();<br><br>error C2664: 'void vtkWriter::SetInputData(vtkDataObject *)' : cannot convert parameter 1 from 'vtkUnstructuredGrid *' to 'vtkDataObject *'<br><br>在 2017-01-17 17:32:38,"M. Jordan" <mjordan@live.at> 写道:<br> <blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Hi,<br>
<br>
I use this code for it.<br>
(the extract surface/smooth part is optional)<br>
<br>
</p>
<div>// clean the polydata<br>
vtkSmartPointer<vtkCleanPolyData> cleanPolyData =<br>
vtkSmartPointer<vtkCleanPolyData>::New();<br>
cleanPolyData->SetInputConnection(INPUT->GetOutputPort());<br>
cleanPolyData->Update();<br>
// use delaunay3D<br>
vtkSmartPointer<vtkDelaunay3D> delaunay3DAlpha =<br>
vtkSmartPointer<vtkDelaunay3D>::New();<br>
delaunay3DAlpha->SetInputData(cleanPolyData->GetOutput());<br>
//delaunay3DAlpha->SetTolerance(0.0001);<br>
<span>//</span>delaunay3DAlpha->SetAlpha(20); <br>
<span>//</span>delaunay3DAlpha->SetAlphaLines(0);<br>
<span>//</span>delaunay3DAlpha->SetAlphaTris(0);<br>
<span>//</span> delaunay3DAlpha->SetAlphaTets(1);<br>
<span>//</span>delaunay3DAlpha->SetAlphaVerts(0);<br>
<span>//</span>delaunay3DAlpha->SetBoundingTriangulation(0); <br>
delaunay3DAlpha->Update();<br>
// extract surface<br>
vtkGeometryFilter* geom = vtkGeometryFilter::New();<br>
geom->SetInputData(delaunay3DAlpha->GetOutput());<br>
geom->Update();<br>
// smooth<br>
vtkSmoothPolyDataFilter* smooth22 = vtkSmoothPolyDataFilter::New();<br>
smooth22->SetInputConnection(geom->GetOutputPort());<br>
smooth22->SetNumberOfIterations(15);<br>
smooth22->SetRelaxationFactor(0.3);<br>
smooth22->Update();<br>
// write output file<br>
vtkSmartPointer<vtkPolyDataWriter> writer =<br>
vtkSmartPointer<vtkPolyDataWriter>::New();<br>
writer->SetInputData(smooth22->GetOutput());<br>
writer->SetFileName(PATH + FILENAME.vtk);<br>
writer->Write(); </div>
<br>
<p></p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>Von:</b> vtkusers <<A href="mailto:vtkusers-bounces@vtk.org">vtkusers-bounces@vtk.org</A>> im Auftrag von Kailu Shan <<A href="mailto:kailushan@163.com">kailushan@163.com</A>><br>
<b>Gesendet:</b> Dienstag, 17. Jänner 2017 10:05<br>
<b>An:</b> VTK Users<br>
<b>Betreff:</b> [vtkusers] How to write vtkDelaunay3D into .vtk file</font>
<div> </div>
</div>
<div>
<div style="line-height:1.7; color:#000000; font-size:14px; font-family:Arial">
<div>How to write the vtkDelaunay3D data into .vtk file?</div>
<div>Thanks!</div>
</div>
</div>
</div>
</div>
</blockquote>