123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #include "local_basis.h"
- #include <sstream>
- #include <string>
- #include <fstream>
- #include <vector>
- #include <Eigen/Geometry>
- using namespace Eigen;
- using namespace std;
- namespace igl
- {
- template <typename DerivedV, typename DerivedF>
- IGL_INLINE void local_basis(
- const Eigen::PlainObjectBase<DerivedV>& V,
- const Eigen::PlainObjectBase<DerivedF>& F,
- Eigen::PlainObjectBase<DerivedV>& B1,
- Eigen::PlainObjectBase<DerivedV>& B2,
- Eigen::PlainObjectBase<DerivedV>& B3
- )
- {
- B1.resize(F.rows(),3);
- B2.resize(F.rows(),3);
- B3.resize(F.rows(),3);
- for (unsigned i=0;i<F.rows();++i)
- {
- RowVector3d v1 = (V.row(F(i,1)) - V.row(F(i,0))).normalized();
- RowVector3d t = V.row(F(i,2)) - V.row(F(i,0));
- RowVector3d v3 = v1.cross(t).normalized();
- RowVector3d v2 = v1.cross(v3).normalized();
- B1.row(i) = v1;
- B2.row(i) = v2;
- B3.row(i) = v3;
- }
- }
- }
- #ifndef IGL_HEADER_ONLY
- // Explicit template specialization
- // generated by autoexplicit.sh
- #endif
|