mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-24 15:13:58 -06:00
Eradicated the Pointf class, replaced with Eigen Vector3d
This commit is contained in:
parent
cae0806112
commit
0b5b02e002
51 changed files with 267 additions and 293 deletions
|
@ -297,10 +297,10 @@ Point Polygon::point_projection(const Point &point) const
|
|||
dmin = d;
|
||||
proj = pt1;
|
||||
}
|
||||
Pointf v1(coordf_t(pt1(0) - pt0(0)), coordf_t(pt1(1) - pt0(1)));
|
||||
Vec2d v1(coordf_t(pt1(0) - pt0(0)), coordf_t(pt1(1) - pt0(1)));
|
||||
coordf_t div = v1.squaredNorm();
|
||||
if (div > 0.) {
|
||||
Pointf v2(coordf_t(point(0) - pt0(0)), coordf_t(point(1) - pt0(1)));
|
||||
Vec2d v2(coordf_t(point(0) - pt0(0)), coordf_t(point(1) - pt0(1)));
|
||||
coordf_t t = v1.dot(v2) / div;
|
||||
if (t > 0. && t < 1.) {
|
||||
Point foot(coord_t(floor(coordf_t(pt0(0)) + t * v1(0) + 0.5)), coord_t(floor(coordf_t(pt0(1)) + t * v1(1) + 0.5)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue