mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Add ModelArrange.hpp as extension to Model.hpp, use it for duplicating
Refactored Arrange interface: remove the union based BedShapeHint, replace it with proper function overloads WARN: this commit is only intermediate, it does not compile.
This commit is contained in:
parent
44ca0a6c3d
commit
1bffc2b99b
13 changed files with 389 additions and 481 deletions
|
@ -48,12 +48,12 @@ int64_t Polygon::area2x() const
|
|||
}
|
||||
*/
|
||||
|
||||
double Polygon::area() const
|
||||
double Polygon::area(const Points &points)
|
||||
{
|
||||
size_t n = points.size();
|
||||
if (n < 3)
|
||||
return 0.;
|
||||
|
||||
|
||||
double a = 0.;
|
||||
for (size_t i = 0, j = n - 1; i < n; ++i) {
|
||||
a += ((double)points[j](0) + (double)points[i](0)) * ((double)points[i](1) - (double)points[j](1));
|
||||
|
@ -62,6 +62,11 @@ double Polygon::area() const
|
|||
return 0.5 * a;
|
||||
}
|
||||
|
||||
double Polygon::area() const
|
||||
{
|
||||
return Polygon::area(points);
|
||||
}
|
||||
|
||||
bool Polygon::is_counter_clockwise() const
|
||||
{
|
||||
return ClipperLib::Orientation(Slic3rMultiPoint_to_ClipperPath(*this));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue