15#include <lagrange/utils/range.h>
16#include <lagrange/utils/safe_cast.h>
40template <
typename DerivedF,
typename DerivedE,
typename DerivedN>
42 typename DerivedF::Scalar num_vertices,
43 const Eigen::MatrixBase<DerivedF> &facets,
44 Eigen::PlainObjectBase<DerivedE> &vertex_to_corner,
45 Eigen::PlainObjectBase<DerivedN> &next_corner_around_vertex)
47 using Index =
typename DerivedF::Scalar;
49 Index num_corners = safe_cast<Index>(facets.rows() * facets.cols());
52 vertex_to_corner.resize(num_vertices);
53 vertex_to_corner.setConstant(invalid<Index>());
54 next_corner_around_vertex.resize(num_corners);
55 next_corner_around_vertex.setConstant(invalid<Index>());
56 for (
auto f :
range(facets.rows())) {
57 for (
auto lv :
range(facets.cols())) {
58 Index c = (Index)(f * facets.cols() + lv);
59 Index v = facets(f, lv);
60 next_corner_around_vertex[c] = vertex_to_corner[v];
61 vertex_to_corner[v] = c;
internal::Range< Index > range(Index end)
Returns an iterable object representing the range [0, end).
Definition: range.h:176
Main namespace for Lagrange.
Definition: AABBIGL.h:30
void chain_corners_around_vertices(typename DerivedF::Scalar num_vertices, const Eigen::MatrixBase< DerivedF > &facets, Eigen::PlainObjectBase< DerivedE > &vertex_to_corner, Eigen::PlainObjectBase< DerivedN > &next_corner_around_vertex)
Chains facet corners around vertices of a mesh.
Definition: chain_corners_around_vertices.h:41