Skip to content

Commit

Permalink
Cull degenerate polygons as they're added
Browse files Browse the repository at this point in the history
  • Loading branch information
kintel committed Mar 16, 2024
1 parent 2b663ed commit 9eb7a13
Show file tree
Hide file tree
Showing 3 changed files with 2,109 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/geometry/PolySetBuilder.cc
Expand Up @@ -110,7 +110,11 @@ void PolySetBuilder::beginPolygon(int nvertices) {

void PolySetBuilder::addVertex(int ind)
{
current_polygon_.push_back(ind);
// Ignore consecutive duplicate indices
if (current_polygon_.empty() ||
ind != current_polygon_.back() && ind != current_polygon_.front()) {
current_polygon_.push_back(ind);
}
}

void PolySetBuilder::addVertex(const Vector3d &v)
Expand Down

0 comments on commit 9eb7a13

Please sign in to comment.