Skip to content

Commit

Permalink
Patch inversion of head and tail in the advancing front initialization
Browse files Browse the repository at this point in the history
No functional impact, the code is equivalent. We just assign
head_ to af_head_ and tail_ to af_tail_ as one would expect.
  • Loading branch information
pierre-dejoue committed Oct 26, 2020
1 parent 5aa0c22 commit 35b2fa9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions poly2tri/sweep/sweep_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ void SweepContext::InitTriangulation()

double dx = kAlpha * (xmax - xmin);
double dy = kAlpha * (ymax - ymin);
head_ = new Point(xmax + dx, ymin - dy);
tail_ = new Point(xmin - dx, ymin - dy);
head_ = new Point(xmin - dx, ymin - dy);
tail_ = new Point(xmax + dx, ymin - dy);

// Sort points along y-axis
std::sort(points_.begin(), points_.end(), cmp);
Expand Down Expand Up @@ -124,7 +124,7 @@ void SweepContext::CreateAdvancingFront()
{

// Initial triangle
Triangle* triangle = new Triangle(*points_[0], *tail_, *head_);
Triangle* triangle = new Triangle(*points_[0], *head_, *tail_);

map_.push_back(triangle);

Expand Down

0 comments on commit 35b2fa9

Please sign in to comment.