OneRingSmoothing project/code/executable has been renamed OneRingAveraging.
Include/Mesh.inl, Include/RiemannianMesh.[h/inl], and LaplacianSmoothing/LaplacianSmoothing.cpp files. (Feel free to declare and define additional member functions in Include/RiemannianMesh.[h/inl] as you need them.)Include/DynamicMeshViewer.[h/inl] have also been modified.
After you download the files, the first thing to do is compile the LaplacianSmoothing executable.
GeometryProcessing.sln to open the workspace in Microsoft Visual Studios.
LaplacianSmoothing executable by clicking on "Build" and then selecting "Build Solution". Please be sure that you are compiling for Release under x64 mode, as only those project settings were set. (If you need to compile under Debug, you will need to copy over the settings.)
LaplacianSmoothing.exe is compiled in Release mode for the 64-bit architecture and will be placed in the directory Bin/x64.
make to compile the LaplacianSmoothing executable.
LaplacianSmoothing is compiled in Release mode and will be placed in the directory Bin/Linux.
% LaplacianSmoothing
To smooth the geometry, invoke the executable as:
% LaplacianSmoothing --in <input geometry> --stepSize <gradient-descent step-size>
With:
<input geometry> the geometry to be processed.
<gradient-descent step-size> the step-size to be used for time-stepping the gradient-descent PDE. (Default value is 10-4.)
--updateMass: Tells the executable to update the mass matrix when the vertex positions are updated.
--updateStiffness: Tells the executable to update the stiffness matrix when the vertex positions are updated.
--normalize: Tells the exeuctable to normalize the mesh -- translating it and scaling it so that the normalized mesh is centered at the origin and has unit area. (Since smoothing tends to shrink the geometry, this can be useful to see longer range effects.)
[space] pauses/resumes the animation
[left mouse] rotates
[right mouse] zooms
[left mouse]+[ctrl] pans
'[' decreases the step-size
']' increases the step-size
Include/Mesh.inl:
Mesh::g so that, given the index of a triangle, it returns the Eigen::Matrix< double , 2 , 2 > describing the inner-product on the tangent space.
Include/RiemannianMesh.inl:
RiemannianMesh::ScalarMass( size_t vNum , const std::vector< SimplexIndex< K > > & triangles , MetricFunctor && metricFunctor )
RiemannianMesh::ScalarStiffness( size_t vNum , const std::vector< SimplexIndex< K > > & triangles , MetricFunctor && metricFunctor )
MetricFunctor. This is a functor that takes as it's input an integer indexing a triangle and returns a Eigen::Matrix< double , 2 , 2 > object giving the pulled-back inner-product on the tangent space. Your implementation should not need access to the vertices of the mesh.RiemannianMesh::ScalarMass( const Mesh & mesh )
RiemannianMesh::ScalarStiffness( const Mesh & mesh )
Mesh object, construct the functor, and pass that along to the functions computing the mass and stiffness matrices.LaplacianSmoothing/LaplacianSmoothing.inl:
LaplacianSmoothingViewer constructor, you will need to initially set up the solver, LaplacianSmoothingViewer::_solver.
LaplacianSmoothingViewer::_updateNumericalFactorization to update the solver when the system matrix has changed. (Recall that, since the connectivity of the mesh has not changed, you only need to update the numerical factorization, not the symbolic one.)
--updateMass or --updateStiffness flags (which re-compute the new mass and/or stiffness matrices defined by the updated geometry).
Include/Mesh.inl, Include/RiemannianMesh.[h/inl] and LaplacianSmoothing/LaplacianSmoothing.cpp files.