mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Changing the internal representation of Point / Pointf / Point3 / Pointf3 to Eigen Matrix types, first step
This commit is contained in:
parent
077680b806
commit
86da661097
60 changed files with 1228 additions and 1206 deletions
|
@ -15,9 +15,9 @@ inline int nearest_point_index(const std::vector<Chaining> &pairs, const Point &
|
|||
T dmin = std::numeric_limits<T>::max();
|
||||
int idx = 0;
|
||||
for (std::vector<Chaining>::const_iterator it = pairs.begin(); it != pairs.end(); ++it) {
|
||||
T d = sqr(T(start_near.x - it->first.x));
|
||||
T d = sqr(T(start_near.x() - it->first.x()));
|
||||
if (d <= dmin) {
|
||||
d += sqr(T(start_near.y - it->first.y));
|
||||
d += sqr(T(start_near.y() - it->first.y()));
|
||||
if (d < dmin) {
|
||||
idx = (it - pairs.begin()) * 2;
|
||||
dmin = d;
|
||||
|
@ -26,9 +26,9 @@ inline int nearest_point_index(const std::vector<Chaining> &pairs, const Point &
|
|||
}
|
||||
}
|
||||
if (! no_reverse) {
|
||||
d = sqr(T(start_near.x - it->last.x));
|
||||
d = sqr(T(start_near.x() - it->last.x()));
|
||||
if (d <= dmin) {
|
||||
d += sqr(T(start_near.y - it->last.y));
|
||||
d += sqr(T(start_near.y() - it->last.y()));
|
||||
if (d < dmin) {
|
||||
idx = (it - pairs.begin()) * 2 + 1;
|
||||
dmin = d;
|
||||
|
@ -82,7 +82,7 @@ Point PolylineCollection::leftmost_point(const Polylines &polylines)
|
|||
Point p = it->leftmost_point();
|
||||
for (++ it; it != polylines.end(); ++it) {
|
||||
Point p2 = it->leftmost_point();
|
||||
if (p2.x < p.x)
|
||||
if (p2.x() < p.x())
|
||||
p = p2;
|
||||
}
|
||||
return p;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue