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

Ismail Elkhrachy I.Elkhrachy at tu-bs.de
Tue Dec 5 09:51:05 EST 2006


Amy Squillacote wrote:
> 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();
>>
>>
Thanks Amy;
It is working ok, Thanks again!!  But the output  coordinates pt[0], 
pt[1], pt[2]) are not in the same coordinates system of polyDat1, Do you 
know how to get the in the same old coordinate system


for example
The bounds for the input data coordinates is :

 X_min = 1.037000,    X_max =2.401000
 Y_min = 2.508000  ,  Y_max =4.061000
 Z_min = -19.063601 , Z_zmax =-18.101999  

GetBounds();
But for the output pt[0], pt[1], pt[2]) is:
 X_min =0.000000,  X_max =55.000000
 Y_min =0.000000 ,  Y_max= 62.000000
 Z_min =0.000000,  Z_zmax= 38.941410   

-- 
M.Sc. Ismail Elkhrachy
PhD student

Institut für Geodäsie und Photogrammetrie
Technische Universität Braunschweig
Gaußstr. 22   
38106 Braunschweig 
Germany

Mob.           : 0049 0163 3623486
Tel.           : 0049 0531 3917497
Fax            : 0049 0531 3917499
E-mail         : I.Elkhrachy at tu-bs.de, I.Elkhrachy at yahoo.com





More information about the vtkusers mailing list