15#include <lagrange/utils/range.h>
38template <
typename DerivedF,
typename DerivedC,
typename DerivedE,
typename DerivedN>
40 const Eigen::MatrixBase<DerivedF>& facets,
41 const Eigen::MatrixBase<DerivedC>& corner_to_edge,
42 Eigen::PlainObjectBase<DerivedE>& edge_to_corner,
43 Eigen::PlainObjectBase<DerivedN>& next_corner_around_edge)
45 using Index =
typename DerivedF::Scalar;
47 Index num_edges = (corner_to_edge.size() ? corner_to_edge.maxCoeff() + 1 : 0);
48 Index num_corners = (Index)(facets.rows() * facets.cols());
51 edge_to_corner.resize(num_edges);
52 edge_to_corner.setConstant(invalid<Index>());
53 next_corner_around_edge.resize(num_corners);
54 next_corner_around_edge.setConstant(invalid<Index>());
55 for (
auto f :
range(facets.rows())) {
56 for (
auto lv :
range(facets.cols())) {
57 Index c = (Index)(f * facets.cols() + lv);
58 Index e = corner_to_edge(c);
59 next_corner_around_edge[c] = edge_to_corner[e];
60 edge_to_corner[e] = 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_edges(const Eigen::MatrixBase< DerivedF > &facets, const Eigen::MatrixBase< DerivedC > &corner_to_edge, Eigen::PlainObjectBase< DerivedE > &edge_to_corner, Eigen::PlainObjectBase< DerivedN > &next_corner_around_edge)
Chains facet corners around edges of a mesh.
Definition: chain_corners_around_edges.h:39