@@ -23,7 +23,7 @@ namespace CurvatureMetric {
2323
2424Scalar
2525compute_face_area (
26- const std::array<VectorX , 3 >& vertices
26+ const std::array<Eigen::VectorXd , 3 >& vertices
2727) {
2828 // Get edge lengths for triangle
2929 Scalar li = (vertices[1 ] - vertices[0 ]).norm ();
@@ -36,7 +36,7 @@ compute_face_area(
3636
3737bool
3838is_inverted_triangle (
39- const std::array<VectorX , 3 >& vertices
39+ const std::array<Eigen::VectorXd , 3 >& vertices
4040) {
4141 // Build matrix of triangle homogenous coordinates
4242 Eigen::Matrix<Scalar, 3 , 3 > tri_homogenous_coords;
@@ -45,15 +45,15 @@ is_inverted_triangle(
4545 tri_homogenous_coords.col (2 ) << vertices[2 ][0 ], vertices[2 ][1 ], 1.0 ;
4646
4747 // Triangle is flipped iff the determinant is negative
48- double det = tri_homogenous_coords.determinant ();
48+ Scalar det = tri_homogenous_coords.determinant ();
4949 return (det < 0.0 );
5050}
5151
5252
5353bool
5454is_self_overlapping_polygon (
55- const std::vector<VectorX >& uv_vertices,
56- const std::vector<VectorX >& vertices,
55+ const std::vector<Eigen::VectorXd >& uv_vertices,
56+ const std::vector<Eigen::VectorXd >& vertices,
5757 std::vector<std::vector<bool >>& is_self_overlapping_subpolygon,
5858 std::vector<std::vector<int >>& splitting_vertices,
5959 std::vector<std::vector<Scalar>>& min_face_areas
@@ -108,8 +108,8 @@ is_self_overlapping_polygon(
108108 for (int k = (i + 1 ) % face_size; k != j; k = (k + 1 ) % face_size)
109109 {
110110 // Check if triangle T_ikj is positively oriented
111- std::array<VectorX , 3 > uv_triangle = { uv_vertices[i], uv_vertices[k], uv_vertices[j] };
112- std::array<VectorX , 3 > triangle = { vertices[i], vertices[k], vertices[j] };
111+ std::array<Eigen::VectorXd , 3 > uv_triangle = { uv_vertices[i], uv_vertices[k], uv_vertices[j] };
112+ std::array<Eigen::VectorXd , 3 > triangle = { vertices[i], vertices[k], vertices[j] };
113113 if (is_inverted_triangle (uv_triangle)) continue ;
114114
115115 // Check if the two subpolygons (i, k) and (k, j) are self overlapping
@@ -266,8 +266,8 @@ triangulate_self_overlapping_polygon(
266266// Helper function to view the triangulated face
267267void
268268view_triangulation (
269- const std::vector<VectorX >& uv_vertices,
270- const std::vector<VectorX >& vertices,
269+ const std::vector<Eigen::VectorXd >& uv_vertices,
270+ const std::vector<Eigen::VectorXd >& vertices,
271271 const std::vector<std::vector<bool >>& is_self_overlapping_subpolygon,
272272 const std::vector<std::vector<int >>& splitting_vertices,
273273 const std::vector<std::vector<Scalar>>& min_face_areas,
0 commit comments