mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-07-18 09:14:27 +00:00
Changing the internal representation of Point / Pointf / Point3 / Pointf3 to Eigen Matrix types, first step
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user