mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-23 06:39:23 -07:00
Ported make_clockwise() and make_counter_clockwise()
This commit is contained in:
@@ -52,4 +52,24 @@ Polygon::is_counter_clockwise()
|
||||
return orientation;
|
||||
}
|
||||
|
||||
bool
|
||||
Polygon::make_counter_clockwise()
|
||||
{
|
||||
if (!this->is_counter_clockwise()) {
|
||||
this->reverse();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
Polygon::make_clockwise()
|
||||
{
|
||||
if (this->is_counter_clockwise()) {
|
||||
this->reverse();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ class Polygon : public MultiPoint {
|
||||
Polyline* split_at_index(int index);
|
||||
Polyline* split_at_first_point();
|
||||
bool is_counter_clockwise();
|
||||
bool make_counter_clockwise();
|
||||
bool make_clockwise();
|
||||
};
|
||||
|
||||
typedef std::vector<Polygon> Polygons;
|
||||
|
||||
Reference in New Issue
Block a user