[vtkusers] Obtain Points from Polydata
Matias Montroull
matimontg at gmail.com
Wed Jan 15 08:44:10 EST 2014
Ok, I was able to get the points by doing this:
vtkPolyDataNormals skinnormals = vtkPolyDataNormals.New();
skinnormals.SetInputConnection(skinextractor.GetOutputPort());
//skinextractor is a vtkContourFilter
skinnormals.SetFeatureAngle(90.0);
skinnormals.ComputePointNormalsOn();
vtkPolyData polys = new vtkPolyData();
polys= skinnormals.GetOutput();
polys.Update();
for (int i = 0; i < polys.GetNumberOfPoints(); i++)
{
double[] p = new double[3];
p=polys.GetPoint(i);
}
I see each point.
Now... Next question, how do I get the triangles in the mesh??
On Wed, Jan 15, 2014 at 9:48 AM, David Doria <daviddoria at gmail.com> wrote:
> You can get the coordinates manually with:
>
> double p[3];
> points->GetPoint(i, p);
>
> but if you want to write them with a writer (e.g. vtkSimplePointsWriter),
> they will always have to be wrapped in a vtkPolyData first
> (polydata->SetPoints(points)).
>
> David
>
> _______________________________________________
> 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/20140115/7ea70712/attachment.html>
More information about the vtkusers
mailing list