FillAdaptive:

1) More accurate trimming of an anchor with another infill line
   or by another anchor line.
2) Trimming of very short infill lines, which are not anchored,
   by another infill lines.
This commit is contained in:
Vojtech Bubnik 2020-11-11 16:49:11 +01:00
parent 26836db629
commit 4d102ac8ca
3 changed files with 83 additions and 81 deletions

View file

@ -54,7 +54,8 @@ public:
Line(const Point& _a, const Point& _b) : a(_a), b(_b) {}
explicit operator Lines() const { Lines lines; lines.emplace_back(*this); return lines; }
void scale(double factor) { this->a *= factor; this->b *= factor; }
void translate(double x, double y) { Vector v(x, y); this->a += v; this->b += v; }
void translate(const Point &v) { this->a += v; this->b += v; }
void translate(double x, double y) { this->translate(Point(x, y)); }
void rotate(double angle, const Point &center) { this->a.rotate(angle, center); this->b.rotate(angle, center); }
void reverse() { std::swap(this->a, this->b); }
double length() const { return (b - a).cast<double>().norm(); }