14#include <lagrange/SurfaceMesh.h>
15#include <lagrange/utils/StackVector.h>
48template <
typename Scalar,
typename Index>
85template <
typename Scalar,
typename Index>
uint32_t AttributeId
Identified to be used to access an attribute.
Definition: AttributeFwd.h:73
AttributeId compute_facet_centroid(SurfaceMesh< Scalar, Index > &mesh, FacetCentroidOptions options={})
Compute per-facet centroid.
Definition: compute_centroid.cpp:31
void compute_mesh_centroid(const SurfaceMesh< Scalar, Index > &mesh, span< Scalar > centroid, MeshCentroidOptions options={})
Compute mesh centroid, where mesh centroid is defined as the weighted sum of facet centroids.
Definition: compute_centroid.cpp:74
::nonstd::span< T, Extent > span
A bounds-safe view for sequences of objects.
Definition: span.h:27
Main namespace for Lagrange.
Definition: AABBIGL.h:30
Option struct for computing per-facet centroid.
Definition: compute_centroid.h:31
std::string_view output_attribute_name
Ouptut facet centroid attribute name.
Definition: compute_centroid.h:33
Option struct for computing mesh centroid.
Definition: compute_centroid.h:57
std::string_view facet_centroid_attribute_name
Precomputed facet centroid attribute name.
Definition: compute_centroid.h:66
WeightingType
Weighting type for mesh centroid computation.
Definition: compute_centroid.h:59
@ Area
Per-facet centroid are weighted by facet area.
Definition: compute_centroid.h:61
@ Uniform
Per-facet centroid are weighted uniformly.
Definition: compute_centroid.h:60
std::string_view facet_area_attribute_name
Precomputed facet area attribute name.
Definition: compute_centroid.h:70