[vtkusers] Curvatures of a space curve?

Goodwin Lawlor goodwin.lawlor at ucd.ie
Wed May 14 10:18:16 EDT 2003


Even funnier- I was just about to get going on this... here's a class based
on Philipp's pseudocode... * haven't tested it yet * but if you want
something now in VTK here it is. For the last point I just set the value to
the same as the second last... not very satisfactory. I'm sure the class
needs some work. Maybe it can be incorporated into vtkCurvatures or
sub-classed.

Let me know how you get on,

Goodwin
University College Dublin

----- Original Message -----
From: <philipp.batchelor at kcl.ac.uk>
To: "P Bai" <apbai at yahoo.com>
Cc: <vtkusers at public.kitware.com>
Sent: Tuesday, May 13, 2003 5:40 PM
Subject: Re: [vtkusers] Curvatures of a space curve?


>
> vtkCurvatures is indeed a PolyDataFilter, and assumes the  PolyDatas
> as surfaces. Funny you ask that as I have been recently been working on 3D
> curves. I had thought of writing something for VTK, but in the end
> couldn't really decide what class should represent curves, and thus what
> filter to inherit from. The curvatures of a curve can be estimated by:
> I think polyline is the object, a crude pseudocode for a discrete
> curvature/torsion/Frenet frame computation would be:
>
> If the points of the polyline are x[k]
> ds[k] = length(x[k+1]-x[k])
> T[k] = (x[k+1]-x[k]) / ds[k]
> B[k] = cross(T[k],T[k+1]) // Vector product
> N[k] = cross(B[k],T[k])
> // T,B,N defines the discrete Frenet Frame of the curve
> kappa[k] = length(T[k+1] - T[k]) / ds[k] // curavture
> tau[k]   = -dot((B[k+1] - B[k]),N[k]) / ds[k] //torsion
> with obvious restrictions on range of k, in my tests (implemented in
> Matlab), the comparison with the analytic values of some example curves
> is quite good.
>
> You can also obviously fit splines, but as the torsion involves 3d
> derivatives, special types of splines should be used for
> torsion-continuity (tau-splines), but I don't think they are easily
> available in vtk. I don't see a 'vtkPolyLineFilter' class, what would be
> the best setting for an algorithm doing something like the above? what
> were you intending to use? If it
> can be decided, the above algorithm would be easy to implement.
>
> Remark: there is also the concept of 'geodesic curvature' of a curve on a
> surface, for which I have some references for discrete situations.
>
> Ph
>
>
>  On Tue, 13 May 2003, P Bai wrote:
>
> > vtkCurvatures can seem to only compute the curvatures
> > of a surface. Can it actually get the curvatures of a
> > space curve? Or does VTK have some method to compute
> > them at all?
> >
> > Thanks,
> >
> > P
> >
> > __________________________________
> > Do you Yahoo!?
> > The New Yahoo! Search - Faster. Easier. Bingo.
> > http://search.yahoo.com
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/vtkusers
> >
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkPolyLineCurvature.h
Type: application/octet-stream
Size: 2183 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030514/200900c8/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkPolyLineCurvature.cxx
Type: application/octet-stream
Size: 3771 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030514/200900c8/attachment-0001.obj>


More information about the vtkusers mailing list