Easy3D 2.6.1
Loading...
Searching...
No Matches
surface_mesh_fairing.h
1/********************************************************************
2 * Copyright (C) 2020-2021 by Liangliang Nan <liangliang.nan@gmail.com>
3 * Copyright (C) 2011-2020 the Polygon Mesh Processing Library developers.
4 *
5 * The code in this file is adapted from the PMP (Polygon Mesh Processing
6 * Library) with modifications.
7 * https://github.com/pmp-library/pmp-library
8 * The original code was distributed under a MIT-style license, see
9 * https://github.com/pmp-library/pmp-library/blob/master/LICENSE.txt
10 ********************************************************************/
11
12#ifndef EASY3D_ALGO_SURFACE_MESH_FAIRING_H
13#define EASY3D_ALGO_SURFACE_MESH_FAIRING_H
14
15#include <map>
16#include <easy3d/core/surface_mesh.h>
17
18namespace easy3d {
19
27 public:
32 explicit SurfaceMeshFairing(SurfaceMesh *mesh);
33
38
43 void minimize_area() { fair(1); }
44
49 void minimize_curvature() { fair(2); }
50
55 void fair(unsigned int k = 2);
56
57 private:
66 void setup_matrix_row(SurfaceMesh::Vertex v, SurfaceMesh::VertexProperty<double> vweight,
68 unsigned int laplace_degree,
69 std::map<SurfaceMesh::Vertex, double> &row);
70
71 private:
72 SurfaceMesh *mesh_;
73
74 // property handles
75 SurfaceMesh::VertexProperty <vec3> points_;
81 };
82
83
84} // namespace easy3d
85
86#endif // EASY3D_ALGO_SURFACE_MESH_FAIRING_H
Edge property of type T.
Definition surface_mesh.h:327
Vertex property of type T.
Definition surface_mesh.h:255
void minimize_curvature()
Minimize surface curvature.
Definition surface_mesh_fairing.h:49
void fair(unsigned int k=2)
Compute surface by solving k-harmonic equation.
Definition surface_mesh_fairing.cpp:52
~SurfaceMeshFairing()
Destructor.
Definition surface_mesh_fairing.cpp:42
void minimize_area()
Minimize surface area.
Definition surface_mesh_fairing.h:43
SurfaceMeshFairing(SurfaceMesh *mesh)
Construct with mesh to be processed.
Definition surface_mesh_fairing.cpp:30
A halfedge data structure for polygonal meshes of 2-manifold.
Definition surface_mesh.h:51
Definition collider.cpp:182
This type represents a vertex (internally it is basically an index).
Definition surface_mesh.h:135