mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -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
|
@ -19,10 +19,10 @@ static inline BoundingBox extrusion_polyline_extents(const Polyline &polyline, c
|
|||
if (! polyline.points.empty())
|
||||
bbox.merge(polyline.points.front());
|
||||
for (const Point &pt : polyline.points) {
|
||||
bbox.min.x = std::min(bbox.min.x, pt.x - radius);
|
||||
bbox.min.y = std::min(bbox.min.y, pt.y - radius);
|
||||
bbox.max.x = std::max(bbox.max.x, pt.x + radius);
|
||||
bbox.max.y = std::max(bbox.max.y, pt.y + radius);
|
||||
bbox.min.x() = std::min(bbox.min.x(), pt.x() - radius);
|
||||
bbox.min.y() = std::min(bbox.min.y(), pt.y() - radius);
|
||||
bbox.max.x() = std::max(bbox.max.x(), pt.x() + radius);
|
||||
bbox.max.y() = std::max(bbox.max.y(), pt.y() + radius);
|
||||
}
|
||||
return bbox;
|
||||
}
|
||||
|
@ -146,10 +146,10 @@ BoundingBoxf get_wipe_tower_extrusions_extents(const Print &print, const coordf_
|
|||
Pointf p2(e.pos.x, e.pos.y);
|
||||
bbox.merge(p1);
|
||||
coordf_t radius = 0.5 * e.width;
|
||||
bbox.min.x = std::min(bbox.min.x, std::min(p1.x, p2.x) - radius);
|
||||
bbox.min.y = std::min(bbox.min.y, std::min(p1.y, p2.y) - radius);
|
||||
bbox.max.x = std::max(bbox.max.x, std::max(p1.x, p2.x) + radius);
|
||||
bbox.max.y = std::max(bbox.max.y, std::max(p1.y, p2.y) + radius);
|
||||
bbox.min.x() = std::min(bbox.min.x(), std::min(p1.x(), p2.x()) - radius);
|
||||
bbox.min.y() = std::min(bbox.min.y(), std::min(p1.y(), p2.y()) - radius);
|
||||
bbox.max.x() = std::max(bbox.max.x(), std::max(p1.x(), p2.x()) + radius);
|
||||
bbox.max.y() = std::max(bbox.max.y(), std::max(p1.y(), p2.y()) + radius);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -170,10 +170,10 @@ BoundingBoxf get_wipe_tower_priming_extrusions_extents(const Print &print)
|
|||
Pointf p2(e.pos.x, e.pos.y);
|
||||
bbox.merge(p1);
|
||||
coordf_t radius = 0.5 * e.width;
|
||||
bbox.min.x = std::min(bbox.min.x, std::min(p1.x, p2.x) - radius);
|
||||
bbox.min.y = std::min(bbox.min.y, std::min(p1.y, p2.y) - radius);
|
||||
bbox.max.x = std::max(bbox.max.x, std::max(p1.x, p2.x) + radius);
|
||||
bbox.max.y = std::max(bbox.max.y, std::max(p1.y, p2.y) + radius);
|
||||
bbox.min.x() = std::min(bbox.min.x(), std::min(p1.x(), p2.x()) - radius);
|
||||
bbox.min.y() = std::min(bbox.min.y(), std::min(p1.y(), p2.y()) - radius);
|
||||
bbox.max.x() = std::max(bbox.max.x(), std::max(p1.x(), p2.x()) + radius);
|
||||
bbox.max.y() = std::max(bbox.max.y(), std::max(p1.y(), p2.y()) + radius);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue