Easy3D 2.6.1
Loading...
Searching...
No Matches
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
30 float triangle_area(const SurfaceMesh *mesh, SurfaceMesh::Face f);
31
38 float surface_area(const SurfaceMesh *mesh);
39
47 float volume(const SurfaceMesh *mesh);
48
55 vec3 centroid(const SurfaceMesh *mesh, SurfaceMesh::Face f);
56
63 vec3 centroid(const SurfaceMesh *mesh);
64
70 void dual(SurfaceMesh *mesh);
71
78 double cotan_weight(const SurfaceMesh *mesh, SurfaceMesh::Edge e);
79
86 double voronoi_area(const SurfaceMesh *mesh, SurfaceMesh::Vertex v);
87
94 double voronoi_area_barycentric(const SurfaceMesh *mesh, SurfaceMesh::Vertex v);
95
103 vec3 laplace(const SurfaceMesh *mesh, SurfaceMesh::Vertex v);
104
112 double angle_sum(const SurfaceMesh *mesh, SurfaceMesh::Vertex v);
113
119 struct VertexCurvature {
120 VertexCurvature() : mean(0.0), gauss(0.0), max(0.0), min(0.0) {}
121
122 float mean;
123 float gauss;
124 float max;
125 float min;
126 };
127
136
137 }
138
139} // namespace easy3d
140
141
142#endif // EASY3D_ALGO_SURFACE_MESH_GEOMETRY_H
A halfedge data structure for polygonal meshes of 2-manifold.
Definition surface_mesh.h:51
Functions for basic geometric computations.
Definition surface_mesh_geometry.cpp:21
double voronoi_area_barycentric(const SurfaceMesh *mesh, SurfaceMesh::Vertex v)
Compute the barycentric Voronoi area of a vertex.
Definition surface_mesh_geometry.cpp:237
vec3 centroid(const SurfaceMesh *mesh, SurfaceMesh::Face f)
Compute the barycenter/centroid of a face.
Definition surface_mesh_geometry.cpp:72
VertexCurvature vertex_curvature(const SurfaceMesh *mesh, SurfaceMesh::Vertex v)
Compute min, max, mean, and Gaussian curvature for a vertex.
Definition surface_mesh_geometry.cpp:313
double voronoi_area(const SurfaceMesh *mesh, SurfaceMesh::Vertex v)
Compute the (mixed) Voronoi area of a vertex.
Definition surface_mesh_geometry.cpp:169
float volume(const SurfaceMesh *mesh)
Compute the volume of a mesh.
Definition surface_mesh_geometry.cpp:46
void dual(SurfaceMesh *mesh)
Compute the dual of a mesh.
Definition surface_mesh_geometry.cpp:100
float triangle_area(const SurfaceMesh *mesh, SurfaceMesh::Face f)
Compute the area of a triangle face in a mesh.
Definition surface_mesh_geometry.cpp:23
vec3 laplace(const SurfaceMesh *mesh, SurfaceMesh::Vertex v)
Compute the Laplace vector for a vertex.
Definition surface_mesh_geometry.cpp:267
float surface_area(const SurfaceMesh *mesh)
Compute the surface area of the mesh.
Definition surface_mesh_geometry.cpp:36
double angle_sum(const SurfaceMesh *mesh, SurfaceMesh::Vertex v)
Compute the sum of angles around a vertex.
Definition surface_mesh_geometry.cpp:288
double cotan_weight(const SurfaceMesh *mesh, SurfaceMesh::Edge e)
Compute the cotangent weight for an edge.
Definition surface_mesh_geometry.cpp:128
Definition collider.cpp:182
Vec< 3, float > vec3
A 3D point/vector of float type.
Definition types.h:44
This type represents a vertex (internally it is basically an index).
Definition surface_mesh.h:135
Discrete curvature information for a vertex.
Definition surface_mesh_geometry.h:119
float max
Maximum curvature.
Definition surface_mesh_geometry.h:124
float mean
Mean curvature.
Definition surface_mesh_geometry.h:122
float min
Minimum curvature.
Definition surface_mesh_geometry.h:125
float gauss
Gaussian curvature.
Definition surface_mesh_geometry.h:123