27#include <easy3d/core/poly_mesh.h>
28#include <easy3d/util/initializer.h>
38int main(
int argc,
char **argv) {
54 std::cout <<
"#cell: " << mesh.
n_cells() << std::endl;
55 std::cout <<
"#face: " << mesh.
n_faces() << std::endl;
56 std::cout <<
"#vertex: " << mesh.
n_vertices() << std::endl;
57 std::cout <<
"#edge: " << mesh.
n_edges() << std::endl;
61 std::cout <<
"coordinates of " << v <<
": " << mesh.
position(v) << std::endl;
63 for (
auto c : mesh.
cells()) {
64 std::cout <<
"vertex indices of " << c <<
": ";
66 std::cout << v.idx() <<
" ";
67 std::cout << std::endl;
Data structure representing a polyhedral mesh.
Definition: poly_mesh.h:50
const vec3 & position(Vertex v) const
position of a vertex (read only)
Definition: poly_mesh.h:1368
unsigned int n_faces() const
returns number of faces in the mesh
Definition: poly_mesh.h:774
unsigned int n_edges() const
returns number of edges in the mesh
Definition: poly_mesh.h:770
VertexContainer vertices() const
returns vertex container for C++11 range-based for-loops
Definition: poly_mesh.h:1129
CellContainer cells() const
returns cell container for C++11 range-based for-loops
Definition: poly_mesh.h:1201
Vertex add_vertex(const vec3 &p)
add a new vertex with position p
Definition: poly_mesh.h:709
Cell add_tetra(HalfFace f0, HalfFace f1, HalfFace f2, HalfFace f3)
Definition: poly_mesh.h:719
unsigned int n_cells() const
returns number of cells in the mesh
Definition: poly_mesh.h:776
unsigned int n_vertices() const
returns number of vertices in the mesh
Definition: poly_mesh.h:768
Definition: collider.cpp:182
void initialize(bool use_log_file, bool use_setting_file, const std::string &resource_dir)
Initialization of Easy3D.
Definition: initializer.cpp:35