mirror of
https://github.com/jhasse/poly2tri.git
synced 2025-02-18 12:23:31 +01:00
Patch inversion of head and tail in the advancing front initialization
No functional impact, the code is equivalent. We just assign head_ to af_head_ and tail_ to af_tail_ as one would expect.
This commit is contained in:
parent
5aa0c22365
commit
35b2fa916a
@ -87,8 +87,8 @@ void SweepContext::InitTriangulation()
|
|||||||
|
|
||||||
double dx = kAlpha * (xmax - xmin);
|
double dx = kAlpha * (xmax - xmin);
|
||||||
double dy = kAlpha * (ymax - ymin);
|
double dy = kAlpha * (ymax - ymin);
|
||||||
head_ = new Point(xmax + dx, ymin - dy);
|
head_ = new Point(xmin - dx, ymin - dy);
|
||||||
tail_ = new Point(xmin - dx, ymin - dy);
|
tail_ = new Point(xmax + dx, ymin - dy);
|
||||||
|
|
||||||
// Sort points along y-axis
|
// Sort points along y-axis
|
||||||
std::sort(points_.begin(), points_.end(), cmp);
|
std::sort(points_.begin(), points_.end(), cmp);
|
||||||
@ -124,7 +124,7 @@ void SweepContext::CreateAdvancingFront()
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Initial triangle
|
// Initial triangle
|
||||||
Triangle* triangle = new Triangle(*points_[0], *tail_, *head_);
|
Triangle* triangle = new Triangle(*points_[0], *head_, *tail_);
|
||||||
|
|
||||||
map_.push_back(triangle);
|
map_.push_back(triangle);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user