[vtkusers] Polydata get point coordinates

Sara Rolfe smrolfe at u.washington.edu
Fri Oct 15 15:00:13 EDT 2010


Thanks for the clarification.


On Oct 15, 2010, at 11:50 AM, David Doria wrote:

> On Fri, Oct 15, 2010 at 2:47 PM, Eric E. Monson  
> <emonson at cs.duke.edu> wrote:
>> Hey Sara,
>>
>> The method David advised may be the most direct for you, but I just  
>> wanted to point out that polyData->GetPoints() should return a  
>> vtkPoints object, not just point IDs. You should be able to use one  
>> of the GetPoint() variations of vtkPoints to get the coordinates  
>> from that, too.
>>
>> http://www.vtk.org/doc/nightly/html/classvtkPoints.html
>>
>> -Eric
>
> Yep.
>
> polydata->GetPoints()->GetPoint(i,p);
>
> In fact, in vtkPointSet.h (the parent of vtkPolyData), the function
> GetPoints (so polydata->GetPoints) is doing exactly that:
>
>  void GetPoint(vtkIdType ptId, double x[3]) {this->Points- 
> >GetPoint(ptId,x);};
>
> (where Points is a vtkPoints object).
>
> David




More information about the vtkusers mailing list