[vtkusers] How can I make printf all the generated surface coordinate ?

Amy Squillacote amy.squillacote at kitware.com
Tue Dec 5 09:18:18 EST 2006


Hi Ismail,

Do something like the following after your call to cf->Update();.

vtkPoints *points = cf->GetOutput()->GetPoints();
int numPts = points->GetNumberOfPoints();
int i;
double pt[3];

for (i = 0; i < numPts; i++)
  {
    points->GetPoint(i, pt);
    printf("point %d: %f %f %f\n", i, pt[0], pt[1], pt[2]);
  }

- Amy

Ismail Elkhrachy wrote:
> Hi:
>   A quick question, I have a point cloud(x, y,z) that represents an
> object surface. After I use surface reconstruct filter 
> (vtkSurfaceReconstructionFilter)
> , and then used the vtkContourFilter, my qustion is:
> How can I make printf all the generated surface coordinate ?
>
>
> vtkSurfaceReconstructionFilter *surf = 
> vtkSurfaceReconstructionFilter::New();
>
>   surf->SetInput(polyData1);   surf->SetSampleSpacing(0.026);     
> surf->GetReleaseDataFlag();     surf->Update();  
>   vtkContourFilter *cf=vtkContourFilter::New();
>   cf->SetInput(surf->GetOutput());
>   cf->SetValue (0, 0.0 );
>   cf->Update();
>
>



More information about the vtkusers mailing list