12#ifndef EASY3D_ALGO_SURFACE_MESH_REMESHING_H
13#define EASY3D_ALGO_SURFACE_MESH_REMESHING_H
15#include <easy3d/core/surface_mesh.h>
48 bool use_projection =
true);
57 float approx_error,
unsigned int iterations = 10,
58 bool use_projection =
true);
62 void postprocessing();
63 void split_long_edges();
64 void collapse_short_edges();
66 void tangential_smoothing(
unsigned int iterations);
72 return distance(points_[v0], points_[v1]) >
73 4.0 / 3.0 * std::min(vsizing_[v0], vsizing_[v1]);
77 return distance(points_[v0], points_[v1]) <
78 4.0 / 5.0 * std::min(vsizing_[v0], vsizing_[v1]);
83 SurfaceMesh *refmesh_;
86 TriangleMeshKdTree *kd_tree_;
89 float target_edge_length_;
90 float min_edge_length_;
91 float max_edge_length_;
94 SurfaceMesh::VertexProperty <vec3> points_;
95 SurfaceMesh::VertexProperty <vec3> vnormal_;
96 SurfaceMesh::VertexProperty<bool> vfeature_;
97 SurfaceMesh::EdgeProperty<bool> efeature_;
98 SurfaceMesh::VertexProperty<bool> vlocked_;
99 SurfaceMesh::EdgeProperty<bool> elocked_;
100 SurfaceMesh::VertexProperty<float> vsizing_;
102 SurfaceMesh::VertexProperty <vec3> refpoints_;
103 SurfaceMesh::VertexProperty <vec3> refnormals_;
104 SurfaceMesh::VertexProperty<float> refsizing_;
A halfedge data structure for polygonal meshes of 2-manifold.
Definition surface_mesh.h:51
SurfaceMeshRemeshing(SurfaceMesh *mesh)
Constructor that initializes the remeshing with a given mesh.
Definition surface_mesh_remeshing.cpp:24
void adaptive_remeshing(float min_edge_length, float max_edge_length, float approx_error, unsigned int iterations=10, bool use_projection=true)
Perform adaptive remeshing.
Definition surface_mesh_remeshing.cpp:70
~SurfaceMeshRemeshing()
Destructor.
void uniform_remeshing(float edge_length, unsigned int iterations=10, bool use_projection=true)
Perform uniform remeshing.
Definition surface_mesh_remeshing.cpp:37
A k-d tree for triangular surface meshes.
Definition triangle_mesh_kdtree.h:24
Definition collider.cpp:182
T distance(const Vec< N, T > &v1, const Vec< N, T > &v2)
Computes the distance between two vectors/points.
Definition vec.h:295
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