mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-07-03 17:05:43 +02:00
Have Polygon inherit from Polyline
This commit is contained in:
@@ -8,47 +8,14 @@ extern "C" {
|
||||
#include "ppport.h"
|
||||
}
|
||||
|
||||
#include "Point.hpp"
|
||||
#include "Polyline.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
class Polygon
|
||||
{
|
||||
public:
|
||||
Points points;
|
||||
void scale(double factor);
|
||||
void translate(double x, double y);
|
||||
void rotate(double angle, Point* center);
|
||||
};
|
||||
class Polygon : public Polyline {};
|
||||
|
||||
typedef std::vector<Polygon> Polygons;
|
||||
|
||||
void
|
||||
Polygon::scale(double factor)
|
||||
{
|
||||
for (Points::iterator it = points.begin(); it != points.end(); ++it) {
|
||||
(*it).x *= factor;
|
||||
(*it).y *= factor;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Polygon::translate(double x, double y)
|
||||
{
|
||||
for (Points::iterator it = points.begin(); it != points.end(); ++it) {
|
||||
(*it).x += x;
|
||||
(*it).y += y;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Polygon::rotate(double angle, Point* center)
|
||||
{
|
||||
for (Points::iterator it = points.begin(); it != points.end(); ++it) {
|
||||
(*it).rotate(angle, center);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
perl2polygon(SV* poly_sv, Polygon& poly)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user