Easy3D 2.5.3
surface_mesh_geometry.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_GEOMETRY_H
13#define EASY3D_ALGO_SURFACE_MESH_GEOMETRY_H
14
15
16#include <easy3d/core/types.h>
17#include <easy3d/core//surface_mesh.h>
18
19
20namespace easy3d {
21
22 namespace geom {
23
25 float triangle_area(const SurfaceMesh *mesh, SurfaceMesh::Face f);
26
28 float surface_area(const SurfaceMesh *mesh);
29
33 float volume(const SurfaceMesh *mesh);
34
37
40 vec3 centroid(const SurfaceMesh *mesh);
41
44 void dual(SurfaceMesh *mesh);
45
47 double cotan_weight(const SurfaceMesh *mesh, SurfaceMesh::Edge e);
48
50 double voronoi_area(const SurfaceMesh *mesh, SurfaceMesh::Vertex v);
51
54
57
59 double angle_sum(const SurfaceMesh *mesh, SurfaceMesh::Vertex v);
60
63 VertexCurvature() : mean(0.0), gauss(0.0), max(0.0), min(0.0) {}
64
65 float mean;
66 float gauss;
67 float max;
68 float min;
69 };
70
74
75 }
76
77} // namespace easy3d
78
79
80#endif // EASY3D_ALGO_SURFACE_MESH_GEOMETRY_H
A halfedge data structure for polygonal meshes of 2-manifold.
Definition: surface_mesh.h:52
double voronoi_area_barycentric(const SurfaceMesh *mesh, SurfaceMesh::Vertex v)
compute barycentric Voronoi area of vertex v
Definition: surface_mesh_geometry.cpp:232
vec3 centroid(const SurfaceMesh *mesh, SurfaceMesh::Face f)
barycenter/centroid of a face
Definition: surface_mesh_geometry.cpp:67
VertexCurvature vertex_curvature(const SurfaceMesh *mesh, SurfaceMesh::Vertex v)
compute min, max, mean, and Gaussian curvature for vertex v.
Definition: surface_mesh_geometry.cpp:308
double voronoi_area(const SurfaceMesh *mesh, SurfaceMesh::Vertex v)
compute (mixed) Voronoi area of vertex v
Definition: surface_mesh_geometry.cpp:164
void dual(SurfaceMesh *mesh)
Compute dual of a mesh.
Definition: surface_mesh_geometry.cpp:95
float triangle_area(const SurfaceMesh *mesh, SurfaceMesh::Face f)
compute area of triangle f
Definition: surface_mesh_geometry.cpp:22
vec3 laplace(const SurfaceMesh *mesh, SurfaceMesh::Vertex v)
compute Laplace vector for vertex v (normalized by Voronoi area)
Definition: surface_mesh_geometry.cpp:262
float surface_area(const SurfaceMesh *mesh)
surface area of the mesh (assumes triangular faces)
Definition: surface_mesh_geometry.cpp:35
double angle_sum(const SurfaceMesh *mesh, SurfaceMesh::Vertex v)
compute the sum of angles around vertex v (used for Gaussian curvature)
Definition: surface_mesh_geometry.cpp:283
double cotan_weight(const SurfaceMesh *mesh, SurfaceMesh::Edge e)
compute the cotangent weight for edge e
Definition: surface_mesh_geometry.cpp:123
Definition: collider.cpp:182
Definition: surface_mesh.h:124
Definition: surface_mesh.h:134
Definition: surface_mesh.h:104
discrete curvature information for a vertex. used for vertex_curvature()
Definition: surface_mesh_geometry.h:62