mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00
Cleanup of some method signatures and of XS return types
This commit is contained in:
parent
c9cdae1a96
commit
8791f5a493
39 changed files with 252 additions and 339 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue