mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
Reworked the algorithm for avoid crossing perimeters for multiple objects
This commit is contained in:
parent
69658a57d8
commit
c16aad7e0b
4 changed files with 167 additions and 35 deletions
|
@ -140,6 +140,17 @@ bool MultiPoint::first_intersection(const Line& line, Point* intersection) const
|
|||
return found;
|
||||
}
|
||||
|
||||
bool MultiPoint::intersections(const Line &line, Points *intersections) const
|
||||
{
|
||||
size_t intersections_size = intersections->size();
|
||||
for (const Line &polygon_line : this->lines()) {
|
||||
Point intersection;
|
||||
if (polygon_line.intersection(line, &intersection))
|
||||
intersections->emplace_back(std::move(intersection));
|
||||
}
|
||||
return intersections->size() > intersections_size;
|
||||
}
|
||||
|
||||
std::vector<Point> MultiPoint::_douglas_peucker(const std::vector<Point>& pts, const double tolerance)
|
||||
{
|
||||
std::vector<Point> result_pts;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue