New get_extents(const std::vector<Points> &pts),

refactored Lian Barsky line clipping
This commit is contained in:
Vojtech Bubnik 2020-11-16 10:20:47 +01:00
parent 32362cff0b
commit 84693a5810
5 changed files with 29 additions and 19 deletions

View file

@ -13,6 +13,7 @@
namespace Slic3r {
class BoundingBox;
class Line;
class MultiPoint;
class Point;
@ -178,6 +179,9 @@ inline Point lerp(const Point &a, const Point &b, double t)
return ((1. - t) * a.cast<double>() + t * b.cast<double>()).cast<coord_t>();
}
extern BoundingBox get_extents(const Points &pts);
extern BoundingBox get_extents(const std::vector<Points> &pts);
namespace int128 {
// Exact orientation predicate,
// returns +1: CCW, 0: collinear, -1: CW.