mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00
Improved G-code generator for multi-material prints
to minimize tool switches.
This commit is contained in:
parent
18bb3c3244
commit
2f57ee60d1
4 changed files with 553 additions and 378 deletions
|
@ -37,9 +37,15 @@ class Point
|
|||
static Point new_scale(coordf_t x, coordf_t y) {
|
||||
return Point(scale_(x), scale_(y));
|
||||
};
|
||||
|
||||
bool operator==(const Point& rhs) const { return this->x == rhs.x && this->y == rhs.y; }
|
||||
bool operator!=(const Point& rhs) const { return ! (*this == rhs); }
|
||||
bool operator<(const Point& rhs) const { return this->x < rhs.x || (this->x == rhs.x && this->y < rhs.y); }
|
||||
|
||||
Point& operator+=(const Point& rhs) { this->x += rhs.x; this->y += rhs.y; return *this; }
|
||||
Point& operator-=(const Point& rhs) { this->x -= rhs.x; this->y -= rhs.y; return *this; }
|
||||
Point& operator*=(const coord_t& rhs) { this->x *= rhs; this->y *= rhs; return *this; }
|
||||
|
||||
std::string wkt() const;
|
||||
std::string dump_perl() const;
|
||||
void scale(double factor);
|
||||
|
@ -184,7 +190,7 @@ std::ostream& operator<<(std::ostream &stm, const Pointf &pointf);
|
|||
|
||||
class Pointf
|
||||
{
|
||||
public:
|
||||
public:
|
||||
coordf_t x;
|
||||
coordf_t y;
|
||||
explicit Pointf(coordf_t _x = 0, coordf_t _y = 0): x(_x), y(_y) {};
|
||||
|
@ -203,6 +209,10 @@ class Pointf
|
|||
void rotate(double angle, const Pointf ¢er);
|
||||
Pointf negative() const;
|
||||
Vectorf vector_to(const Pointf &point) const;
|
||||
|
||||
Pointf& operator+=(const Pointf& rhs) { this->x += rhs.x; this->y += rhs.y; return *this; }
|
||||
Pointf& operator-=(const Pointf& rhs) { this->x -= rhs.x; this->y -= rhs.y; return *this; }
|
||||
Pointf& operator*=(const coordf_t& rhs) { this->x *= rhs; this->y *= rhs; return *this; }
|
||||
};
|
||||
|
||||
inline Pointf operator+(const Pointf& point1, const Pointf& point2) { return Pointf(point1.x + point2.x, point1.y + point2.y); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue