[vtk-developers] Curvatures class upgrades

Goodwin Lawlor goodwin.lawlor at ucd.ie
Mon Jun 13 06:50:46 EDT 2005


Hi Philip,

I'd go for option 2b also.

It may be ok to break backward compatibility with vtkCurvatures with a new
major release (vtk 5).

I dont know if this would be good practice/design but if you wanted to have
vtkCurvatures as a superclass and keep backward compatibility, the object
factory could be used to return a vtkDiscreteCurvatures object if someone
tries to instantiate the old vtkCurvatures class. (it would be an "abstract"
superclass that could be accidentally instantiated)

Goodwin

----- Original Message ----- 
From: "Philip Batchelor" <philip.batchelor at ucl.ac.uk>
To: "VTK Developers" <vtk-developers at vtk.org>
Sent: Friday, June 10, 2005 5:06 PM
Subject: [vtk-developers] Curvatures class upgrades


> Hi all,
>
> I have recently written 2 new algorithms for curvatures. One computes a
> curvature tensor for a triangulated surface using a technique by Taubin,
> the other is just an update of line curvatures (curv. and torsion). Now
> comes the question of where they should go. I'll give a bit more
> details of the current and new algorithms below, first the class
> possibilities.
> CLASSES
>   Option 1: Make everything part of the current vtkCurvatures class.
> Then there would have to be a 'SetCurvatureToTensor' sth like that for
> the Tensor, and somehow check the cell type to decide whether to use the
> line curvature or not.
>          Advantage: backwards compatibility as vtkCurvatures does the
> same by default,
>          Disadvantage: it's not that easy, puts lots of switches in the
> class, and the class becomes just a wrapper for lots of things, deciding
> when to use the line curvature makes it a mess?
>
>  Option 2a: Separate the lines and surface curvatures, thus there would
> be at least two classes, vtkPolylineCurvatures and vtkCurvatures. The
> first does curvatures of 1D objects, the other could be an abstract
> class with subclass vtkDiscreteCurvatures (the actual vtkCurvatures) and
> vtkCurvatureTensor.
>         Advantage: avoids the clash of lines and surfaces
>         Disadvantage: not backwards compatible, vtkCurvatures becomes
> deprecated, need a new name for the base class.
>
> Option 2b: Pushing option 2a further, in a mathematically consistent
> way: an abstract Curvatures class representing curvatures of objects,
> with subclasses corresponding to the dimension of the object, i.e. e.g.
> subclasses vtkLineCurvatures (1D), vtkSurfaceCurvatures (2D), which
> itself would have vtkDiscreteCurvatures (as in 2a) and
> vtkCurvatureTensor subclasses.
>         Advantage: it is mathematically consistent, it would keep open
> the possibility to have curvature for higher dimensional objects, or add
> other methods of curvature computations (there are some...)
>         Disadvantage: too complicated or abstract?
>
>   Anyone has any comments-preferences? I hope to have summarised
> correctly the discussions we have had with Goodwin Lawlor, and Andrew
> MacLean.
>
> ALGORITHMS
> Just to give some details.
> -The current vtkCurvatures computes them directly from the
> triangulation, (as angle defects) thus is mainly a loop over
> facets-vertices, finding neighbours, and mathematically the most complex
> operation is angle computation. it's simpistic, but should be relatively
> robust and fast.
> -The tensor computation uses a technique from Taubin which sort of
> computes the tensor directly from the triangulation too, although it is
> certainly not that differnt from a fitting method. It computes a tensor
> called the Taubin tensor that has same eigenvectors but different
> eigenvalues, but these eigenvalues are related to the principal
> curvatures. It is quite close in spirit to the previous
> in that it requires just finding neighbours, (although in Curvatures I
> was loping over facets, where here I loop over vertices) but, at each
> vertex, it requires a diagonalisation, for which it uses
> vtkMath::Jacobi, which is likely to be difficult part in cost and
> accuracy. To scalar curvatures it adds the possibility of following
> lines of curvatures, and a more sound way to compute the principal
> curvatures, hence derived shape indices etc...
> -The line curvature is a simple forward finite difference of the Frenet
> equations. (NB: torsions become meaningless at points where the line
> curvature is zero, ideally we should have a check for this).
>
> Ph
>
>
>
>
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
>




More information about the vtk-developers mailing list