[vtkusers] 'Incorrect' Geometry on Conversion to Polydata
Ted Kord
teddy.kord at googlemail.com
Sun May 16 17:32:50 EDT 2010
Hi Bill
My final goal is to generate an STL mesh from the .ply format.
I import the .ply file into Meshlab, remesh and output a .stl file.
If there's a better way, please let me know.
Theodore
On 16 May 2010 22:26, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> If you run GeometryFilter on Structured Points you will only get the
> boundary faces.
> \ply is a polygon format. AFAIK is cannot represent the solid elements
> that exist within Structured Points.
>
> Maybe you can share your final goal.
>
> Bill
>
> On Sun, May 16, 2010 at 5:22 PM, Ted Kord <teddy.kord at googlemail.com>
> wrote:
> > Hi
> > I converted a vtk StructuredData file to Polydata format. However, when I
> > load the result in Paraview, all I get is a red cube. Is there a filter
> I'm
> > supposed to use to get back my original image geometry?
> > What I actually want to do is obtain a .ply file from the .vtk file (by
> > saving the .vtp file as .ply). Is there a better way to do this?
> > Thanks
> > Theodore
> > ==
> > The code I used to convert form vtk to polydata is:
> >
> > int main(int, char *[])
> >
> > {
> >
> > vtkSmartPointer<vtkStructuredPointsReader> reader =
> > vtkSmartPointer<vtkStructuredPointsReader>::New();
> >
> > reader->SetFileName("test.vtk");
> >
> > reader->Update();
> >
> > //create Structuredpoints
> >
> > vtkSmartPointer<vtkStructuredPoints> structuredPoints =
> reader->GetOutput();
> >
> > vtkSmartPointer<vtkGeometryFilter> geometryFilter =
> > vtkSmartPointer<vtkGeometryFilter>::New();
> >
> > geometryFilter->SetInput(structuredPoints);
> >
> > geometryFilter->Update();
> >
> > vtkPolyData* polydata = geometryFilter->GetOutput();
> >
> > std::cout << "Output has " << polydata->GetNumberOfPoints() << " points."
> <<
> > std::endl;
> >
> > vtkSmartPointer<vtkXMLPolyDataWriter> writer =
> > vtkSmartPointer<vtkXMLPolyDataWriter>::New();
> >
> > writer->SetFileName("test.vtp");
> >
> > writer->SetInput(polydata);
> >
> > writer->Write();
> >
> > return EXIT_SUCCESS;
> >
> > }
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100516/25b07c36/attachment.htm>
More information about the vtkusers
mailing list