[vtkusers] Re: How to compute tangents and normals at each point of a curve ( vtkPolyData ) ???
Goodwin Lawlor
goodwin.lawlor at ucd.ie
Thu Mar 23 11:48:31 EST 2006
Deepak Roy wrote:
> Hello,
>
> -- I am using vtk 4.4.
>
> -- I have a triangular surface mesh as input vtkPolyData
>
> -- I intersect the surface with a cartesian plane ( xy , yz or xz ) and
> obtain a curve --- i use the vtkContourFilter to extract this curve.
>
> -- The curve thus extracted is in the form of vtkPolyData.
>
> -- /*Now how can I compute the curve normals and curve tangents at each
> point on this curve ?*/
> //
> --- vtkPolyDataNormals filter does not work for curves according to
> the documentation.
>
> --- Does anyone know if there is a VTK filter to achieve this task ?
>
> --- I tried computing the normals myself from the Lagrangian
> Interpolation curve passing thru the point and its 1-neighbors.
>
> ------ But i faced one more problem - /*How do i find the
> neighboring vertices of a point in vtkPolyData? */
> //
> ----------- i tried vtkPolyData::GetPointCells() but this does not
> seem to work for curves. Any ideas ????
>
>
> Thanks in Advance.
>
> Regards,
>
> Deepak Roy
>
Hi Deepak,
Is this
(http://www.bioengineering-research.com/vtk/vtkPolyLineCurvature.htm)
the sort of thing you need? This class is based on pseudo code posted by
Philip Batchelor. Actually, we've a couple of new classes for
surface/polyline curvatures updated for vtk5.0 (they need to be checked
and submitted...). The tangents, normals, and binormals are all
calculated but not passed to the output- that would be easy to change
though.
hth
Goodwin
More information about the vtkusers
mailing list