14#include <lagrange/Mesh.h>
15#include <lagrange/MeshTrait.h>
16#include <lagrange/legacy/inline.h>
21template <
typename MeshType>
24 static_assert(MeshTrait<MeshType>::is_mesh(),
"Input type is not Mesh");
26 using Index =
typename MeshType::Index;
28 const Index num_vertices = mesh.get_num_vertices();
29 const Index num_facets = mesh.get_num_facets();
30 const Index vertex_per_facet = mesh.get_vertex_per_facet();
31 const auto& facets = mesh.get_facets();
33 typename MeshType::AttributeArray valence(num_vertices, 1);
36 for (Index i = 0; i < num_facets; i++) {
37 for (Index j = 0; j < vertex_per_facet; j++) {
38 valence(facets(i, j), 0) += 1.0;
42 mesh.add_vertex_attribute(
"valence");
43 mesh.import_vertex_attribute(
"valence", valence);
AttributeId compute_vertex_valence(SurfaceMesh< Scalar, Index > &mesh, VertexValenceOptions options={})
Compute vertex valence.
Definition: compute_vertex_valence.cpp:25
Main namespace for Lagrange.
Definition: AABBIGL.h:30