Skip to content

Commit

Permalink
merging
Browse files Browse the repository at this point in the history
  • Loading branch information
elalish committed Feb 12, 2025
1 parent b6d8c84 commit 026b478
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ void Manifold::Impl::CreateFaces() {
meshRelation_.triRef[tp.tri].faceID = tp.tri;
const vec3 base = vertPos_[halfedge_[3 * tp.tri].startVert];
const vec3 normal = faceNormal_[tp.tri];
std::deque<int> interiorHalfedges = {3 * tp.tri, 3 * tp.tri + 1,
3 * tp.tri + 2};
std::vector<int> interiorHalfedges = {3 * tp.tri, 3 * tp.tri + 1,
3 * tp.tri + 2};
while (!interiorHalfedges.empty()) {
const int h =
NextHalfedge(halfedge_[interiorHalfedges.back()].pairedHalfedge);
Expand All @@ -240,19 +240,15 @@ void Manifold::Impl::CreateFaces() {
const vec3 v = vertPos_[halfedge_[h].endVert];
if (abs(dot(v - base, normal)) < tolerance_) {
meshRelation_.triRef[h / 3].faceID = tp.tri;
if (!interiorHalfedges.empty() &&
h == halfedge_[interiorHalfedges.back()].pairedHalfedge) {
interiorHalfedges.pop_back();
} else {

if (interiorHalfedges.empty() ||
h != halfedge_[interiorHalfedges.back()].pairedHalfedge) {
interiorHalfedges.push_back(h);
}
const int hNext = NextHalfedge(h);
if (!interiorHalfedges.empty() &&
hNext == halfedge_[interiorHalfedges.front()].pairedHalfedge) {
interiorHalfedges.pop_front();
} else {
interiorHalfedges.push_back(hNext);
interiorHalfedges.pop_back();
}
const int hNext = NextHalfedge(h);
interiorHalfedges.push_back(hNext);
}
}
}
Expand Down

0 comments on commit 026b478

Please sign in to comment.