slam.curvature

Functions

calcvertex_normals(FV, N)

CalcVertexNormals calculates the normals and voronoi areas at each vertex INPUT: FV - triangle mesh in face vertex structure N - face normals OUTPUT - VertexNormals - [Nv X 3] matrix of normals at each vertex Avertex - [NvX1] voronoi area at each vertex Acorner - [NfX3] slice of the voronoi area at each face corner

compute_curvature(FV, VertexNormals, …)

CalcFaceCurvature recives a list of vertices and faces in FV structure and the normal at each vertex and calculates the second fundemental matrix and the curvature using least squares :param FV: face-vertex data structure containing a list of vertices and a list of faces :param VertexNormals: n*3 matrix ( n = number of vertices ) containing the normal at each vertex :param FaceNormals: m*3 matrix ( m = number of faces ) containing the normal of each face :param Avertex: :param Acorner: :param up: :param vp: :return: FaceSFM - an m*1 cell matrix second fundemental VertexSFM - an n*w cell matrix second fundementel wfp - corner voronoi weights

curvature_fit(mesh[, tol, neighbour_size])

Computation of the two principal curvatures based on: Petitjean, A survey of methods for recovering quadrics in triangle meshes, ACM Computing Surveys, 2002 :param mesh: :param tol: :param neighbour_size: :return:

curvatures_and_derivatives(mesh)

curvedness_shapeIndex(mesh)

decompose_curvature(in_curv)

Decompose the principal curvatures of a mesh in ShapeIndex and curvedness Implementation based on ‘ Surface shape and curvature scales Jan JKoenderink & Andrea Jvan Doorn Image and Vision Computing Volume 10, Issue 8, October 1992, Pages 557-564 ‘

determine_local_basis(normal, tol)

Compute an orthonormal basis of a 2d plane defined by its normal.

norm(vector)

principal_curvatures(FV, VertexSFM, up, vp)

Calculates the principal curvatures and prncipal directions :param FV: triangular mesh :param VertexSFM: second fundemental matrix for each vertex :param up: vertex local coordinate frame :param vp: vertex local coordinate frame :return: PrincipalCurvature : Matrix containing pricipale curvatures ( dim = 2 * Number of vertices ) PrincipalDi1 , PrincipalDi2 : First and second principal directions

project_curvature_tensor(uf, vf, nf, old_ku, …)

performs a projection of the tensor variables to the vertex coordinate system :param uf:face coordinates system :param vf:face coordinates system :param nf:face normal :param old_ku:face curvature tensor variables :param old_kuv:face curvature tensor variables :param old_kv:face curvature tensor variables :param up:vertex cordinate system :param vp:vertex cordinate system :return: new_ku,new_kuv,new_kv : vertex curvature tensor coordinates The tensor : [[new_ku, new_kuv], [new_kuv, new_kv]]

rotate_coordinate_system(up, vp, nf)

RotateCoordinateSystem performs the rotation of the vectors up and vp to the plane defined by nf as its normal vector :param up: vectors to be rotated (vertex coordinate system) :param vp: vectors to be rotated (vertex coordinate system) :param nf: face normal :return: r_new_u,r_new_v : new rotated vectors