mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-21 05:37:52 -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
|
@ -952,8 +952,8 @@ static void thick_lines_to_indexed_vertex_array(
|
|||
// right, left, top, bottom
|
||||
int idx_prev[4] = { -1, -1, -1, -1 };
|
||||
double bottom_z_prev = 0.;
|
||||
Pointf b1_prev(Vec2d::Zero());
|
||||
Vectorf v_prev(Vec2d::Zero());
|
||||
Vec2d b1_prev(Vec2d::Zero());
|
||||
Vec2d v_prev(Vec2d::Zero());
|
||||
int idx_initial[4] = { -1, -1, -1, -1 };
|
||||
double width_initial = 0.;
|
||||
double bottom_z_initial = 0.0;
|
||||
|
@ -973,23 +973,23 @@ static void thick_lines_to_indexed_vertex_array(
|
|||
bool is_last = (ii == lines_end - 1);
|
||||
bool is_closing = closed && is_last;
|
||||
|
||||
Vectorf v = unscale(line.vector());
|
||||
Vec2d v = unscale(line.vector());
|
||||
v *= inv_len;
|
||||
|
||||
Pointf a = unscale(line.a);
|
||||
Pointf b = unscale(line.b);
|
||||
Pointf a1 = a;
|
||||
Pointf a2 = a;
|
||||
Pointf b1 = b;
|
||||
Pointf b2 = b;
|
||||
Vec2d a = unscale(line.a);
|
||||
Vec2d b = unscale(line.b);
|
||||
Vec2d a1 = a;
|
||||
Vec2d a2 = a;
|
||||
Vec2d b1 = b;
|
||||
Vec2d b2 = b;
|
||||
{
|
||||
double dist = 0.5 * width; // scaled
|
||||
double dx = dist * v(0);
|
||||
double dy = dist * v(1);
|
||||
a1 += Vectorf(+dy, -dx);
|
||||
a2 += Vectorf(-dy, +dx);
|
||||
b1 += Vectorf(+dy, -dx);
|
||||
b2 += Vectorf(-dy, +dx);
|
||||
a1 += Vec2d(+dy, -dx);
|
||||
a2 += Vec2d(-dy, +dx);
|
||||
b1 += Vec2d(+dy, -dx);
|
||||
b2 += Vec2d(-dy, +dx);
|
||||
}
|
||||
|
||||
// calculate new XY normals
|
||||
|
@ -1064,7 +1064,7 @@ static void thick_lines_to_indexed_vertex_array(
|
|||
{
|
||||
// Create a sharp corner with an overshot and average the left / right normals.
|
||||
// At the crease angle of 45 degrees, the overshot at the corner will be less than (1-1/cos(PI/8)) = 8.2% over an arc.
|
||||
Pointf intersection(Vec2d::Zero());
|
||||
Vec2d intersection(Vec2d::Zero());
|
||||
Geometry::ray_ray_intersection(b1_prev, v_prev, a1, v, intersection);
|
||||
a1 = intersection;
|
||||
a2 = 2. * a - intersection;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue