diff options
author | tamasmeszaros <meszaros.q@gmail.com> | 2018-05-17 11:37:26 +0300 |
---|---|---|
committer | tamasmeszaros <meszaros.q@gmail.com> | 2018-05-17 11:37:26 +0300 |
commit | fd829580e9c9c1f92e4a2338bcee35a5b319030a (patch) | |
tree | 7c79acf5d00e4775854649c871ff6a470e4117c6 /xs/src/libslic3r/Point.hpp | |
parent | b6b79458300f907e6878a71512912238bcb3e692 (diff) |
Working arrange_objects with DJD selection heuristic and a bottom-left placement strategy.
Diffstat (limited to 'xs/src/libslic3r/Point.hpp')
-rw-r--r-- | xs/src/libslic3r/Point.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xs/src/libslic3r/Point.hpp b/xs/src/libslic3r/Point.hpp index 6c9096a3d..a7569a006 100644 --- a/xs/src/libslic3r/Point.hpp +++ b/xs/src/libslic3r/Point.hpp @@ -81,6 +81,17 @@ inline Point operator*(double scalar, const Point& point2) { return Point(scalar inline int64_t cross(const Point &v1, const Point &v2) { return int64_t(v1.x) * int64_t(v2.y) - int64_t(v1.y) * int64_t(v2.x); } inline int64_t dot(const Point &v1, const Point &v2) { return int64_t(v1.x) * int64_t(v2.x) + int64_t(v1.y) * int64_t(v2.y); } +namespace int128 { + +// Exact orientation predicate, +// returns +1: CCW, 0: collinear, -1: CW. +int orient(const Point &p1, const Point &p2, const Point &p3); + +// Exact orientation predicate, +// returns +1: CCW, 0: collinear, -1: CW. +int cross(const Point &v1, const Slic3r::Point &v2); +} + // To be used by std::unordered_map, std::unordered_multimap and friends. struct PointHash { size_t operator()(const Point &pt) const { |