[vtkusers] Help needed with creating vtkPolyData

Anja Ende anja.ende at googlemail.com
Mon Oct 23 10:31:33 EDT 2006


Hi all,

I am using Qt to select some points on the screen and draw a cubic Bezier
curve through it. Now what I want to do is generate a vtkPolyData object
from the bezier path.

Qt returns me the Bezier path as a set of floating point coordinates but
these coordinates are not for every pixel in the path but I guess they
represent the curve path as a polygon.

What I want to do is to use this into a vtkStencil. So, my plan is to use:

vtkPolyData->vtkPolyDataToImageStencil->vtkStencil (also the input image
goes here).

My question is how can I create the vtkPolyData object from a set of image
coordinates (I convert the display coordinates to image space. I am guessing
the algorithm works in the image space)? I am having trouble understanding
how vtkPolyData is initialized.

Say I have the following data. Please assume for the moment that they are in
the image space

213: 208
223.428: 197.666
233.33: 189.453
242.696: 183.232
251.516: 178.875
259.779: 176.252
267.475: 175.234
274.594: 175.693
281.125: 177.5
287.059: 180.525
292.385: 184.641
297.093: 189.717
301.172: 195.625
304.613: 202.236
307.404: 209.422
309.537: 217.053
311: 225
213: 208

How can I create a vtkPolyData representing the polygon described by this
data.

Thanks for any help you might be able to give me.

Anja
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061023/032fd4a8/attachment.htm>


More information about the vtkusers mailing list