mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00
Merged with dev
This commit is contained in:
parent
d934b63424
commit
fe3b92870f
90 changed files with 3310 additions and 1748 deletions
|
@ -184,15 +184,13 @@ void Polyline::split_at(const Point &point, Polyline* p1, Polyline* p2) const
|
|||
|
||||
bool Polyline::is_straight() const
|
||||
{
|
||||
/* Check that each segment's direction is equal to the line connecting
|
||||
first point and last point. (Checking each line against the previous
|
||||
one would cause the error to accumulate.) */
|
||||
// Check that each segment's direction is equal to the line connecting
|
||||
// first point and last point. (Checking each line against the previous
|
||||
// one would cause the error to accumulate.)
|
||||
double dir = Line(this->first_point(), this->last_point()).direction();
|
||||
|
||||
Lines lines = this->lines();
|
||||
for (Lines::const_iterator line = lines.begin(); line != lines.end(); ++line) {
|
||||
if (!line->parallel_to(dir)) return false;
|
||||
}
|
||||
for (const auto &line: this->lines())
|
||||
if (! line.parallel_to(dir))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue