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>
129 bool vertices_valid(
const std::vector<Vertex> &vertices);
133 Vertex copy_vertex(Vertex v);
139 Vertex get(Vertex v);
143 std::size_t resolve_non_manifold_vertices(
SurfaceMesh *mesh);
152 typedef std::unordered_map<Vertex, std::vector<Vertex>, Vertex::Hash> CopyRecord;
157 std::size_t resolve_non_manifold_vertex(Halfedge h,
SurfaceMesh *mesh, CopyRecord ©_record);
163 std::size_t num_faces_less_three_vertices_;
166 std::size_t num_faces_duplicate_vertices;
169 std::size_t num_faces_out_of_range_vertices_;
172 std::size_t num_faces_unknown_topology_;
175 CopyRecord copied_vertices_for_linking_;
177 CopyRecord copied_vertices_;
180 std::vector<Vertex> face_vertices_;
189 std::unordered_map<int, std::vector<int> > outgoing_halfedges_;
Definition: surface_mesh.h:185
A helper class for constructing manifold surface mesh models.
Definition: surface_mesh_builder.h:56
Face add_face(const std::vector< Vertex > &vertices)
Add a face to the mesh.
Definition: surface_mesh_builder.cpp:273
void end_surface(bool log_issues=true)
Finalize surface construction. Must be called at the end of the surface construction and used in pair...
Definition: surface_mesh_builder.cpp:69
const std::vector< Vertex > & face_vertices() const
The actual vertices of the previously added face. The order of the vertices are the same as those pro...
Definition: surface_mesh_builder.h:121
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:360
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:355
Vertex add_vertex(const vec3 &p)
Add a vertex to the mesh.
Definition: surface_mesh_builder.cpp:228
void begin_surface()
Begin surface construction. Must be called at the beginning of the surface construction and used in p...
Definition: surface_mesh_builder.cpp:54
A halfedge data structure for polygonal meshes of 2-manifold.
Definition: surface_mesh.h:52
Definition: collider.cpp:182
Definition: surface_mesh.h:134
Definition: surface_mesh.h:114
Definition: surface_mesh.h:104