Skip to content

Commit

Permalink
fixed bugs in flag
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoxifeng committed Jun 21, 2017
1 parent a9d5b16 commit dccdb58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/extract.cpp
Expand Up @@ -1742,9 +1742,10 @@ void MultiResolutionHierarchy::tagging_singularities_T_nodes(MatrixXf &V_tagging
Float dot_ = bes_vec.col(0).dot(bes_vec.col(1));
Float angle = std::acos(dot_);
Float cost = std::abs(angle - PAI);// (std::abs(n.sum()));
vs_rank.push_back(std::make_tuple(cost, v_id));
vs_rank.push_back(std::make_tuple(cost, F_tagging[i][v_id]));
}
sort(vs_rank.begin(), vs_rank.end());

V_flag[get<1>(vs_rank[0])] = V_type::t_node;
}
else {
Expand Down
5 changes: 3 additions & 2 deletions src/meshio.cpp
Expand Up @@ -323,11 +323,11 @@ void load_obj(const std::string &filename, MatrixXu &F, MatrixXf &V) {
void load_off(const std::string &filename, std::vector < std::vector<uint32_t>> &F, MatrixXf &V){
FILE *ff = fopen(filename.data(), "rt");
char s[1024], sread[1024], sread2[1024];
int vnum, hnum; float x, y, z;
int vnum, hnum, r; float x, y, z;
if (fscanf(ff, "%s", &sread) != 1 || (strcmp(sread, "OFF") != 0))
throw std::runtime_error("cannot find head of OFF!");

fscanf(ff, "%d %d", &vnum, &hnum);
fscanf(ff, "%d %d %d", &vnum, &hnum, &r);
V.resize(3, vnum);
V.setZero();
for (int i = 0; i<vnum; i++)
Expand All @@ -347,6 +347,7 @@ void load_off(const std::string &filename, std::vector < std::vector<uint32_t>>
F[i].resize(nw);
for (int j = 0; j<nw; j++) {
fscanf(ff, "%d", &(F[i][j]));
F[i][j]--;
}
}

Expand Down

0 comments on commit dccdb58

Please sign in to comment.