Compare commits

..

No commits in common. "d2dc1bf17f803ecf0b36d1f33cc80396ea120cd3" and "3d600174b34e1dbaa4bf8550ff39b5f1fa8c5c7c" have entirely different histories.

3 changed files with 6 additions and 6 deletions

View file

@ -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(static_cast<int>(V.rows() + F.rows() + EAP.size())) = compute_edge_average_point(V, F, FC, Eigen::RowVector2i(v1, v2));
EAP[Eigen::RowVector2i(v1, v2)] = static_cast<int>(V.rows() + F.rows() + EAP.size());
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();
}
}
}
@ -179,7 +179,7 @@ void subdivide_quad_mesh_catmull_clark(
/* Compute the faces */
for (int i = 0; i < F.rows(); i++) { /* For each face */
const int face_centroid = static_cast<int>(V.rows() + i);
int face_centroid = 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)))),

View file

@ -13,9 +13,9 @@ void per_corner_normals(
Eigen::VectorXi count = Eigen::VectorXi::Zero(F.rows()*3);
std::vector<std::vector<int>> VF;
vertex_triangle_adjacency(F, static_cast<int>(V.rows()), VF);
vertex_triangle_adjacency(F, V.rows(), VF);
double cos_threshold = std::cos(corner_threshold * 3.14159265358979323846 / 180.0);
double cos_threshold = std::cos(corner_threshold * M_PI / 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 */

View file

@ -11,7 +11,7 @@ void per_vertex_normals(
Eigen::VectorXi count = Eigen::VectorXi::Zero(V.rows());
std::vector<std::vector<int>> VF;
vertex_triangle_adjacency(F, static_cast<int>(V.rows()), VF);
vertex_triangle_adjacency(F, 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++) {