14#include <lagrange/utils/assert.h>
17#include <lagrange/utils/warnoff.h>
18#include <tbb/parallel_for.h>
19#include <lagrange/utils/warnon.h>
38template <
typename DerivedV,
typename DerivedF,
typename DerivedK>
40 const Eigen::MatrixBase<DerivedV>& vertices,
41 const Eigen::MatrixBase<DerivedF>& facets,
42 Eigen::PlainObjectBase<DerivedK>& angles)
47 using Scalar =
typename DerivedV::Scalar;
48 using Index =
typename DerivedF::Index;
49 const Index m = facets.rows();
51 tbb::parallel_for(Index(0), m, [&](
const Index f) {
52 for (
size_t d = 0; d < 3; d++) {
53 auto v1 = vertices.row(facets(f, d)) - vertices.row(facets(f, (d + 1) % 3));
54 auto v2 = vertices.row(facets(f, d)) - vertices.row(facets(f, (d + 2) % 3));
55 angles(f, d) = Scalar(2) * std::atan2(
56 (v1.stableNormalized() - v2.stableNormalized()).norm(),
57 (v1.stableNormalized() + v2.stableNormalized()).norm());
#define la_runtime_assert(...)
Runtime assertion check.
Definition: assert.h:169
nullptr_t, size_t, ptrdiff_t basic_ostream bad_weak_ptr extent, remove_extent, is_array,...
Definition: attribute_string_utils.h:21
void internal_angles(const Eigen::MatrixBase< DerivedV > &vertices, const Eigen::MatrixBase< DerivedF > &facets, Eigen::PlainObjectBase< DerivedK > &angles)
Compute internal angles for a triangle mesh.
Definition: internal_angles.h:39