Phong-Rodrigues Extrinsic Vector-Field Processing (Version 1.10)
links
executables
examples
compilation
usage
changes
This software supports vector-field processing using the extrinsically defined Phong-Rodrigues basis. Supported applications include computation of:
- sparse interpolation
- bracket of two vector-fields
LINKS
EXECUTABLES
SparseInterpolation:
Supports the construction of a tangent vector-field that interpolates the prescribed constraints while being as-smooth-as-possible everywhere else.
"Smoothness" is defined in terms of the connection, the Hodge, or the Killing energy.
- --in <input mesh and interpolation constraints>
- These two strings specify the the names of the files describing the mesh and the interpolation constraints.
The mesh is assumed to be in PLY format.
The constraints are assumed to be in ASCII format, with each constraint described by a white-space separated quadruple of rnumbers. The first is an integer value describing the index of the constrained vertex. The remaining three are floating points giving the extrinsic coordinates of the tangent vector-field at that vertex.
Note:
- If they are not provided, the executable will generate per-vertex normals.
- Normals are rescaled to have unit-lengths.
- Input tangent vector-fields are processed to have the normal components projected out.
- [--out <output mesh>]
- This string is the name of the file to which the interpolating vector-field will be written.
If the file-name ends with the .ply extension, the output mesh and vector-field will be written in PLY format with the vertex positions encoded into parmaeters x, y, and z, the normals encoded into parameters nx, ny, and nz, and the vector-field values encoded into parameters vf0, vf1, vf2.
Otherwise, the output vector-field will be written in ASCII format, with each vertex's tangent vector described by a white-space separated triple of floating-point values giving the extrinsic coordinates of the tangent vector-field at that vertex.
- [--qSamples <quadrature samples>]
- This integer specifies the number of quadrature points used for estimating an integral over a triangle.
Supported values are in {1, 3, 4, 6, 7, 12, 13, 24, 27, 32}.
The default value for this parameter is 3.
- [--energy <type of vector-field energy>]
- This integer specifies the type of energy used to define "smoothness". Valid values are:
- 0: Connection
- 1: Hodge
- 2: Killing
The default value for this parameter is 0.
- [--verbose]
- If this flag is enabled, performance information is printed to
stdout.
Bracket:
Supports the evaluation and computation of the bracked of two vector-fields.
- --in <input mesh, vector-field 1, and vector-field 2>
- These three strings specify the the names of the files describing the mesh and the two vector-fields whose bracket is to be computed.
The mesh is assumed to be in PLY format.
If the vector-field file-name ends with the .ply extension, the vector-field is assumed to be written in PLY format with the vector-field values encoded into parameters vf0, vf1, vf2.
Otherwise, the vector-field values are assumed to be in ASCII format, written in the order of the vertices, with each vertex's vector-field value expressed a white-space separated triple of floating point values giving the extrinsic coordinates of the tangent vector-field at that vertex.
Note:
- If they are not provided, the executable will generate per-vertex normals.
- Normals are rescaled to have unit-lengths.
- Input tangent vector-fields are processed to have the normal components projected out.
- [--out <output mesh>]
- This string is the name of the file to which the bracket of the two vector-fields will be written.
If the file-name ends with the .ply extension, the output mesh and vector-field will be written in PLY format with the vertex positions encoded into parmaeters x, y, and z, the normals encoded into parameters nx, ny, and nz, and the vector-field values encoded into parameters vf0, vf1, vf2.
Otherwise, the output vector-field will be written in ASCII format, with each vertex's tangent vector described by a white-space separated triple of floating-point values giving the extrinsic coordinates of the tangent vector-field at that vertex.
- [--qSamples <quadrature samples>]
- This integer specifies the number of quadrature points used for estimating an integral over a triangle.
Supported values are in {1, 3, 4, 6, 7, 12, 13, 24, 27, 32}.
The default value for this parameter is 3.
- [--covDiff]
- If this flag is enabled, the method computes the covariant derivatives of the two vector-fields, evaluates each of those along the other vector-field, and returns the difference.
- [--verbose]
- If this flag is enabled, performance information is printed to
stdout.
EXAMPLES (WITH SAMPLE DATA)
For testing purposes, the provided archive contains the "kitten" model with two tangent vector-field constraints, as well as two tangent vector-fields defined over the torus.
SparseInterpolation
To run this executable you must specify the input mesh as well as the constraints:
% Bin/*/SparseInterpolation --in PRVF.Data/kitten.ply PRVF.Data/kitten.txt --out connection.ply
This computes the tangent vector-field with minimum connection energy that interpolates the two vertex constraints, and writes out the vector-field to connection.ply.
You can minimize the Hodge energy instead by running:
% Bin/*/SparseInterpolation --in PRVF.Data/kitten.ply PRVF.Data/kitten.txt --energy --out hodge.ply
Bracket
To run this executable you must specify the input mesh as well as the two vector-fields:
% Bin/*/SparseInterpolation --in PRVF.Data/torus.X.ply PRVF.Data/torus.X.ply torus.Y.ply --out torus.XY.ply
This evaluates the bracket and computes its best-fit representation in terms of the Phong-Rodriguess vector-field basis, writing out the mesh and vector-field to the file torus.XY.ply.
(Note that as the files PRVF.Data/torus.X.ply and PRVF.Data/torus.Y.ply encode both the geometry and the vector-fields, we pass in PRVF.Data/torus.X.ply twice, once for the endoding of the geometry and once for the vector-field.)
COMPILATION
- Compilation requires a sparse matrix library, as well as a linear solver. By default, we use the
LDLt implementation provided by Eigen.
USAGE
- System Matrix Representation
- After being initialized with the vertices, normals, and triangles of a mesh, different system matrices can be computed.
- The method
Eigen::SparseMatrix<double> EmbeddedPhongMesh<2>::mass<QuadratureSamples>(void)
return the symmetric 3·|V|×3·|V| mass matrix, with QuadratureSamples the numer of quadrature points per triangle.
- The method:
Eigen::SparseMatrix<double> EmbeddedPhongMesh<2>::stiffness<QuadratureSamples>(void)
return the symmetric 3·|V|×3·|V| stiffness matrix defined by the connection Laplacian.
- Symmetric
3·|V|×3·|V| matrices defining the stiffness with respect to individual components of the covariant matrix can be obtained invoking the method:
Eigen::SparseMatrix<double> EmbeddedPhongMesh<2>::stiffness<QuadratureSamples,CovComponent>(void)
with CovComponent an enum of type CovariantComponent describing the component of the covariant derivative used to define the stiffness.
- The method:
Eigen::SparseMatrix<double> EmbeddedPhongMesh<2>::tangentProlongation(void)
returns the sparse 3·|V|×2·|V| matrix mapping two degrees of freedom at a vertex, representing the linear combinations of a tangent vector with respect to a chosen frame, to its coordinates in 3D. The frame is chosen to be orthonormal, so that if P is the matrix returned by the method, the matrix P.transpose()*P is the 3·|V|×3·|V| matrix describing the operation of projecting out the normal component.
In general, the system matrices should be of size 2·|V|×2·|V| corresponding to optimizing over tangent vectors. For example, if M is the mass matrix and P prolongation, the associated mass matrix defined over tangent vectors will be P.transpose() * M * P.
- System Vector Reprsentation
-
Extrinsic vector fields are represented by
Eigen::VectorXds of size 3·|V|, with the x-, y-, and z-coordinates of the v-th vertex found at indices 3·v, 3·v+1, and 3·v+2, respectively.
- Abstract Vector-Field Representation
- An abstract vector-field over the mesh is an object of type
MeshField that acts as an array of per-triangle vector-fields of abstract type TriangleField. Specifically:
- The type
MeshField supports a method:
TriangleField MeshField::operator[](size_t)
giving the restriction of the vector-field to the indexed triangle.
- The type
TriangleField supports a method
Point<double,3> TriangleField(Point<double,2>)
returning the value of the vector-field within the triangle.
One can obtain Eigen::VectorXd of size 3·|V| giving the integral of the inner-product of the vector-field with each of the Phong-Rodrigues basis vector-fields by invoking the method:
Eigen::VectorXd EmbeddedPhongMesh<2>::dual<QuadratureSamples>(MeshField &&) const
HISTORY OF CHANGES
Version 1.00:
Version 1.10:
- added support for computing the Lie bracket, independent of the metric and/or connection.
HOME