[vtkusers] Drawing a curve

Hal Canary hal at cs.unc.edu
Tue May 22 06:54:27 EDT 2012


On 05/21/2012 11:27 PM, Rong Xu wrote:
> I have known the coordinates of 15 points on one curve on 2D space, then
> how can I draw such a curve and estimate the equation of this curve?
> Also based on this curve, I want to create a solid tube by using this
> curve as the axes of the solid tube, but I am not sure whether
> vtkTubeFilter can be used for this purpose ?


You'll want to create a vtkPolyData object.  Use SetPoints() to add the 
15 points to the PolyData.  Then use SetLines() to add a vtkCellArray 
that represents the 14 line segments.

You can use that line as an input to a vtkTubeFilter.

Check out this example:
 
http://www.vtk.org/Wiki/VTK/Examples/Cxx/VisualizationAlgorithms/TubesWithVaryingRadiusAndColors

-- 
Hal Canary



More information about the vtkusers mailing list