14#include <lagrange/SurfaceMesh.h>
16#include <lagrange/solver/DirectSolver.h>
19#include "ThreadPool.h"
20#define MULTI_THREADING_INCLUDED
21using namespace lagrange::filtering::threadpool;
24#include <lagrange/utils/warnoff.h>
25#include <Include/PreProcessor.h>
26#include <Include/GradientDomain.h>
27#include <Include/CurvatureMetric.h>
28#include <Misha/Geometry.h>
29#include <Misha/Miscellany.h>
30#include <lagrange/utils/warnon.h>
36namespace lagrange::filtering {
40using namespace MishaK;
43template <
typename T,
unsigned N>
44using Vector = MishaK::Point<T, N>;
47static const unsigned int K = 2;
50static const unsigned int Dim = 3;
54using Solver = lagrange::solver::SolverLDLT<Eigen::SparseMatrix<Real>>;
71template <
typename Scalar,
typename Index>
73 const SurfaceMesh<Scalar, Index>& t_mesh,
74 std::vector<SimplexIndex<K, int>>& triangles);
86template <
typename Scalar,
typename Index>
88 const SurfaceMesh<Scalar, Index>& t_mesh,
101template <
typename Scalar,
typename Index>
125template <
typename Scalar,
typename Index>
127 SurfaceMesh<Scalar, Index>& mesh,
128 SurfaceMesh<Scalar, Index>& _mesh,
129 std::vector<SimplexIndex<K, int>>& triangles,
133 Real& original_area);
147 FEM::RiemannianMesh<Real>& r_mesh,
151 double curvature_weight,
152 double normal_smoothing_weight,
uint32_t AttributeId
Identified to be used to access an attribute.
Definition AttributeFwd.h:73
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Type alias for one-dimensional column Eigen vectors.
Definition views.h:79
Common utility functions for mesh and attribute smoothing.
Definition smoothing_utils.cpp:41
void get_triangles(const SurfaceMesh< Scalar, Index > &t_mesh, std::vector< SimplexIndex< K, int > > &triangles)
Extract triangles from a mesh.
Definition smoothing_utils.cpp:44
void adjust_metric_for_curvature(FEM::RiemannianMesh< Real > &r_mesh, const std::vector< Vector< Real, Dim > > &vertices, const std::vector< Vector< Real, Dim > > &normals, Real original_area, double curvature_weight, double normal_smoothing_weight, Solver &solver)
Adjust the metric based on curvature.
Definition smoothing_utils.cpp:178
void set_vertices(SurfaceMesh< Scalar, Index > &mesh, const std::vector< Vector< Real, Dim > > &vertices)
Set vertices in a mesh.
Definition smoothing_utils.cpp:94
void get_vertices_and_normals(const SurfaceMesh< Scalar, Index > &t_mesh, std::vector< Vector< Real, Dim > > &vertices, std::vector< Vector< Real, Dim > > &normals, AttributeId normal_id)
Extract vertices and normals from a mesh.
Definition smoothing_utils.cpp:58
std::unique_ptr< FEM::RiemannianMesh< Real > > setup_for_smoothing(SurfaceMesh< Scalar, Index > &mesh, SurfaceMesh< Scalar, Index > &_mesh, std::vector< SimplexIndex< K, int > > &triangles, std::vector< Vector< Real, Dim > > &vertices, std::vector< Vector< Real, Dim > > &normals, Solver &solver, Real &original_area)
Setup a mesh for smoothing operations.
Definition smoothing_utils.cpp:111