Further implementation of FillRectilinear3.

This commit is contained in:
bubnikv 2017-07-28 15:47:59 +02:00
parent 137aab9631
commit 812a2c7cbd
5 changed files with 237 additions and 213 deletions

View file

@ -286,7 +286,7 @@ public:
if (std::abs(det) > err)
return ((det > 0) ? 1 : -1) * invert;
}
return sign_determinant_2x2(p1, q1, p2, q2);
return sign_determinant_2x2(p1, q1, p2, q2) * invert;
}
// Exact orientation predicate,
@ -297,4 +297,11 @@ public:
Slic3r::Vector v2(p3 - p1);
return sign_determinant_2x2_filtered(v1.x, v1.y, v2.x, v2.y);
}
// Exact orientation predicate,
// returns +1: CCW, 0: collinear, -1: CW.
static int cross(const Slic3r::Point &v1, const Slic3r::Point &v2)
{
return sign_determinant_2x2_filtered(v1.x, v1.y, v2.x, v2.y);
}
};