@@ -1686,7 +1686,6 @@ std::vector<Scalar> generate_cones_from_rotation_form_FIXME(
16861686void IntrinsicNRosyField::compute_principal_matchings (const Mesh<Scalar>& m)
16871687{
16881688 int num_halfedges = m.n_halfedges ();
1689- VectorX rotation_form (num_halfedges);
16901689 for (int hij = 0 ; hij < num_halfedges; ++hij) {
16911690 if (hij < m.opp [hij]) continue ;
16921691 int hji = m.opp [hij];
@@ -2551,5 +2550,58 @@ void IntrinsicNRosyField::set_field(
25512550 }
25522551}
25532552
2553+ void IntrinsicNRosyField::set_theta (
2554+ const Mesh<Scalar>& m,
2555+ const Eigen::VectorXd& face_theta)
2556+ {
2557+ int num_faces = m.n_faces ();
2558+ for (int fijk = 0 ; fijk < num_faces; ++fijk)
2559+ {
2560+ // get reference halfedge
2561+ int hij = m.h [fijk];
2562+
2563+ // only process original faces
2564+ if (m.type [hij] == 2 ) continue ;
2565+
2566+ // record face angles
2567+ theta[fijk] = Scalar (face_theta[fijk]);
2568+
2569+ // skip doubling on closed mesh
2570+ if (m.type [hij] == 0 ) continue ;
2571+
2572+ // invert theta on reflected face
2573+ int fjik = m.f [m.R [hij]];
2574+ theta[fjik] = M_PI - theta[fijk];
2575+ }
2576+ }
2577+
2578+
2579+ void IntrinsicNRosyField::set_field (
2580+ const Mesh<Scalar>& m,
2581+ const std::vector<int >& vtx_reindex,
2582+ const Eigen::MatrixXi& F,
2583+ const Eigen::VectorXd& face_theta,
2584+ const Eigen::MatrixXd& corner_kappa,
2585+ const Eigen::MatrixXi& corner_period_jump)
2586+ {
2587+ std::vector<int > face_reindex;
2588+ arange (F.rows (), face_reindex);
2589+ set_field (m, vtx_reindex, F, face_reindex, face_theta, corner_kappa, corner_period_jump);
2590+ }
2591+
2592+ void IntrinsicNRosyField::get_field (
2593+ const Mesh<Scalar>& m,
2594+ const std::vector<int >& vtx_reindex,
2595+ const Eigen::MatrixXi& F,
2596+ Eigen::VectorXi& reference_corner,
2597+ Eigen::VectorXd& face_theta,
2598+ Eigen::MatrixXd& corner_kappa,
2599+ Eigen::MatrixXi& corner_period_jump) const
2600+ {
2601+ std::vector<int > face_reindex;
2602+ arange (F.rows (), face_reindex);
2603+ get_field (m, vtx_reindex, F, face_reindex, reference_corner, face_theta, corner_kappa, corner_period_jump);
2604+ }
2605+
25542606} // namespace Holonomy
25552607} // namespace Penner
0 commit comments