<div dir="ltr">In the following VTK example:<div><br></div><div><a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ContoursToSurface">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ContoursToSurface</a><br></div>

<div><br></div><div>after the surface of sphere is generated, I am trying to simply save the surface as a vtp file using the following code, but I can not, that is, the saved file does not show anything. Can anyone help why this happens? Thanks. </div>

<div><br></div><div><div>        </div><div>    vtkPolyData *myvtkPolyData = vtkPolyData::SafeDownCast( surfaceMapper->GetInputAsDataSet() );</div><div>    vtkSmartPointer<vtkXMLPolyDataWriter> writer = vtkSmartPointer<vtkXMLPolyDataWriter>::New();</div>

<div>    writer->SetFileName("/home/surface.vtp");</div><div>    writer->SetInputData( myvtkPolyData );</div><div>    writer->SetDataModeToBinary();</div><div>    writer->Write();</div></div></div>