diff --git a/src/catmull_clark.cpp b/src/catmull_clark.cpp index f46520d..ec7e2ad 100644 --- a/src/catmull_clark.cpp +++ b/src/catmull_clark.cpp @@ -165,8 +165,8 @@ void subdivide_quad_mesh_catmull_clark( /* Check if the edge has been computed before */ if (EAP.find(Eigen::RowVector2i(v1, v2)) == EAP.end()) { - SV.row(V.rows() + F.rows() + EAP.size()) = compute_edge_average_point(V, F, FC, Eigen::RowVector2i(v1, v2)); - EAP[Eigen::RowVector2i(v1, v2)] = V.rows() + F.rows() + EAP.size(); + SV.row(static_cast(V.rows() + F.rows() + EAP.size())) = compute_edge_average_point(V, F, FC, Eigen::RowVector2i(v1, v2)); + EAP[Eigen::RowVector2i(v1, v2)] = static_cast(V.rows() + F.rows() + EAP.size()); } } } @@ -179,7 +179,7 @@ void subdivide_quad_mesh_catmull_clark( /* Compute the faces */ for (int i = 0; i < F.rows(); i++) { /* For each face */ - int face_centroid = V.rows() + i; + const int face_centroid = static_cast(V.rows() + i); int edge_average_points[4] = { EAP.at(Eigen::RowVector2i(std::min(F(i, 0), F(i, 1)), std::max(F(i, 0), F(i, 1)))), EAP.at(Eigen::RowVector2i(std::min(F(i, 1), F(i, 2)), std::max(F(i, 1), F(i, 2)))), diff --git a/src/per_corner_normals.cpp b/src/per_corner_normals.cpp index 34e4f11..6e03142 100644 --- a/src/per_corner_normals.cpp +++ b/src/per_corner_normals.cpp @@ -13,9 +13,9 @@ void per_corner_normals( Eigen::VectorXi count = Eigen::VectorXi::Zero(F.rows()*3); std::vector> VF; - vertex_triangle_adjacency(F, V.rows(), VF); + vertex_triangle_adjacency(F, static_cast(V.rows()), VF); - double cos_threshold = std::cos(corner_threshold * M_PI / 180.0); + double cos_threshold = std::cos(corner_threshold * 3.14159265358979323846 / 180.0); /* Compute the area-weighted average of normals of faces with normals that deviate less than threshold. */ for (int i = 0; i < F.rows(); i++) { /* For each face */ diff --git a/src/per_vertex_normals.cpp b/src/per_vertex_normals.cpp index 856b789..0c84252 100644 --- a/src/per_vertex_normals.cpp +++ b/src/per_vertex_normals.cpp @@ -11,7 +11,7 @@ void per_vertex_normals( Eigen::VectorXi count = Eigen::VectorXi::Zero(V.rows()); std::vector> VF; - vertex_triangle_adjacency(F, V.rows(), VF); + vertex_triangle_adjacency(F, static_cast(V.rows()), VF); /* Calculate the product of the area and the normal of each face neighboring each vertex. */ for (int i = 0; i < V.rows(); i++) {