Enhanced behaviour of scale 3D gizmo

This commit is contained in:
Enrico Turri 2018-08-22 11:22:07 +02:00
parent 889d0f1434
commit 0924bedd28
3 changed files with 117 additions and 52 deletions

View file

@ -89,6 +89,10 @@ class Linef3
explicit Linef3(Pointf3 _a, Pointf3 _b): a(_a), b(_b) {};
Pointf3 intersect_plane(double z) const;
void scale(double factor);
double length() const { return this->a.distance_to(this->b); }
Vectorf3 vector() const { return Vectorf3(this->b.x - this->a.x, this->b.y - this->a.y, this->b.z - this->a.z); }
Vectorf3 unit_vector() const { return (length() == 0.0) ? Vectorf3(0.0, 0.0, 0.0) : normalize(vector()); }
};
} // namespace Slic3r