27#ifndef EASY3D_CORE_SURFACE_MESH_BUILDER_H
28#define EASY3D_CORE_SURFACE_MESH_BUILDER_H
31#include <unordered_map>
32#include <easy3d/core/surface_mesh.h>
145 bool vertices_valid(
const std::vector<Vertex> &vertices);
159 std::size_t resolve_non_manifold_vertices(
SurfaceMesh *mesh);
168 typedef std::unordered_map<Vertex, std::vector<Vertex>, Vertex::Hash> CopyRecord;
173 std::size_t resolve_non_manifold_vertex(
Halfedge h,
SurfaceMesh *mesh, CopyRecord ©_record);
179 std::size_t num_faces_less_three_vertices_;
182 std::size_t num_faces_duplicate_vertices;
185 std::size_t num_faces_out_of_range_vertices_;
188 std::size_t num_faces_unknown_topology_;
191 CopyRecord copied_vertices_for_linking_;
193 CopyRecord copied_vertices_;
196 std::vector<Vertex> face_vertices_;
199 SurfaceMesh::VertexProperty <Vertex> original_vertex_;
205 std::unordered_map<int, std::vector<int> > outgoing_halfedges_;
~SurfaceMeshBuilder()
Destructor.
Definition surface_mesh_builder.cpp:49
SurfaceMesh::Vertex Vertex
Vertex type.
Definition surface_mesh_builder.h:57
Face add_face(const std::vector< Vertex > &vertices)
Add a face to the mesh.
Definition surface_mesh_builder.cpp:272
SurfaceMesh::Face Face
Face type.
Definition surface_mesh_builder.h:59
void end_surface(bool log_issues=true)
Finalize surface construction.
Definition surface_mesh_builder.cpp:69
const std::vector< Vertex > & face_vertices() const
Get the actual vertices of the previously added face.
Definition surface_mesh_builder.h:137
SurfaceMesh::Halfedge Halfedge
Halfedge type.
Definition surface_mesh_builder.h:58
Face add_quad(Vertex v1, Vertex v2, Vertex v3, Vertex v4)
Add a new quad face connecting vertices v1, v2, v3, and v4.
Definition surface_mesh_builder.cpp:359
Face add_triangle(Vertex v1, Vertex v2, Vertex v3)
Add a new triangle face connecting vertices v1, v2, and v3.
Definition surface_mesh_builder.cpp:354
Vertex add_vertex(const vec3 &p)
Add a vertex to the mesh.
Definition surface_mesh_builder.cpp:228
SurfaceMeshBuilder(SurfaceMesh *mesh)
Constructor that initializes the builder with a given surface mesh.
Definition surface_mesh_builder.cpp:44
void begin_surface()
Begin surface construction.
Definition surface_mesh_builder.cpp:54
A halfedge data structure for polygonal meshes of 2-manifold.
Definition surface_mesh.h:51
Definition collider.cpp:182
Vec< 3, float > vec3
A 3D point/vector of float type.
Definition types.h:44
Definition surface_mesh.h:191
This type represents a halfedge (internally it is basically an index).
Definition surface_mesh.h:155
This type represents a vertex (internally it is basically an index).
Definition surface_mesh.h:135