14#include <lagrange/SurfaceMesh.h>
15#include <lagrange/compute_facet_normal.h>
16#include <lagrange/internal/find_attribute_utils.h>
32template <
typename Scalar,
typename Index>
35 std::string_view facet_normal_attribute_name,
36 bool recompute_facet_normals)
39 bool had_facet_normals = mesh.has_attribute(facet_normal_attribute_name);
40 if (recompute_facet_normals || !had_facet_normals) {
45 facet_normal_id = internal::find_attribute<Scalar>(
47 facet_normal_attribute_name,
52 return std::make_pair(facet_normal_id, had_facet_normals);
uint32_t AttributeId
Identified to be used to access an attribute.
Definition: AttributeFwd.h:73
@ Normal
Mesh attribute can have dim or dim + 1 channels.
@ Facet
Per-facet mesh attributes.
Definition: AttributeFwd.h:31
AttributeId compute_facet_normal(SurfaceMesh< Scalar, Index > &mesh, FacetNormalOptions options={})
Compute facet normals.
Definition: compute_facet_normal.cpp:34
nullptr_t, size_t, ptrdiff_t basic_ostream bad_weak_ptr extent, remove_extent, is_array,...
Definition: attribute_string_utils.h:21
auto recompute_facet_normal_if_needed(SurfaceMesh< Scalar, Index > &mesh, std::string_view facet_normal_attribute_name, bool recompute_facet_normals)
Compute facet normal attribute if necessary or as requested.
Definition: recompute_facet_normal_if_needed.h:33
Option struct for computing per-facet mesh normals.
Definition: compute_facet_normal.h:33
std::string_view output_attribute_name
Output normal attribute name.
Definition: compute_facet_normal.h:35