[vtkusers] I need to get the X, Y, Z coordinates of a point in a vtkPolyData

Bill Lorensen bill.lorensen at gmail.com
Mon Oct 26 08:44:37 EDT 2009


You must do
contour.Update()

before accessing the points.

On Mon, Oct 26, 2009 at 8:26 AM, Alessandro Artusi
<artusialessandro4 at googlemail.com> wrote:
> Thanks a lot Jerome,
>
> I get an errore:
>
> AttributeError GetPoints.
>
> May be I am doing something wrong; what i  am doing is the following:
>
> contour = vtk.vtkContourFilter()
> contour.SetInput(grid) #grid is rectilineargrid()
> contour.ComputeNormalOn()
> contour.SetValue(0, 95) #my isovalue
>
> in contour i should have my polyData right?
>
> when i do what you suggested:
>
> contour.GetPoints( ).GetPoint( pointId, coord )
>
> I got the error.
>
> Any suggestion?
>
> Thanks again,
> Alessandro.
>
>
> On Mon, Oct 26, 2009 at 1:11 PM, Jérôme <jerome.velut at gmail.com> wrote:
>>
>> Hi,
>> vtkPolyData is a vtkPointSet : you can access points coordinates through
>>
>> polydata->GetPoints( )->GetPoint( pointId, coord )
>>
>> where polydata is your... polydata, pointId is the point Id you want to
>> get (from 0 to NumberOfPoints - 1) and coord is double coord[3] filled by
>> the point coordinate.
>>
>> HTH
>> Jerome
>>
>> 2009/10/26 Alessandro Artusi <artusialessandro4 at googlemail.com>
>>>
>>> Dear All,
>>>
>>> I have a vtkPolyData from the vtkContourFilter and I need to get the
>>> X,Y,Z coordinates of each point in the PolyData. This because I need to
>>> convert them.
>>> How can i get this info?
>>>
>>> Thanks a lot for teh help,
>>> Alessandro.
>>>
>>>
>>> _______________________________________________
>>> 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
>>>
>>
>
>
> _______________________________________________
> 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
>
>



More information about the vtkusers mailing list