Working arrange_objects with DJD selection heuristic and a bottom-left placement strategy.

This commit is contained in:
tamasmeszaros 2018-05-17 10:37:26 +02:00
parent b6b7945830
commit fd829580e9
36 changed files with 6087 additions and 45 deletions

View file

@ -1,6 +1,7 @@
#include "Point.hpp"
#include "Line.hpp"
#include "MultiPoint.hpp"
#include "Int128.hpp"
#include <algorithm>
#include <cmath>
@ -375,4 +376,20 @@ Pointf3::vector_to(const Pointf3 &point) const
return Vectorf3(point.x - this->x, point.y - this->y, point.z - this->z);
}
namespace int128 {
int orient(const Point &p1, const Point &p2, const Point &p3)
{
Slic3r::Vector v1(p2 - p1);
Slic3r::Vector v2(p3 - p1);
return Int128::sign_determinant_2x2_filtered(v1.x, v1.y, v2.x, v2.y);
}
int cross(const Point &v1, const Point &v2)
{
return Int128::sign_determinant_2x2_filtered(v1.x, v1.y, v2.x, v2.y);
}
}
}