mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 19:55:58 +08:00
Fix of utilization of the front part of the plate for object scheduling.
This commit is contained in:
parent
db67a7eab3
commit
78c8463c15
@ -8954,7 +8954,7 @@ void augment_TemporalSpread(const SolverConfiguration &solver_configuration,
|
||||
sorted_polygons[dec_values_T[decided_polygons[i]].as_double()] = decided_polygons[i];
|
||||
}
|
||||
|
||||
int time = SEQ_GROUND_PRESENCE_TIME;
|
||||
int time = SEQ_GROUND_PRESENCE_TIME + 2 * solver_configuration.temporal_spread * solver_configuration.object_group_size;
|
||||
|
||||
for (const auto& sorted_polygon: sorted_polygons)
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ void test_polygon_1(void)
|
||||
|
||||
Polygon polygon_1 = {{-1000000, -1000000}, {1000000, -1000000}, {1000000, 1000000}, {-1000000, 1000000} };
|
||||
|
||||
for (usingned int i = 0; i < polygon_1.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_1.size(); ++i)
|
||||
{
|
||||
Point point = polygon_1[i];
|
||||
printf("%d,%d\n", point.x(), point.y());
|
||||
@ -65,21 +65,21 @@ void test_polygon_2(void)
|
||||
{
|
||||
printf("Testing polygon 2 ...\n");
|
||||
|
||||
for (int k = 0; k < PRUSA_PART_POLYGONS.size(); ++k)
|
||||
for (unsigned int k = 0; k < PRUSA_PART_POLYGONS.size(); ++k)
|
||||
{
|
||||
printf("k = %d\n", k);
|
||||
|
||||
const Polygon &polygon_1 = PRUSA_PART_POLYGONS[k];
|
||||
Polygon hull_1 = convex_hull(polygon_1);
|
||||
|
||||
for (usingned int i = 0; i < polygon_1.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_1.size(); ++i)
|
||||
{
|
||||
const Point &point = polygon_1[i];
|
||||
printf("poly %d: %d,%d\n", i, point.x(), point.y());
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
for (usingned int i = 0; i < hull_1.size(); ++i)
|
||||
for (unsigned int i = 0; i < hull_1.size(); ++i)
|
||||
{
|
||||
const Point &point = hull_1[i];
|
||||
printf("hull %d: %d,%d\n", i, point.x(), point.y());
|
||||
@ -154,7 +154,7 @@ void test_polygon_3(void)
|
||||
z3::expr_vector Y_positions(z_context);
|
||||
z3::expr_vector T_parameters(z_context);
|
||||
|
||||
for (usingned int i = 0; i < line_count; ++i)
|
||||
for (int i = 0; i < line_count; ++i)
|
||||
{
|
||||
printf("i:%d\n", i);
|
||||
string name = "x_pos-" + to_string(i);
|
||||
@ -163,7 +163,7 @@ void test_polygon_3(void)
|
||||
X_positions.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < line_count; ++i)
|
||||
for (int i = 0; i < line_count; ++i)
|
||||
{
|
||||
string name = "y_pos-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -171,7 +171,7 @@ void test_polygon_3(void)
|
||||
Y_positions.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < line_count; ++i)
|
||||
for (int i = 0; i < line_count; ++i)
|
||||
{
|
||||
string name = "t_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -240,7 +240,7 @@ void test_polygon_3(void)
|
||||
finish = clock();
|
||||
|
||||
printf("Printing interpretation:\n");
|
||||
for (usingned usingned int i = 0; i < z_model.size(); ++i)
|
||||
for (unsigned int i = 0; i < z_model.size(); ++i)
|
||||
{
|
||||
printf("Variable:%s ", z_model[i].name().str().c_str());
|
||||
|
||||
@ -380,7 +380,7 @@ void test_polygon_4(void)
|
||||
finish = clock();
|
||||
|
||||
printf("Printing interpretation:\n");
|
||||
for (usingned int i = 0; i < z_model.size(); ++i)
|
||||
for (unsigned int i = 0; i < z_model.size(); ++i)
|
||||
{
|
||||
printf("Variable:%s ", z_model[i].name().str().c_str());
|
||||
|
||||
@ -521,7 +521,7 @@ void test_polygon_5(void)
|
||||
finish = clock();
|
||||
|
||||
printf("Printing interpretation:\n");
|
||||
for (usingned int i = 0; i < z_model.size(); ++i)
|
||||
for (unsigned int i = 0; i < z_model.size(); ++i)
|
||||
{
|
||||
printf("Variable:%s ", z_model[i].name().str().c_str());
|
||||
|
||||
@ -642,7 +642,7 @@ void test_polygon_6(void)
|
||||
finish = clock();
|
||||
|
||||
printf("Printing interpretation:\n");
|
||||
for (usingned int i = 0; i < z_model.size(); ++i)
|
||||
for (unsigned int i = 0; i < z_model.size(); ++i)
|
||||
{
|
||||
printf("Variable:%s ", z_model[i].name().str().c_str());
|
||||
|
||||
@ -723,7 +723,7 @@ void test_polygon_7(void)
|
||||
Y_positions.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_1.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_1.points.size(); ++i)
|
||||
{
|
||||
string name = "t1_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -731,7 +731,7 @@ void test_polygon_7(void)
|
||||
T1_parameters.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_2.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_2.points.size(); ++i)
|
||||
{
|
||||
string name = "t2_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -790,9 +790,10 @@ void test_polygon_7(void)
|
||||
finish = clock();
|
||||
|
||||
double poly_1_pos_x, poly_1_pos_y, poly_2_pos_x, poly_2_pos_y;
|
||||
poly_1_pos_x = poly_1_pos_y = poly_2_pos_x = poly_2_pos_y = 0.0;
|
||||
|
||||
printf("Printing interpretation:\n");
|
||||
for (usingned int i = 0; i < z_model.size(); ++i)
|
||||
for (unsigned int i = 0; i < z_model.size(); ++i)
|
||||
{
|
||||
printf("Variable:%s ", z_model[i].name().str().c_str());
|
||||
|
||||
@ -874,7 +875,7 @@ Polygon scale_UP(const Polygon &polygon)
|
||||
{
|
||||
Polygon poly = polygon;
|
||||
|
||||
for (usingned int i = 0; i < poly.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < poly.points.size(); ++i)
|
||||
{
|
||||
poly.points[i] = Point(poly.points[i].x() * SCALE_FACTOR, poly.points[i].y() * SCALE_FACTOR);
|
||||
}
|
||||
@ -887,7 +888,7 @@ Polygon scale_UP(const Polygon &polygon, double x_pos, double y_pos)
|
||||
{
|
||||
Polygon poly = polygon;
|
||||
|
||||
for (usingned int i = 0; i < poly.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < poly.points.size(); ++i)
|
||||
{
|
||||
poly.points[i] = Point(poly.points[i].x() * SCALE_FACTOR + x_pos * SCALE_FACTOR, poly.points[i].y() * SCALE_FACTOR + y_pos * SCALE_FACTOR);
|
||||
}
|
||||
@ -931,7 +932,7 @@ void test_polygon_8(void)
|
||||
Y_positions.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_1.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_1.points.size(); ++i)
|
||||
{
|
||||
string name = "t1_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -939,7 +940,7 @@ void test_polygon_8(void)
|
||||
T1_parameters.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_2.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_2.points.size(); ++i)
|
||||
{
|
||||
string name = "t2_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -947,7 +948,7 @@ void test_polygon_8(void)
|
||||
T2_parameters.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_3.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_3.points.size(); ++i)
|
||||
{
|
||||
string name = "t3_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -1058,6 +1059,7 @@ void test_polygon_8(void)
|
||||
|
||||
int last_solvable_decision_box_size = -1;
|
||||
double poly_1_pos_x, poly_1_pos_y, poly_2_pos_x, poly_2_pos_y, poly_3_pos_x, poly_3_pos_y;
|
||||
poly_1_pos_x = poly_1_pos_y = poly_2_pos_x = poly_2_pos_y = poly_3_pos_x = poly_3_pos_y = 0.0;
|
||||
|
||||
for (int decision_box_size = 300; decision_box_size > 10; decision_box_size -= 4)
|
||||
{
|
||||
@ -1102,7 +1104,7 @@ void test_polygon_8(void)
|
||||
cout << z_model << "\n";
|
||||
|
||||
printf("Printing interpretation:\n");
|
||||
for (usingned int i = 0; i < z_model.size(); ++i)
|
||||
for (unsigned int i = 0; i < z_model.size(); ++i)
|
||||
{
|
||||
printf("Variable:%s ", z_model[i].name().str().c_str());
|
||||
|
||||
@ -1232,7 +1234,7 @@ void test_polygon_9(void)
|
||||
Y_positions.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_1.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_1.points.size(); ++i)
|
||||
{
|
||||
string name = "t1_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -1240,7 +1242,7 @@ void test_polygon_9(void)
|
||||
T1_parameters.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_2.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_2.points.size(); ++i)
|
||||
{
|
||||
string name = "t2_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -1248,7 +1250,7 @@ void test_polygon_9(void)
|
||||
T2_parameters.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_3.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_3.points.size(); ++i)
|
||||
{
|
||||
string name = "t3_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -1355,6 +1357,7 @@ void test_polygon_9(void)
|
||||
|
||||
int last_solvable_bounding_box_size = -1;
|
||||
double poly_1_pos_x, poly_1_pos_y, poly_2_pos_x, poly_2_pos_y, poly_3_pos_x, poly_3_pos_y;
|
||||
poly_1_pos_x = poly_1_pos_y = poly_2_pos_x = poly_2_pos_y = poly_3_pos_x = poly_3_pos_y = 0.0;
|
||||
|
||||
for (int bounding_box_size = 300; bounding_box_size > 10; bounding_box_size -= 4)
|
||||
{
|
||||
@ -1399,7 +1402,7 @@ void test_polygon_9(void)
|
||||
cout << z_model << "\n";
|
||||
|
||||
printf("Printing interpretation:\n");
|
||||
for (usingned int i = 0; i < z_model.size(); ++i)
|
||||
for (unsigned int i = 0; i < z_model.size(); ++i)
|
||||
{
|
||||
printf("Variable:%s ", z_model[i].name().str().c_str());
|
||||
|
||||
@ -1532,7 +1535,7 @@ void test_polygon_10(void)
|
||||
Y_positions.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_1.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_1.points.size(); ++i)
|
||||
{
|
||||
string name = "t1_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -1540,7 +1543,7 @@ void test_polygon_10(void)
|
||||
T1_parameters.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_2.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_2.points.size(); ++i)
|
||||
{
|
||||
string name = "t2_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -1548,7 +1551,7 @@ void test_polygon_10(void)
|
||||
T2_parameters.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_3.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_3.points.size(); ++i)
|
||||
{
|
||||
string name = "t3_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -1556,7 +1559,7 @@ void test_polygon_10(void)
|
||||
T3_parameters.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_4.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_4.points.size(); ++i)
|
||||
{
|
||||
string name = "t4_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -1672,6 +1675,7 @@ void test_polygon_10(void)
|
||||
|
||||
int last_solvable_bounding_box_size = -1;
|
||||
double poly_1_pos_x, poly_1_pos_y, poly_2_pos_x, poly_2_pos_y, poly_3_pos_x, poly_3_pos_y, poly_4_pos_x, poly_4_pos_y;
|
||||
poly_1_pos_x = poly_1_pos_y = poly_2_pos_x = poly_2_pos_y = poly_3_pos_x = poly_3_pos_y = poly_4_pos_x = poly_4_pos_y = 0.0;
|
||||
|
||||
for (int bounding_box_size = 300; bounding_box_size > 10; bounding_box_size -= 4)
|
||||
{
|
||||
@ -1718,7 +1722,7 @@ void test_polygon_10(void)
|
||||
cout << z_model << "\n";
|
||||
|
||||
printf("Printing interpretation:\n");
|
||||
for (usingned int i = 0; i < z_model.size(); ++i)
|
||||
for (unsigned int i = 0; i < z_model.size(); ++i)
|
||||
{
|
||||
printf("Variable:%s ", z_model[i].name().str().c_str());
|
||||
|
||||
@ -1866,7 +1870,7 @@ void test_polygon_11(void)
|
||||
Y_positions.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_1.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_1.points.size(); ++i)
|
||||
{
|
||||
string name = "t1_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -1874,7 +1878,7 @@ void test_polygon_11(void)
|
||||
T1_parameters.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_2.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_2.points.size(); ++i)
|
||||
{
|
||||
string name = "t2_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -1882,7 +1886,7 @@ void test_polygon_11(void)
|
||||
T2_parameters.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_3.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_3.points.size(); ++i)
|
||||
{
|
||||
string name = "t3_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -1890,7 +1894,7 @@ void test_polygon_11(void)
|
||||
T3_parameters.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (usingned int i = 0; i < polygon_4.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_4.points.size(); ++i)
|
||||
{
|
||||
string name = "t4_par-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -1999,6 +2003,7 @@ void test_polygon_11(void)
|
||||
|
||||
int last_solvable_bounding_box_size = -1;
|
||||
double poly_1_pos_x, poly_1_pos_y, poly_2_pos_x, poly_2_pos_y, poly_3_pos_x, poly_3_pos_y, poly_4_pos_x, poly_4_pos_y;
|
||||
poly_1_pos_x = poly_1_pos_y = poly_2_pos_x = poly_2_pos_y = poly_3_pos_x = poly_3_pos_y = poly_4_pos_x = poly_4_pos_y = 0.0;
|
||||
|
||||
for (int bounding_box_size = 200; bounding_box_size > 10; bounding_box_size -= 4)
|
||||
{
|
||||
@ -2045,7 +2050,7 @@ void test_polygon_11(void)
|
||||
cout << z_model << "\n";
|
||||
|
||||
printf("Printing interpretation:\n");
|
||||
for (usingned int i = 0; i < z_model.size(); ++i)
|
||||
for (unsigned int i = 0; i < z_model.size(); ++i)
|
||||
{
|
||||
printf("Variable:%s ", z_model[i].name().str().c_str());
|
||||
|
||||
@ -2153,7 +2158,7 @@ void test_polygon_11(void)
|
||||
printf("Printing model:\n");
|
||||
cout << z_model << "\n";
|
||||
|
||||
for (usingned int i = 0; i < z_model.size(); ++i)
|
||||
for (unsigned int i = 0; i < z_model.size(); ++i)
|
||||
{
|
||||
//printf("Variable:%s ", z_model[i].name().str().c_str());
|
||||
double value = z_model.get_const_interp(z_model[i]).as_double();
|
||||
@ -2329,14 +2334,14 @@ void test_polygon_12(void)
|
||||
if (optimized)
|
||||
{
|
||||
printf("Polygon positions:\n");
|
||||
for (usingned int i = 0; i < polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygons.size(); ++i)
|
||||
{
|
||||
printf(" %.3f, %.3f\n", X_values[i], Y_values[i]);
|
||||
}
|
||||
|
||||
SVG preview_svg("polygon_test_12.svg");
|
||||
|
||||
for (usingned int i = 0; i < polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygons.size(); ++i)
|
||||
{
|
||||
Polygon display_polygon = scale_UP(polygons[i], X_values[i], Y_values[i]);
|
||||
|
||||
@ -2455,14 +2460,14 @@ void test_polygon_13(void)
|
||||
if (optimized)
|
||||
{
|
||||
printf("Polygon positions:\n");
|
||||
for (usingned int i = 0; i < polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygons.size(); ++i)
|
||||
{
|
||||
printf(" %.3f, %.3f\n", X_values[i], Y_values[i]);
|
||||
}
|
||||
|
||||
SVG preview_svg("polygon_test_13.svg");
|
||||
|
||||
for (usingned int i = 0; i < polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygons.size(); ++i)
|
||||
{
|
||||
Polygon display_polygon = scale_UP(polygons[i], X_values[i], Y_values[i]);
|
||||
|
||||
@ -2633,7 +2638,7 @@ void test_polygon_14(void)
|
||||
dec_var_names_map,
|
||||
polygons);
|
||||
|
||||
for (usingned int i = 0; i < undecided.size(); ++i)
|
||||
for (unsigned int i = 0; i < undecided.size(); ++i)
|
||||
{
|
||||
poly_positions_X[undecided[i]] = X_values[undecided[i]];
|
||||
poly_positions_Y[undecided[i]] = Y_values[undecided[i]];
|
||||
@ -2662,7 +2667,7 @@ void test_polygon_14(void)
|
||||
decided.push_back(2);
|
||||
decided.push_back(3);
|
||||
|
||||
for (usingned int i = 0; i < decided.size(); ++i)
|
||||
for (unsigned int i = 0; i < decided.size(); ++i)
|
||||
{
|
||||
X_values[decided[i]] = poly_positions_X[decided[i]];
|
||||
Y_values[decided[i]] = poly_positions_Y[decided[i]];
|
||||
@ -2708,14 +2713,14 @@ void test_polygon_14(void)
|
||||
if (optimized)
|
||||
{
|
||||
printf("Polygon positions:\n");
|
||||
for (usingned int i = 0; i < decided.size(); ++i)
|
||||
for (unsigned int i = 0; i < decided.size(); ++i)
|
||||
{
|
||||
printf(" %.3f, %.3f\n", X_values[decided[i]].as_double(), Y_values[decided[i]].as_double());
|
||||
}
|
||||
|
||||
SVG preview_svg("polygon_test_14.svg");
|
||||
|
||||
for (usingned int i = 0; i < decided.size(); ++i)
|
||||
for (unsigned int i = 0; i < decided.size(); ++i)
|
||||
{
|
||||
Polygon display_polygon = scale_UP(polygons[decided[i]], X_values[decided[i]].as_double(), Y_values[decided[i]].as_double());
|
||||
|
||||
@ -2853,7 +2858,7 @@ void test_polygon_15(void)
|
||||
polygons.push_back(polygon_3);
|
||||
polygons.push_back(polygon_4);
|
||||
*/
|
||||
for (int index = 0; index < polygons.size(); ++index)
|
||||
for (unsigned int index = 0; index < polygons.size(); ++index)
|
||||
{
|
||||
polygon_index_map.push_back(index);
|
||||
}
|
||||
@ -2882,19 +2887,19 @@ void test_polygon_15(void)
|
||||
if (optimized)
|
||||
{
|
||||
printf("Polygon positions:\n");
|
||||
for (usingned int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
printf(" %.3f, %.3f\n", poly_positions_X[decided_polygons[i]].as_double(), poly_positions_Y[decided_polygons[i]].as_double());
|
||||
}
|
||||
printf("Remaining polygons: %ld\n", remaining_polygons.size());
|
||||
for (usingned int i = 0; i < remaining_polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < remaining_polygons.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", remaining_polygons[i]);
|
||||
}
|
||||
|
||||
SVG preview_svg("polygon_test_15.svg");
|
||||
|
||||
for (usingned int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
Polygon display_polygon = scale_UP(polygons[decided_polygons[i]],
|
||||
poly_positions_X[decided_polygons[i]].as_double(),
|
||||
@ -2983,7 +2988,7 @@ void test_polygon_15(void)
|
||||
|
||||
vector<Polygon> next_polygons;
|
||||
|
||||
for (usingned int i = 0; i < remaining_polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < remaining_polygons.size(); ++i)
|
||||
{
|
||||
next_polygons.push_back(polygons[remaining_polygons[i]]);
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ Polygon scale_UP(const Polygon &polygon)
|
||||
{
|
||||
Polygon poly = polygon;
|
||||
|
||||
for (unsigned int i = 0; i < poly.points.size(); ++i)
|
||||
for (int i = 0; i < poly.points.size(); ++i)
|
||||
{
|
||||
poly.points[i] = Point(poly.points[i].x() * SCALE_FACTOR, poly.points[i].y() * SCALE_FACTOR);
|
||||
}
|
||||
@ -64,7 +64,7 @@ Polygon scale_UP(const Polygon &polygon, double x_pos, double y_pos)
|
||||
{
|
||||
Polygon poly = polygon;
|
||||
|
||||
for (unsigned int i = 0; i < poly.points.size(); ++i)
|
||||
for (int i = 0; i < poly.points.size(); ++i)
|
||||
{
|
||||
poly.points[i] = Point(poly.points[i].x() * SCALE_FACTOR + x_pos * SCALE_FACTOR,
|
||||
poly.points[i].y() * SCALE_FACTOR + y_pos * SCALE_FACTOR);
|
||||
@ -85,14 +85,14 @@ void test_preprocess_1(void)
|
||||
SolverConfiguration solver_configuration;
|
||||
|
||||
start = clock();
|
||||
for (unsigned int i = 0; i < PRUSA_PART_POLYGONS.size(); ++i)
|
||||
for (int i = 0; i < PRUSA_PART_POLYGONS.size(); ++i)
|
||||
{
|
||||
Polygon scale_down_polygon;
|
||||
scaleDown_PolygonForSequentialSolver(PRUSA_PART_POLYGONS[i], scale_down_polygon);
|
||||
test_polygons.push_back(scale_down_polygon);
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < test_polygons.size(); ++i)
|
||||
for (int i = 0; i < test_polygons.size(); ++i)
|
||||
{
|
||||
SVG preview_svg("preprocess_test_1.svg");
|
||||
Polygon display_polygon = scale_UP(test_polygons[i], 1000, 1000);
|
||||
@ -122,7 +122,7 @@ void test_preprocess_2(void)
|
||||
vector<Polygon> polygons;
|
||||
vector<Polygon> unreachable_polygons;
|
||||
|
||||
for (unsigned int i = 0; i < PRUSA_PART_POLYGONS.size(); ++i)
|
||||
for (int i = 0; i < PRUSA_PART_POLYGONS.size(); ++i)
|
||||
{
|
||||
Polygon scale_down_polygon;
|
||||
scaleDown_PolygonForSequentialSolver(PRUSA_PART_POLYGONS[i], scale_down_polygon);
|
||||
@ -164,12 +164,12 @@ void test_preprocess_2(void)
|
||||
if (optimized)
|
||||
{
|
||||
printf("Polygon positions:\n");
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
printf(" [%d] %.3f, %.3f (%.3f)\n", decided_polygons[i], poly_positions_X[decided_polygons[i]].as_double(), poly_positions_Y[decided_polygons[i]].as_double(), times_T[decided_polygons[i]].as_double());
|
||||
}
|
||||
printf("Remaining polygons: %ld\n", remaining_polygons.size());
|
||||
for (unsigned int i = 0; i < remaining_polygons.size(); ++i)
|
||||
for (int i = 0; i < remaining_polygons.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", remaining_polygons[i]);
|
||||
}
|
||||
@ -178,7 +178,7 @@ void test_preprocess_2(void)
|
||||
|
||||
if (!unreachable_polygons.empty())
|
||||
{
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
/*
|
||||
printf("----> %.3f,%.3f\n", poly_positions_X[decided_polygons[i]].as_double(), poly_positions_Y[decided_polygons[i]].as_double());
|
||||
@ -203,7 +203,7 @@ void test_preprocess_2(void)
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
Polygon display_polygon = scale_UP(polygons[decided_polygons[i]],
|
||||
poly_positions_X[decided_polygons[i]].as_double(),
|
||||
@ -295,11 +295,11 @@ void test_preprocess_2(void)
|
||||
vector<Polygon> next_polygons;
|
||||
vector<Polygon> next_unreachable_polygons;
|
||||
|
||||
for (unsigned int i = 0; i < polygon_index_map.size(); ++i)
|
||||
for (int i = 0; i < polygon_index_map.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", polygon_index_map[i]);
|
||||
}
|
||||
for (unsigned int i = 0; i < remaining_polygons.size(); ++i)
|
||||
for (int i = 0; i < remaining_polygons.size(); ++i)
|
||||
{
|
||||
next_polygons.push_back(polygons[remaining_polygons[i]]);
|
||||
next_unreachable_polygons.push_back(unreachable_polygons[remaining_polygons[i]]);
|
||||
@ -663,12 +663,12 @@ void test_preprocess_4(void)
|
||||
if (optimized)
|
||||
{
|
||||
printf("Polygon positions:\n");
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
printf(" [%d] %.3f, %.3f (%.3f)\n", decided_polygons[i], poly_positions_X[decided_polygons[i]].as_double(), poly_positions_Y[decided_polygons[i]].as_double(), times_T[decided_polygons[i]].as_double());
|
||||
}
|
||||
printf("Remaining polygons: %ld\n", remaining_polygons.size());
|
||||
for (unsigned int i = 0; i < remaining_polygons.size(); ++i)
|
||||
for (int i = 0; i < remaining_polygons.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", remaining_polygons[i]);
|
||||
}
|
||||
@ -677,7 +677,7 @@ void test_preprocess_4(void)
|
||||
|
||||
if (!unreachable_polygons.empty())
|
||||
{
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
/*
|
||||
printf("----> %.3f,%.3f\n", poly_positions_X[decided_polygons[i]].as_double(), poly_positions_Y[decided_polygons[i]].as_double());
|
||||
@ -702,7 +702,7 @@ void test_preprocess_4(void)
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
Polygon display_polygon = scale_UP(polygons[decided_polygons[i]],
|
||||
poly_positions_X[decided_polygons[i]].as_double(),
|
||||
@ -794,11 +794,11 @@ void test_preprocess_4(void)
|
||||
vector<Polygon> next_polygons;
|
||||
vector<vector<Polygon> > next_unreachable_polygons;
|
||||
|
||||
for (unsigned int i = 0; i < polygon_index_map.size(); ++i)
|
||||
for (int i = 0; i < polygon_index_map.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", polygon_index_map[i]);
|
||||
}
|
||||
for (unsigned int i = 0; i < remaining_polygons.size(); ++i)
|
||||
for (int i = 0; i < remaining_polygons.size(); ++i)
|
||||
{
|
||||
next_polygons.push_back(polygons[remaining_polygons[i]]);
|
||||
next_unreachable_polygons.push_back(unreachable_polygons[remaining_polygons[i]]);
|
||||
@ -838,7 +838,7 @@ void test_preprocess_5(void)
|
||||
std::vector<Slic3r::Polygon> polygons;
|
||||
std::vector<std::vector<Slic3r::Polygon> > unreachable_polygons;
|
||||
|
||||
for (unsigned int i = 0; i < PRUSA_PART_POLYGONS.size(); ++i)
|
||||
for (int i = 0; i < PRUSA_PART_POLYGONS.size(); ++i)
|
||||
{
|
||||
Polygon simplified_polygon;
|
||||
|
||||
@ -896,7 +896,7 @@ void test_preprocess_6(void)
|
||||
|
||||
std::vector<Slic3r::Polygon> polygons;
|
||||
std::vector<std::vector<Slic3r::Polygon> > unreachable_polygons;
|
||||
for (unsigned int i = 0; i < PRUSA_PART_POLYGONS.size(); ++i)
|
||||
for (int i = 0; i < PRUSA_PART_POLYGONS.size(); ++i)
|
||||
{
|
||||
Polygon decimated_polygon;
|
||||
decimate_PolygonForSequentialSolver(solver_configuration,
|
||||
@ -958,12 +958,12 @@ void test_preprocess_6(void)
|
||||
if (optimized)
|
||||
{
|
||||
printf("Polygon positions:\n");
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
printf(" [%d] %.3f, %.3f (%.3f)\n", decided_polygons[i], poly_positions_X[decided_polygons[i]].as_double(), poly_positions_Y[decided_polygons[i]].as_double(), times_T[decided_polygons[i]].as_double());
|
||||
}
|
||||
printf("Remaining polygons: %ld\n", remaining_polygons.size());
|
||||
for (unsigned int i = 0; i < remaining_polygons.size(); ++i)
|
||||
for (int i = 0; i < remaining_polygons.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", remaining_polygons[i]);
|
||||
}
|
||||
@ -972,7 +972,7 @@ void test_preprocess_6(void)
|
||||
|
||||
if (!unreachable_polygons.empty())
|
||||
{
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
/*
|
||||
printf("----> %.3f,%.3f\n", poly_positions_X[decided_polygons[i]].as_double(), poly_positions_Y[decided_polygons[i]].as_double());
|
||||
@ -997,7 +997,7 @@ void test_preprocess_6(void)
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
Polygon display_polygon = scale_UP(polygons[decided_polygons[i]],
|
||||
poly_positions_X[decided_polygons[i]].as_double(),
|
||||
@ -1089,11 +1089,11 @@ void test_preprocess_6(void)
|
||||
vector<Polygon> next_polygons;
|
||||
vector<vector<Polygon> > next_unreachable_polygons;
|
||||
|
||||
for (unsigned int i = 0; i < polygon_index_map.size(); ++i)
|
||||
for (int i = 0; i < polygon_index_map.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", polygon_index_map[i]);
|
||||
}
|
||||
for (unsigned int i = 0; i < remaining_polygons.size(); ++i)
|
||||
for (int i = 0; i < remaining_polygons.size(); ++i)
|
||||
{
|
||||
next_polygons.push_back(polygons[remaining_polygons[i]]);
|
||||
next_unreachable_polygons.push_back(unreachable_polygons[remaining_polygons[i]]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user