mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-03 02:22:46 +00:00
Cleanup of some method signatures and of XS return types
This commit is contained in:
@@ -98,10 +98,11 @@ Polyline::extend_start(double distance)
|
||||
|
||||
/* this method returns a collection of points picked on the polygon contour
|
||||
so that they are evenly spaced according to the input distance */
|
||||
void
|
||||
Polyline::equally_spaced_points(double distance, Points* points) const
|
||||
Points
|
||||
Polyline::equally_spaced_points(double distance) const
|
||||
{
|
||||
points->push_back(this->first_point());
|
||||
Points points;
|
||||
points.push_back(this->first_point());
|
||||
double len = 0;
|
||||
|
||||
for (Points::const_iterator it = this->points.begin() + 1; it != this->points.end(); ++it) {
|
||||
@@ -110,17 +111,18 @@ Polyline::equally_spaced_points(double distance, Points* points) const
|
||||
if (len < distance) continue;
|
||||
|
||||
if (len == distance) {
|
||||
points->push_back(*it);
|
||||
points.push_back(*it);
|
||||
len = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
double take = segment_length - (len - distance); // how much we take of this segment
|
||||
Line segment(*(it-1), *it);
|
||||
points->push_back(segment.point_at(take));
|
||||
points.push_back(segment.point_at(take));
|
||||
it--;
|
||||
len = -take;
|
||||
}
|
||||
return points;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user