16#include <lagrange/Edge.h>
17#include <lagrange/common.h>
21template <
typename DerivedF>
23EdgeType<typename DerivedF::Scalar> get_opposite_edge(
24 const Eigen::PlainObjectBase<DerivedF>& facets,
25 typename DerivedF::Scalar fid,
26 typename DerivedF::Scalar vid)
28 using Edge = EdgeType<typename DerivedF::Scalar>;
29 assert(facets.cols() == 3);
30 const auto& f = facets.row(fid);
32 return Edge(f[1], f[2]);
33 }
else if (f[1] == vid) {
34 return Edge(f[2], f[0]);
35 }
else if (f[2] == vid) {
36 return Edge(f[0], f[1]);
38 throw std::runtime_error(
39 "Facet " + std::to_string(fid) +
" does not contain vertex " + std::to_string(vid));
@ Edge
Per-edge mesh attributes.
Definition: AttributeFwd.h:34
Main namespace for Lagrange.
Definition: AABBIGL.h:30