You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

33 lines
1.2 KiB

#include "ears.h"
#include "on_boundary.h"
#include "find.h"
#include "min.h"
#include <cassert>
template <
typename DerivedF,
typename Derivedear,
typename Derivedear_opp>
IGL_INLINE void igl::ears(
const Eigen::MatrixBase<DerivedF> & F,
Eigen::PlainObjectBase<Derivedear> & ear,
Eigen::PlainObjectBase<Derivedear_opp> & ear_opp)
{
assert(F.cols() == 3 && "F should contain triangles");
Eigen::Array<bool, Eigen::Dynamic, 3> B;
{
Eigen::Array<bool, Eigen::Dynamic, 1> I;
on_boundary(F,I,B);
}
find((B.rowwise().count() == 2).eval(), ear);
// Why do I need this .derived()?
Eigen::Array<bool, Eigen::Dynamic, 3> Bear = B(ear.derived(),Eigen::all);
Eigen::Array<bool, Eigen::Dynamic, 1> M;
igl::min(Bear,2,M,ear_opp);
}
#ifdef IGL_STATIC_LIBRARY
// Explicit template instantiation
// generated by autoexplicit.sh
template void igl::ears<Eigen::Matrix<int, -1, -1, 0, -1, -1>, Eigen::Matrix<int, -1, 1, 0, -1, 1>, Eigen::Matrix<int, -1, 1, 0, -1, 1> >(Eigen::MatrixBase<Eigen::Matrix<int, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&, Eigen::PlainObjectBase<Eigen::Matrix<int, -1, 1, 0, -1, 1> >&);
#endif