mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 23:39:01 +08:00
Code polishing, eliminating obsolete parts of the interface, and warning elimination.
This commit is contained in:
parent
a2dd47cec7
commit
91a12c4b7c
@ -41,22 +41,14 @@ struct PrinterGeometry
|
||||
std::set<coord_t> box_heights;
|
||||
|
||||
std::map<coord_t, std::vector<Slic3r::Polygon> > extruder_slices;
|
||||
|
||||
int convert_Geometry2PlateBoundingBoxSize(void) const;
|
||||
void convert_Geometry2PlateBoundingBoxSize(int &X_bounding_box_size, int &Y_bounding_box_size) const;
|
||||
};
|
||||
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
|
||||
// Setting printer type is obsolete, will be removed
|
||||
enum PrinterType
|
||||
{
|
||||
SEQ_PRINTER_TYPE_UNDEFINED,
|
||||
SEQ_PRINTER_TYPE_PRUSA_MINI,
|
||||
SEQ_PRINTER_TYPE_PRUSA_MK3S,
|
||||
SEQ_PRINTER_TYPE_PRUSA_MK4,
|
||||
SEQ_PRINTER_TYPE_PRUSA_XL,
|
||||
};
|
||||
|
||||
|
||||
enum DecimationPrecision
|
||||
{
|
||||
SEQ_DECIMATION_PRECISION_UNDEFINED,
|
||||
@ -72,27 +64,22 @@ struct SolverConfiguration
|
||||
SolverConfiguration();
|
||||
SolverConfiguration(const PrinterGeometry &printer_geometry);
|
||||
|
||||
static double convert_DecimationPrecision2Tolerance(DecimationPrecision decimation_precision);
|
||||
void setup(const PrinterGeometry &printer_geometry);
|
||||
|
||||
void set_DecimationPrecision(DecimationPrecision decimation_precision);
|
||||
void set_ObjectGroupSize(int object_group_size);
|
||||
|
||||
void setup(const PrinterGeometry &printer_geometry);
|
||||
|
||||
static double convert_DecimationPrecision2Tolerance(DecimationPrecision decimation_precision);
|
||||
|
||||
int bounding_box_size_optimization_step;
|
||||
int minimum_X_bounding_box_size;
|
||||
int minimum_Y_bounding_box_size;
|
||||
int maximum_X_bounding_box_size;
|
||||
int maximum_Y_bounding_box_size;
|
||||
int minimum_bounding_box_size;
|
||||
int maximum_bounding_box_size;
|
||||
int x_plate_bounding_box_size;
|
||||
int y_plate_bounding_box_size;
|
||||
|
||||
int object_group_size;
|
||||
int temporal_spread;
|
||||
|
||||
DecimationPrecision decimation_precision;
|
||||
|
||||
// Setting printer type is obsolete, will be removed
|
||||
PrinterType printer_type;
|
||||
|
||||
DecimationPrecision decimation_precision;
|
||||
std::string optimization_timeout;
|
||||
};
|
||||
|
||||
|
@ -26,9 +26,24 @@ namespace Sequential
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
|
||||
const int SEQ_OBJECT_GROUP_SIZE = 4;
|
||||
const int SEQ_SCHEDULING_TEMPORAL_SPREAD = 16;
|
||||
const int SEQ_MINIMUM_BOUNDING_BOX_SIZE = 10;
|
||||
const int SEQ_OBJECT_GROUP_SIZE = 4;
|
||||
const int SEQ_SCHEDULING_TEMPORAL_SPREAD = 16;
|
||||
|
||||
const int SEQ_BOUNDING_BOX_SIZE_OPTIMIZATION_STEP = 4;
|
||||
const int SEQ_MINIMUM_BOUNDING_BOX_SIZE = 16;
|
||||
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
|
||||
enum PrinterType
|
||||
{
|
||||
SEQ_PRINTER_TYPE_UNDEFINED,
|
||||
SEQ_PRINTER_TYPE_PRUSA_MINI,
|
||||
SEQ_PRINTER_TYPE_PRUSA_MK3S,
|
||||
SEQ_PRINTER_TYPE_PRUSA_MK4,
|
||||
SEQ_PRINTER_TYPE_PRUSA_XL
|
||||
};
|
||||
|
||||
|
||||
const int SEQ_PRUSA_MK3S_X_SIZE = 2500;
|
||||
const int SEQ_PRUSA_MK3S_Y_SIZE = 2100;
|
||||
@ -41,7 +56,6 @@ const coord_t SEQ_PRUSA_MK3S_GANTRY_LEVEL = 26000000;
|
||||
const int SEQ_PRUSA_MK4_X_SIZE = 2500;
|
||||
const int SEQ_PRUSA_MK4_Y_SIZE = 2100;
|
||||
|
||||
// TODO: measure for true values
|
||||
const coord_t SEQ_PRUSA_MK4_NOZZLE_LEVEL = 0;
|
||||
const coord_t SEQ_PRUSA_MK4_EXTRUDER_LEVEL = 2000000;
|
||||
const coord_t SEQ_PRUSA_MK4_HOSE_LEVEL = 18000000;
|
||||
@ -50,48 +64,52 @@ const coord_t SEQ_PRUSA_MK4_GANTRY_LEVEL = 26000000;
|
||||
const int SEQ_PRUSA_XL_X_SIZE = 3600;
|
||||
const int SEQ_PRUSA_XL_Y_SIZE = 3600;
|
||||
|
||||
// TODO: measure for true values
|
||||
const coord_t SEQ_PRUSA_XL_NOZZLE_LEVEL = 0;
|
||||
const coord_t SEQ_PRUSA_XL_EXTRUDER_LEVEL = 2000000;
|
||||
const coord_t SEQ_PRUSA_XL_HOSE_LEVEL = 18000000;
|
||||
const coord_t SEQ_PRUSA_XL_GANTRY_LEVEL = 26000000;
|
||||
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
|
||||
int PrinterGeometry::convert_Geometry2PlateBoundingBoxSize(void) const
|
||||
{
|
||||
return MAX(x_size / SEQ_SLICER_SCALE_FACTOR, y_size / SEQ_SLICER_SCALE_FACTOR);
|
||||
}
|
||||
|
||||
|
||||
void PrinterGeometry::convert_Geometry2PlateBoundingBoxSize(int &x_plate_bounding_box_size, int &y_plate_bounding_box_size) const
|
||||
{
|
||||
x_plate_bounding_box_size = x_size / SEQ_SLICER_SCALE_FACTOR;
|
||||
y_plate_bounding_box_size = y_size / SEQ_SLICER_SCALE_FACTOR;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
|
||||
SolverConfiguration::SolverConfiguration()
|
||||
: bounding_box_size_optimization_step(4)
|
||||
, minimum_X_bounding_box_size(SEQ_MINIMUM_BOUNDING_BOX_SIZE)
|
||||
, minimum_Y_bounding_box_size(SEQ_MINIMUM_BOUNDING_BOX_SIZE)
|
||||
, maximum_X_bounding_box_size(SEQ_PRUSA_MK3S_X_SIZE)
|
||||
, maximum_Y_bounding_box_size(SEQ_PRUSA_MK3S_Y_SIZE)
|
||||
, minimum_bounding_box_size(MIN(minimum_X_bounding_box_size, minimum_Y_bounding_box_size))
|
||||
, maximum_bounding_box_size(MAX(maximum_X_bounding_box_size, maximum_Y_bounding_box_size))
|
||||
: bounding_box_size_optimization_step(SEQ_BOUNDING_BOX_SIZE_OPTIMIZATION_STEP)
|
||||
, minimum_bounding_box_size(SEQ_MINIMUM_BOUNDING_BOX_SIZE)
|
||||
, x_plate_bounding_box_size(SEQ_PRUSA_MK3S_X_SIZE)
|
||||
, y_plate_bounding_box_size(SEQ_PRUSA_MK3S_Y_SIZE)
|
||||
, object_group_size(SEQ_OBJECT_GROUP_SIZE)
|
||||
, temporal_spread(SEQ_SCHEDULING_TEMPORAL_SPREAD)
|
||||
, decimation_precision(SEQ_DECIMATION_PRECISION_LOW)
|
||||
, printer_type(SEQ_PRINTER_TYPE_PRUSA_MK3S)
|
||||
, optimization_timeout(SEQ_Z3_SOLVER_TIMEOUT)
|
||||
{
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
|
||||
|
||||
SolverConfiguration::SolverConfiguration(const PrinterGeometry &printer_geometry)
|
||||
: bounding_box_size_optimization_step(4)
|
||||
, minimum_X_bounding_box_size(SEQ_MINIMUM_BOUNDING_BOX_SIZE)
|
||||
, minimum_Y_bounding_box_size(SEQ_MINIMUM_BOUNDING_BOX_SIZE)
|
||||
, maximum_X_bounding_box_size(printer_geometry.x_size / SEQ_SLICER_SCALE_FACTOR)
|
||||
, maximum_Y_bounding_box_size(printer_geometry.y_size / SEQ_SLICER_SCALE_FACTOR)
|
||||
, minimum_bounding_box_size(MIN(minimum_X_bounding_box_size, minimum_Y_bounding_box_size))
|
||||
, maximum_bounding_box_size(MAX(maximum_X_bounding_box_size, maximum_Y_bounding_box_size))
|
||||
: bounding_box_size_optimization_step(SEQ_BOUNDING_BOX_SIZE_OPTIMIZATION_STEP)
|
||||
, minimum_bounding_box_size(SEQ_MINIMUM_BOUNDING_BOX_SIZE)
|
||||
, object_group_size(SEQ_OBJECT_GROUP_SIZE)
|
||||
, temporal_spread(SEQ_SCHEDULING_TEMPORAL_SPREAD)
|
||||
, decimation_precision(SEQ_DECIMATION_PRECISION_LOW)
|
||||
, printer_type(SEQ_PRINTER_TYPE_PRUSA_MK3S)
|
||||
, optimization_timeout(SEQ_Z3_SOLVER_TIMEOUT)
|
||||
{
|
||||
/* nothing */
|
||||
setup(printer_geometry);
|
||||
}
|
||||
|
||||
|
||||
@ -122,13 +140,10 @@ double SolverConfiguration::convert_DecimationPrecision2Tolerance(DecimationPrec
|
||||
return SEQ_DECIMATION_TOLERANCE_VALUE_UNDEFINED;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SolverConfiguration::setup(const PrinterGeometry &printer_geometry)
|
||||
{
|
||||
maximum_X_bounding_box_size = printer_geometry.x_size / SEQ_SLICER_SCALE_FACTOR;
|
||||
maximum_Y_bounding_box_size = printer_geometry.y_size / SEQ_SLICER_SCALE_FACTOR;
|
||||
minimum_bounding_box_size = MIN(minimum_X_bounding_box_size, minimum_Y_bounding_box_size);
|
||||
maximum_bounding_box_size = MAX(maximum_X_bounding_box_size, maximum_Y_bounding_box_size);
|
||||
printer_geometry.convert_Geometry2PlateBoundingBoxSize(x_plate_bounding_box_size, y_plate_bounding_box_size);
|
||||
}
|
||||
|
||||
|
||||
@ -523,6 +538,8 @@ int schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver_
|
||||
}
|
||||
#endif
|
||||
|
||||
PrinterType printer_type = SEQ_PRINTER_TYPE_PRUSA_MK3S;
|
||||
|
||||
std::vector<Slic3r::Polygon> polygons;
|
||||
std::vector<std::vector<Slic3r::Polygon> > unreachable_polygons;
|
||||
|
||||
@ -573,7 +590,7 @@ int schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver_
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch (solver_configuration.printer_type)
|
||||
switch (printer_type)
|
||||
{
|
||||
case SEQ_PRINTER_TYPE_PRUSA_MK3S:
|
||||
{
|
||||
@ -693,7 +710,7 @@ int schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver_
|
||||
|
||||
std::vector<Slic3r::Polygon> scale_down_unreachable_polygons;
|
||||
|
||||
switch (solver_configuration.printer_type)
|
||||
switch (printer_type)
|
||||
{
|
||||
case SEQ_PRINTER_TYPE_PRUSA_MK3S:
|
||||
{
|
||||
@ -900,11 +917,13 @@ int schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver_
|
||||
}
|
||||
|
||||
|
||||
void setup_ExtruderUnreachableZones(const SolverConfiguration &solver_configuration,
|
||||
void setup_ExtruderUnreachableZones(const SolverConfiguration &solver_configuration,
|
||||
std::vector<std::vector<Slic3r::Polygon> > &convex_unreachable_zones,
|
||||
std::vector<std::vector<Slic3r::Polygon> > &box_unreachable_zones)
|
||||
{
|
||||
switch (solver_configuration.printer_type)
|
||||
PrinterType printer_type = SEQ_PRINTER_TYPE_PRUSA_MK3S;
|
||||
|
||||
switch (printer_type)
|
||||
{
|
||||
case SEQ_PRINTER_TYPE_PRUSA_MK3S:
|
||||
{
|
||||
|
@ -523,7 +523,7 @@ Polygon transform_UpsideDown(const SolverConfiguration &solver_configuration, co
|
||||
for (unsigned int i = 0; i < poly.points.size(); ++i)
|
||||
{
|
||||
poly.points[i] = Point(poly.points[i].x(),
|
||||
(coord_t)(solver_configuration.maximum_Y_bounding_box_size * scale_factor - poly.points[i].y()));
|
||||
(coord_t)(solver_configuration.y_plate_bounding_box_size * scale_factor - poly.points[i].y()));
|
||||
}
|
||||
|
||||
return poly;
|
||||
@ -539,7 +539,7 @@ void transform_UpsideDown(const SolverConfiguration &solver_configuration, const
|
||||
void transform_UpsideDown(const SolverConfiguration &solver_configuration, coord_t scale_factor, const coord_t &scaled_x_pos, const coord_t &scaled_y_pos, coord_t &transformed_x_pos, coord_t &transformed_y_pos)
|
||||
{
|
||||
transformed_x_pos = scaled_x_pos;
|
||||
transformed_y_pos = solver_configuration.maximum_Y_bounding_box_size * scale_factor - scaled_y_pos;
|
||||
transformed_y_pos = solver_configuration.y_plate_bounding_box_size * scale_factor - scaled_y_pos;
|
||||
}
|
||||
|
||||
|
||||
@ -854,13 +854,13 @@ bool check_PolygonSize(const SolverConfiguration &solver_configuration, const Sl
|
||||
BoundingBox polygon_box = get_extents(polygon);
|
||||
|
||||
coord_t x_size = polygon_box.max.x() - polygon_box.min.x();
|
||||
if (x_size > solver_configuration.maximum_X_bounding_box_size)
|
||||
if (x_size > solver_configuration.x_plate_bounding_box_size)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
coord_t y_size = polygon_box.max.y() - polygon_box.min.y();
|
||||
if (y_size > solver_configuration.maximum_Y_bounding_box_size)
|
||||
if (y_size > solver_configuration.y_plate_bounding_box_size)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -874,13 +874,13 @@ bool check_PolygonSize(const SolverConfiguration &solver_configuration, coord_t
|
||||
BoundingBox polygon_box = get_extents(polygon);
|
||||
|
||||
coord_t x_size = polygon_box.max.x() - polygon_box.min.x();
|
||||
if (x_size > solver_configuration.maximum_X_bounding_box_size * scale_factor)
|
||||
if (x_size > solver_configuration.x_plate_bounding_box_size * scale_factor)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
coord_t y_size = polygon_box.max.y() - polygon_box.min.y();
|
||||
if (y_size > solver_configuration.maximum_Y_bounding_box_size * scale_factor)
|
||||
if (y_size > solver_configuration.y_plate_bounding_box_size * scale_factor)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -6814,9 +6814,10 @@ bool optimize_WeakPolygonNonoverlapping(z3::solver &Solv
|
||||
z3::set_param("timeout", solver_configuration.optimization_timeout.c_str());
|
||||
|
||||
int last_solvable_bounding_box_size = -1;
|
||||
|
||||
int maximum_bounding_box_size = MAX(solver_configuration.x_plate_bounding_box_size, solver_configuration.y_plate_bounding_box_size);
|
||||
|
||||
for (int bounding_box_size = solver_configuration.maximum_bounding_box_size;
|
||||
bounding_box_size > solver_configuration.minimum_bounding_box_size;
|
||||
for (int bounding_box_size = maximum_bounding_box_size; bounding_box_size > solver_configuration.minimum_bounding_box_size;
|
||||
bounding_box_size -= solver_configuration.bounding_box_size_optimization_step)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
@ -6959,9 +6960,10 @@ bool optimize_WeakPolygonNonoverlapping(z3::solver &Solv
|
||||
{
|
||||
Z3_global_param_set("timeout", solver_configuration.optimization_timeout.c_str());
|
||||
int last_solvable_bounding_box_size = -1;
|
||||
|
||||
int maximum_bounding_box_size = MAX(solver_configuration.x_plate_bounding_box_size, solver_configuration.y_plate_bounding_box_size);
|
||||
|
||||
for (int bounding_box_size = solver_configuration.maximum_bounding_box_size;
|
||||
bounding_box_size > solver_configuration.minimum_bounding_box_size;
|
||||
for (int bounding_box_size = maximum_bounding_box_size; bounding_box_size > solver_configuration.minimum_bounding_box_size;
|
||||
bounding_box_size -= solver_configuration.bounding_box_size_optimization_step)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
@ -7107,9 +7109,10 @@ bool optimize_WeakPolygonNonoverlapping(z3::solver &Solv
|
||||
|
||||
z3::set_param("timeout", solver_configuration.optimization_timeout.c_str());
|
||||
int last_solvable_bounding_box_size = -1;
|
||||
|
||||
int maximum_bounding_box_size = MAX(solver_configuration.x_plate_bounding_box_size, solver_configuration.y_plate_bounding_box_size);
|
||||
|
||||
for (int bounding_box_size = solver_configuration.maximum_bounding_box_size;
|
||||
bounding_box_size > solver_configuration.minimum_bounding_box_size;
|
||||
for (int bounding_box_size = maximum_bounding_box_size; bounding_box_size > solver_configuration.minimum_bounding_box_size;
|
||||
bounding_box_size -= solver_configuration.bounding_box_size_optimization_step)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
@ -7256,9 +7259,10 @@ bool optimize_WeakPolygonNonoverlapping(z3::solver &Solv
|
||||
{
|
||||
z3::set_param("timeout", solver_configuration.optimization_timeout.c_str());
|
||||
int last_solvable_bounding_box_size = -1;
|
||||
|
||||
int maximum_bounding_box_size = MAX(solver_configuration.x_plate_bounding_box_size, solver_configuration.y_plate_bounding_box_size);
|
||||
|
||||
for (int bounding_box_size = solver_configuration.maximum_bounding_box_size;
|
||||
bounding_box_size > solver_configuration.minimum_bounding_box_size;
|
||||
for (int bounding_box_size = maximum_bounding_box_size; bounding_box_size > solver_configuration.minimum_bounding_box_size;
|
||||
bounding_box_size -= solver_configuration.bounding_box_size_optimization_step)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
@ -7408,12 +7412,13 @@ bool optimize_WeakPolygonNonoverlapping(z3::solver &Solv
|
||||
{
|
||||
z3::set_param("timeout", solver_configuration.optimization_timeout.c_str());
|
||||
int last_solvable_bounding_box_size = -1;
|
||||
|
||||
std::vector<Rational> local_dec_values_X = dec_values_X;
|
||||
std::vector<Rational> local_dec_values_Y = dec_values_Y;
|
||||
|
||||
for (int bounding_box_size = solver_configuration.maximum_bounding_box_size;
|
||||
bounding_box_size > solver_configuration.minimum_bounding_box_size;
|
||||
std::vector<Rational> local_dec_values_X = dec_values_X;
|
||||
std::vector<Rational> local_dec_values_Y = dec_values_Y;
|
||||
|
||||
int maximum_bounding_box_size = MAX(solver_configuration.x_plate_bounding_box_size, solver_configuration.y_plate_bounding_box_size);
|
||||
|
||||
for (int bounding_box_size = maximum_bounding_box_size; bounding_box_size > solver_configuration.minimum_bounding_box_size;
|
||||
bounding_box_size -= solver_configuration.bounding_box_size_optimization_step)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
@ -7611,17 +7616,17 @@ bool optimize_SequentialWeakPolygonNonoverlapping(z3::solver
|
||||
const std::vector<Slic3r::Polygon> &polygons,
|
||||
const std::vector<std::vector<Slic3r::Polygon> > &unreachable_polygons)
|
||||
{
|
||||
z3::set_param("timeout", solver_configuration.optimization_timeout.c_str());
|
||||
//z3::set_param("parallel.enable", "true");
|
||||
z3::set_param("timeout", solver_configuration.optimization_timeout.c_str());
|
||||
|
||||
int last_solvable_bounding_box_size = -1;
|
||||
|
||||
std::vector<Rational> local_dec_values_X = dec_values_X;
|
||||
std::vector<Rational> local_dec_values_Y = dec_values_Y;
|
||||
std::vector<Rational> local_dec_values_T = dec_values_T;
|
||||
std::vector<Rational> local_dec_values_T = dec_values_T;
|
||||
|
||||
int maximum_bounding_box_size = MAX(solver_configuration.x_plate_bounding_box_size, solver_configuration.y_plate_bounding_box_size);
|
||||
|
||||
for (int bounding_box_size = solver_configuration.maximum_bounding_box_size;
|
||||
bounding_box_size > solver_configuration.minimum_bounding_box_size;
|
||||
for (int bounding_box_size = maximum_bounding_box_size; bounding_box_size > solver_configuration.minimum_bounding_box_size;
|
||||
bounding_box_size -= solver_configuration.bounding_box_size_optimization_step)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
@ -7630,8 +7635,6 @@ bool optimize_SequentialWeakPolygonNonoverlapping(z3::solver
|
||||
}
|
||||
#endif
|
||||
|
||||
//Solver.reset();
|
||||
|
||||
z3::expr_vector bounding_box_assumptions(Context);
|
||||
|
||||
for (unsigned int i = 0; i < undecided.size(); ++i)
|
||||
@ -7641,8 +7644,6 @@ bool optimize_SequentialWeakPolygonNonoverlapping(z3::solver
|
||||
|
||||
bool sat = false;
|
||||
|
||||
// Solver.add(bounding_box_assumptions);
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
printf("Solving 11 ...\n");
|
||||
@ -7862,12 +7863,12 @@ bool optimize_SequentialWeakPolygonNonoverlappingCentered(z3::solver
|
||||
|
||||
std::vector<Rational> local_dec_values_X = dec_values_X;
|
||||
std::vector<Rational> local_dec_values_Y = dec_values_Y;
|
||||
std::vector<Rational> local_dec_values_T = dec_values_T;
|
||||
std::vector<Rational> local_dec_values_T = dec_values_T;
|
||||
|
||||
int box_min_x = 0;
|
||||
int box_max_x = solver_configuration.maximum_X_bounding_box_size;
|
||||
int box_max_x = solver_configuration.x_plate_bounding_box_size;
|
||||
int box_min_y = 0;
|
||||
int box_max_y = solver_configuration.maximum_Y_bounding_box_size;
|
||||
int box_max_y = solver_configuration.y_plate_bounding_box_size;
|
||||
|
||||
while (box_min_x < box_max_x && box_min_y < box_max_y)
|
||||
{
|
||||
@ -8230,10 +8231,10 @@ bool optimize_SequentialWeakPolygonNonoverlappingBinaryCentered(z3::solver
|
||||
std::vector<Rational> local_dec_values_T = dec_values_T;
|
||||
|
||||
coord_t half_x_min = 0;
|
||||
coord_t half_x_max = box_half_x_max; //solver_configuration.maximum_X_bounding_box_size / 2;
|
||||
coord_t half_x_max = box_half_x_max;
|
||||
|
||||
coord_t half_y_min = 0;
|
||||
coord_t half_y_max = box_half_y_max; //solver_configuration.maximum_Y_bounding_box_size / 2;
|
||||
coord_t half_y_max = box_half_y_max;
|
||||
|
||||
while ((half_x_max - half_x_min) > 1 && (half_y_max - half_y_min) > 1)
|
||||
{
|
||||
@ -8248,9 +8249,9 @@ bool optimize_SequentialWeakPolygonNonoverlappingBinaryCentered(z3::solver
|
||||
z3::expr_vector bounding_box_assumptions(Context);
|
||||
|
||||
coord_t box_min_x = (half_x_max + half_x_min) / 2;
|
||||
coord_t box_max_x = solver_configuration.maximum_X_bounding_box_size - box_min_x;
|
||||
coord_t box_max_x = solver_configuration.x_plate_bounding_box_size - box_min_x;
|
||||
coord_t box_min_y = (half_y_max + half_y_min) / 2;
|
||||
coord_t box_max_y = solver_configuration.maximum_Y_bounding_box_size - box_min_y;
|
||||
coord_t box_max_y = solver_configuration.y_plate_bounding_box_size - box_min_y;
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
@ -8565,13 +8566,13 @@ bool optimize_ConsequentialWeakPolygonNonoverlappingBinaryCentered(z3::solver
|
||||
|
||||
std::vector<Rational> local_dec_values_X = dec_values_X;
|
||||
std::vector<Rational> local_dec_values_Y = dec_values_Y;
|
||||
std::vector<Rational> local_dec_values_T = dec_values_T;
|
||||
std::vector<Rational> local_dec_values_T = dec_values_T;
|
||||
|
||||
coord_t half_x_min = 0;
|
||||
coord_t half_x_max = box_half_x_max; //solver_configuration.maximum_X_bounding_box_size / 2;
|
||||
coord_t half_x_max = box_half_x_max;
|
||||
|
||||
coord_t half_y_min = 0;
|
||||
coord_t half_y_max = box_half_y_max; //solver_configuration.maximum_Y_bounding_box_size / 2;
|
||||
coord_t half_y_max = box_half_y_max;
|
||||
|
||||
while ((half_x_max - half_x_min) > 1 && (half_y_max - half_y_min) > 1)
|
||||
{
|
||||
@ -8586,9 +8587,9 @@ bool optimize_ConsequentialWeakPolygonNonoverlappingBinaryCentered(z3::solver
|
||||
z3::expr_vector bounding_box_assumptions(Context);
|
||||
|
||||
coord_t box_min_x = (half_x_max + half_x_min) / 2;
|
||||
coord_t box_max_x = solver_configuration.maximum_X_bounding_box_size - box_min_x;
|
||||
coord_t box_max_x = solver_configuration.x_plate_bounding_box_size - box_min_x;
|
||||
coord_t box_min_y = (half_y_max + half_y_min) / 2;
|
||||
coord_t box_max_y = solver_configuration.maximum_Y_bounding_box_size - box_min_y;
|
||||
coord_t box_max_y = solver_configuration.y_plate_bounding_box_size - box_min_y;
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
@ -9199,9 +9200,6 @@ bool optimize_SubglobalSequentialPolygonNonoverlapping(const SolverConfiguration
|
||||
for(int object_group_size = MIN((unsigned int)solver_configuration.object_group_size, polygons.size() - curr_polygon); object_group_size > 0; --object_group_size)
|
||||
{
|
||||
z3::set_param("timeout", solver_configuration.optimization_timeout.c_str());
|
||||
//z3::set_param("parallel.enable", "true");
|
||||
//z3::set_param("smt.threads", "8");
|
||||
//z3::set_param("parallel.threads.max", "16");
|
||||
|
||||
z3::context z_context;
|
||||
z3::solver z_solver(z_context);
|
||||
@ -9452,9 +9450,6 @@ bool optimize_SubglobalSequentialPolygonNonoverlappingCentered(const SolverConfi
|
||||
for(int object_group_size = MIN((unsigned int)solver_configuration.object_group_size, polygons.size() - curr_polygon); object_group_size > 0; --object_group_size)
|
||||
{
|
||||
z3::set_param("timeout", solver_configuration.optimization_timeout.c_str());
|
||||
//z3::set_param("parallel.enable", "true");
|
||||
//z3::set_param("smt.threads", "8");
|
||||
//z3::set_param("parallel.threads.max", "16");
|
||||
|
||||
z3::context z_context;
|
||||
z3::solver z_solver(z_context);
|
||||
@ -9697,8 +9692,8 @@ bool optimize_SubglobalSequentialPolygonNonoverlappingBinaryCentered(const Solve
|
||||
dec_values_Y.resize(polygons.size());
|
||||
dec_values_T.resize(polygons.size());
|
||||
|
||||
coord_t box_half_x_max = solver_configuration.maximum_X_bounding_box_size / 2;
|
||||
coord_t box_half_y_max = solver_configuration.maximum_Y_bounding_box_size / 2;
|
||||
coord_t box_half_x_max = solver_configuration.x_plate_bounding_box_size / 2;
|
||||
coord_t box_half_y_max = solver_configuration.y_plate_bounding_box_size / 2;
|
||||
|
||||
for (unsigned int curr_polygon = 0; curr_polygon < polygons.size(); /* nothing */)
|
||||
{
|
||||
@ -9708,9 +9703,6 @@ bool optimize_SubglobalSequentialPolygonNonoverlappingBinaryCentered(const Solve
|
||||
for(int object_group_size = MIN((unsigned int)solver_configuration.object_group_size, polygons.size() - curr_polygon); object_group_size > 0; --object_group_size)
|
||||
{
|
||||
z3::set_param("timeout", solver_configuration.optimization_timeout.c_str());
|
||||
//z3::set_param("parallel.enable", "true");
|
||||
//z3::set_param("smt.threads", "8");
|
||||
//z3::set_param("parallel.threads.max", "16");
|
||||
|
||||
z3::context z_context;
|
||||
z3::solver z_solver(z_context);
|
||||
@ -9965,17 +9957,13 @@ bool optimize_SubglobalConsequentialPolygonNonoverlappingBinaryCentered(const So
|
||||
dec_values_Y.resize(polygons.size());
|
||||
dec_values_T.resize(polygons.size());
|
||||
|
||||
int box_half_x_max = solver_configuration.maximum_X_bounding_box_size / 2;
|
||||
int box_half_y_max = solver_configuration.maximum_Y_bounding_box_size / 2;
|
||||
int box_half_x_max = solver_configuration.x_plate_bounding_box_size / 2;
|
||||
int box_half_y_max = solver_configuration.y_plate_bounding_box_size / 2;
|
||||
|
||||
for (unsigned int curr_polygon = 0; curr_polygon < polygons.size(); /* nothing */)
|
||||
{
|
||||
bool optimized = false;
|
||||
|
||||
z3::set_param("timeout", solver_configuration.optimization_timeout.c_str());
|
||||
//z3::set_param("parallel.enable", "true");
|
||||
//z3::set_param("smt.threads", "8");
|
||||
//z3::set_param("parallel.threads.max", "16");
|
||||
|
||||
z3::context z_context;
|
||||
z3::solver z_solver(z_context);
|
||||
|
@ -140,7 +140,7 @@ void save_DecimatedPolygons(const CommandParameters &command_paramete
|
||||
|
||||
Point nozzle_offset(-command_parameters.x_nozzle, -command_parameters.y_nozzle);
|
||||
|
||||
for (int i = 0; i < decimated_polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < decimated_polygons.size(); ++i)
|
||||
{
|
||||
out << "[" << i << "]" << endl;
|
||||
out << "{" << endl;
|
||||
@ -176,11 +176,11 @@ int decimate_Polygons(const CommandParameters &command_parameters)
|
||||
|
||||
printf(" Decimating objects (polygons) ...\n");
|
||||
|
||||
for (int i = 0; i < objects_to_print.size(); ++i)
|
||||
for (unsigned int i = 0; i < objects_to_print.size(); ++i)
|
||||
{
|
||||
for (int j = 0; j < objects_to_print[i].pgns_at_height.size(); ++j)
|
||||
for (unsigned int j = 0; j < objects_to_print[i].pgns_at_height.size(); ++j)
|
||||
{
|
||||
coord_t height = objects_to_print[i].pgns_at_height[j].first;
|
||||
//coord_t height = objects_to_print[i].pgns_at_height[j].first;
|
||||
|
||||
if (!objects_to_print[i].pgns_at_height[j].second.points.empty())
|
||||
{
|
||||
@ -200,7 +200,7 @@ int decimate_Polygons(const CommandParameters &command_parameters)
|
||||
|
||||
Point nozzle_offset(-command_parameters.x_nozzle, -command_parameters.y_nozzle);
|
||||
|
||||
for (int i = 0; i < decimated_polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < decimated_polygons.size(); ++i)
|
||||
{
|
||||
printf(" [%d]\n", i);
|
||||
Slic3r::Polygon shift_polygon = decimated_polygons[i];
|
||||
@ -225,7 +225,7 @@ int decimate_Polygons(const CommandParameters &command_parameters)
|
||||
string svg_filename = "sequential_decimator.svg";
|
||||
SVG preview_svg(svg_filename);
|
||||
|
||||
for (int i = 0; i < decimated_polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < decimated_polygons.size(); ++i)
|
||||
{
|
||||
Polygon transformed_polygon;
|
||||
Polygon shift_polygon = decimated_polygons[i];
|
||||
@ -237,8 +237,8 @@ int decimate_Polygons(const CommandParameters &command_parameters)
|
||||
transformed_polygon = transform_UpsideDown(solver_configuration,
|
||||
scaleUp_PolygonForSlicer(1,
|
||||
shift_polygon,
|
||||
rand() % (solver_configuration.maximum_X_bounding_box_size * SEQ_SLICER_SCALE_FACTOR),
|
||||
rand() % (solver_configuration.maximum_Y_bounding_box_size * SEQ_SLICER_SCALE_FACTOR)));
|
||||
rand() % (solver_configuration.x_plate_bounding_box_size * SEQ_SLICER_SCALE_FACTOR),
|
||||
rand() % (solver_configuration.y_plate_bounding_box_size * SEQ_SLICER_SCALE_FACTOR)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -345,9 +345,9 @@ int decimate_Polygons(const CommandParameters &command_parameters)
|
||||
}
|
||||
|
||||
Polygon bed_polygon({ { 0, 0},
|
||||
{ solver_configuration.maximum_X_bounding_box_size, 0 },
|
||||
{ solver_configuration.maximum_X_bounding_box_size, solver_configuration.maximum_Y_bounding_box_size},
|
||||
{ 0, solver_configuration.maximum_Y_bounding_box_size} });
|
||||
{ solver_configuration.x_plate_bounding_box_size, 0 },
|
||||
{ solver_configuration.x_plate_bounding_box_size, solver_configuration.y_plate_bounding_box_size},
|
||||
{ 0, solver_configuration.y_plate_bounding_box_size} });
|
||||
Polygon display_bed_polygon = scaleUp_PolygonForSlicer(SEQ_SVG_SCALE_FACTOR,
|
||||
bed_polygon,
|
||||
0,
|
||||
|
@ -215,7 +215,7 @@ int solve_SequentialPrint(const CommandParameters &command_parameters)
|
||||
|
||||
map<int, int> original_index_map;
|
||||
|
||||
for (int i = 0; i < objects_to_print.size(); ++i)
|
||||
for (unsigned int i = 0; i < objects_to_print.size(); ++i)
|
||||
{
|
||||
Polygon nozzle_polygon;
|
||||
Polygon extruder_polygon;
|
||||
@ -234,7 +234,7 @@ int solve_SequentialPrint(const CommandParameters &command_parameters)
|
||||
|
||||
if (command_parameters.printer_filename.empty())
|
||||
{
|
||||
for (int j = 0; j < objects_to_print[i].pgns_at_height.size(); ++j)
|
||||
for (unsigned int j = 0; j < objects_to_print[i].pgns_at_height.size(); ++j)
|
||||
{
|
||||
coord_t height = objects_to_print[i].pgns_at_height[j].first;
|
||||
|
||||
@ -344,7 +344,7 @@ int solve_SequentialPrint(const CommandParameters &command_parameters)
|
||||
}
|
||||
|
||||
SVG preview_svg("sequential_prusa.svg");
|
||||
for (int k = 0; k < unreachable_polygons.back().size(); ++k)
|
||||
for (unsigned int k = 0; k < unreachable_polygons.back().size(); ++k)
|
||||
{
|
||||
Polygon display_unreachable_polygon = transform_UpsideDown(solver_configuration, SEQ_SVG_SCALE_FACTOR, scaleUp_PolygonForSlicer(SEQ_SVG_SCALE_FACTOR, unreachable_polygons.back()[k], 0, 0));
|
||||
preview_svg.draw(display_unreachable_polygon, "lightgrey");
|
||||
@ -361,7 +361,7 @@ int solve_SequentialPrint(const CommandParameters &command_parameters)
|
||||
//vector<int> original_index_map;
|
||||
vector<int> decided_polygons;
|
||||
|
||||
for (int index = 0; index < polygons.size(); ++index)
|
||||
for (unsigned int index = 0; index < polygons.size(); ++index)
|
||||
{
|
||||
polygon_index_map.push_back(index);
|
||||
}
|
||||
@ -412,7 +412,7 @@ int solve_SequentialPrint(const CommandParameters &command_parameters)
|
||||
if (optimized)
|
||||
{
|
||||
printf("Polygon positions:\n");
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
printf(" [ID:%d,RID:%d] x:%.3f, y:%.3f (t:%.3f)\n",
|
||||
original_index_map[decided_polygons[i]],
|
||||
@ -422,13 +422,13 @@ int solve_SequentialPrint(const CommandParameters &command_parameters)
|
||||
times_T[decided_polygons[i]].as_double());
|
||||
}
|
||||
printf("Remaining polygons: %ld\n", remaining_polygons.size());
|
||||
for (int i = 0; i < remaining_polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < remaining_polygons.size(); ++i)
|
||||
{
|
||||
printf(" ID:%d\n", original_index_map[remaining_polygons[i]]);
|
||||
}
|
||||
|
||||
std::map<double, int> scheduled_polygons;
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
scheduled_polygons.insert(std::pair<double, int>(times_T[decided_polygons[i]].as_double(), decided_polygons[i]));
|
||||
}
|
||||
@ -469,9 +469,9 @@ int solve_SequentialPrint(const CommandParameters &command_parameters)
|
||||
|
||||
if (!unreachable_polygons.empty())
|
||||
{
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
for (int j = 0; j < unreachable_polygons[decided_polygons[i]].size(); ++j)
|
||||
for (unsigned int j = 0; j < unreachable_polygons[decided_polygons[i]].size(); ++j)
|
||||
{
|
||||
Polygon display_unreachable_polygon = transform_UpsideDown(solver_configuration, SEQ_SVG_SCALE_FACTOR, scaleUp_PolygonForSlicer(SEQ_SVG_SCALE_FACTOR,
|
||||
unreachable_polygons[decided_polygons[i]][j],
|
||||
@ -532,7 +532,7 @@ int solve_SequentialPrint(const CommandParameters &command_parameters)
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i)
|
||||
{
|
||||
Polygon display_polygon = transform_UpsideDown(solver_configuration, SEQ_SVG_SCALE_FACTOR, scaleUp_PolygonForSlicer(SEQ_SVG_SCALE_FACTOR,
|
||||
polygons[decided_polygons[i]],
|
||||
@ -635,7 +635,7 @@ int solve_SequentialPrint(const CommandParameters &command_parameters)
|
||||
preview_svg.draw(display_polygon, color);
|
||||
}
|
||||
std::map<double, int>::const_iterator scheduled_polygon = scheduled_polygons.begin();
|
||||
for (int i = 0; i < decided_polygons.size(); ++i, ++scheduled_polygon)
|
||||
for (unsigned int i = 0; i < decided_polygons.size(); ++i, ++scheduled_polygon)
|
||||
{
|
||||
coord_t sx, sy, x, y;
|
||||
|
||||
@ -682,9 +682,9 @@ int solve_SequentialPrint(const CommandParameters &command_parameters)
|
||||
preview_svg.draw_text(Point(x, y), ("ID:" + std::to_string(original_index_map[decided_polygons[i]]) + " T:" + std::to_string(times_T[decided_polygons[i]].as_int64())).c_str(), text_color.c_str());
|
||||
}
|
||||
Polygon plate_polygon({ { 0, 0},
|
||||
{ solver_configuration.maximum_X_bounding_box_size, 0 },
|
||||
{ solver_configuration.maximum_X_bounding_box_size, solver_configuration.maximum_Y_bounding_box_size},
|
||||
{ 0, solver_configuration.maximum_Y_bounding_box_size} });
|
||||
{ solver_configuration.x_plate_bounding_box_size, 0 },
|
||||
{ solver_configuration.x_plate_bounding_box_size, solver_configuration.y_plate_bounding_box_size},
|
||||
{ 0, solver_configuration.y_plate_bounding_box_size} });
|
||||
Polygon display_plate_polygon = scaleUp_PolygonForSlicer(SEQ_SVG_SCALE_FACTOR,
|
||||
plate_polygon,
|
||||
0,
|
||||
@ -725,13 +725,13 @@ int solve_SequentialPrint(const CommandParameters &command_parameters)
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
for (int i = 0; i < polygon_index_map.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_index_map.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", polygon_index_map[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
for (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]]);
|
||||
next_unreachable_polygons.push_back(unreachable_polygons[remaining_polygons[i]]);
|
||||
@ -748,7 +748,7 @@ int solve_SequentialPrint(const CommandParameters &command_parameters)
|
||||
//vector<int> next_original_index_map;
|
||||
map<int, int> next_original_index_map;
|
||||
|
||||
for (int index = 0; index < polygons.size(); ++index)
|
||||
for (unsigned int index = 0; index < polygons.size(); ++index)
|
||||
{
|
||||
next_polygon_index_map.push_back(index);
|
||||
next_original_index_map[index] = original_index_map[remaining_polygons[index]];
|
||||
|
@ -137,7 +137,7 @@ void test_interface_1(void)
|
||||
|
||||
printf("Number of plates: %ld\n", scheduled_plates.size());
|
||||
|
||||
for (int plate = 0; plate < scheduled_plates.size(); ++plate)
|
||||
for (unsigned int plate = 0; plate < scheduled_plates.size(); ++plate)
|
||||
{
|
||||
printf(" Number of objects on plate: %ld\n", scheduled_plates[plate].scheduled_objects.size());
|
||||
|
||||
@ -194,7 +194,7 @@ void test_interface_2(void)
|
||||
|
||||
printf("Number of plates: %ld\n", scheduled_plates.size());
|
||||
|
||||
for (int plate = 0; plate < scheduled_plates.size(); ++plate)
|
||||
for (unsigned int plate = 0; plate < scheduled_plates.size(); ++plate)
|
||||
{
|
||||
printf(" Number of objects on plate: %ld\n", scheduled_plates[plate].scheduled_objects.size());
|
||||
|
||||
@ -306,7 +306,7 @@ int test_interface_4(void)
|
||||
|
||||
printf("Number of plates: %ld\n", scheduled_plates.size());
|
||||
|
||||
for (int plate = 0; plate < scheduled_plates.size(); ++plate)
|
||||
for (unsigned int plate = 0; plate < scheduled_plates.size(); ++plate)
|
||||
{
|
||||
printf(" Number of objects on plate: %ld\n", scheduled_plates[plate].scheduled_objects.size());
|
||||
|
||||
@ -365,7 +365,7 @@ int test_interface_5(void)
|
||||
|
||||
printf("Number of plates: %ld\n", scheduled_plates.size());
|
||||
|
||||
for (int plate = 0; plate < scheduled_plates.size(); ++plate)
|
||||
for (unsigned int plate = 0; plate < scheduled_plates.size(); ++plate)
|
||||
{
|
||||
printf(" Number of objects on plate: %ld\n", scheduled_plates[plate].scheduled_objects.size());
|
||||
|
||||
|
@ -51,7 +51,7 @@ Polygon scale_UP(const Polygon &polygon)
|
||||
{
|
||||
Polygon poly = polygon;
|
||||
|
||||
for (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);
|
||||
}
|
||||
@ -64,7 +64,7 @@ Polygon scale_UP(const Polygon &polygon, double x_pos, double y_pos)
|
||||
{
|
||||
Polygon poly = polygon;
|
||||
|
||||
for (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);
|
||||
@ -85,14 +85,14 @@ void test_preprocess_1(void)
|
||||
SolverConfiguration solver_configuration;
|
||||
|
||||
start = clock();
|
||||
for (int i = 0; i < PRUSA_PART_POLYGONS.size(); ++i)
|
||||
for (unsigned 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 (int i = 0; i < test_polygons.size(); ++i)
|
||||
for (unsigned 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 (int i = 0; i < PRUSA_PART_POLYGONS.size(); ++i)
|
||||
for (unsigned int i = 0; i < PRUSA_PART_POLYGONS.size(); ++i)
|
||||
{
|
||||
Polygon scale_down_polygon;
|
||||
scaleDown_PolygonForSequentialSolver(PRUSA_PART_POLYGONS[i], scale_down_polygon);
|
||||
@ -135,7 +135,7 @@ void test_preprocess_2(void)
|
||||
vector<int> polygon_index_map;
|
||||
vector<int> decided_polygons;
|
||||
|
||||
for (int index = 0; index < polygons.size(); ++index)
|
||||
for (unsigned int index = 0; index < polygons.size(); ++index)
|
||||
{
|
||||
polygon_index_map.push_back(index);
|
||||
}
|
||||
@ -164,12 +164,12 @@ void test_preprocess_2(void)
|
||||
if (optimized)
|
||||
{
|
||||
printf("Polygon positions:\n");
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (unsigned 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 (int i = 0; i < remaining_polygons.size(); ++i)
|
||||
for (unsigned 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 (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());
|
||||
@ -187,7 +187,7 @@ void test_preprocess_2(void)
|
||||
printf(" xy: %d, %d\n", polygons[decided_polygons[i]].points[k].x(), polygons[decided_polygons[i]].points[k].y());
|
||||
}
|
||||
*/
|
||||
// for (int j = 0; j < unreachable_polygons[decided_polygons[i]].size(); ++j)
|
||||
// for (unsigned int j = 0; j < unreachable_polygons[decided_polygons[i]].size(); ++j)
|
||||
{
|
||||
/*
|
||||
for (int k = 0; k < unreachable_polygons[decided_polygons[i]][j].points.size(); ++k)
|
||||
@ -203,7 +203,7 @@ void test_preprocess_2(void)
|
||||
}
|
||||
}
|
||||
|
||||
for (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(),
|
||||
@ -295,11 +295,11 @@ void test_preprocess_2(void)
|
||||
vector<Polygon> next_polygons;
|
||||
vector<Polygon> next_unreachable_polygons;
|
||||
|
||||
for (int i = 0; i < polygon_index_map.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_index_map.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", polygon_index_map[i]);
|
||||
}
|
||||
for (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]]);
|
||||
next_unreachable_polygons.push_back(unreachable_polygons[remaining_polygons[i]]);
|
||||
@ -312,7 +312,7 @@ void test_preprocess_2(void)
|
||||
polygons = next_polygons;
|
||||
unreachable_polygons = next_unreachable_polygons;
|
||||
|
||||
for (int index = 0; index < polygons.size(); ++index)
|
||||
for (unsigned int index = 0; index < polygons.size(); ++index)
|
||||
{
|
||||
polygon_index_map.push_back(index);
|
||||
}
|
||||
@ -340,7 +340,7 @@ void test_preprocess_3(void)
|
||||
std::vector<Slic3r::Polygon> hose_unreachable_polygons;
|
||||
std::vector<Slic3r::Polygon> gantry_unreachable_polygons;
|
||||
|
||||
for (int p = 0; p < PRUSA_PART_POLYGONS.size(); ++p)
|
||||
for (unsigned int p = 0; p < PRUSA_PART_POLYGONS.size(); ++p)
|
||||
{
|
||||
{
|
||||
nozzle_unreachable_polygons.clear();
|
||||
@ -354,14 +354,14 @@ void test_preprocess_3(void)
|
||||
|
||||
//preview_svg.draw(PRUSA_PART_POLYGONS[p], "blue");
|
||||
|
||||
for (int j = 0; j < SEQ_UNREACHABLE_POLYGON_NOZZLE_LEVEL_MK3S.size(); ++j)
|
||||
for (unsigned int j = 0; j < SEQ_UNREACHABLE_POLYGON_NOZZLE_LEVEL_MK3S.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(SEQ_UNREACHABLE_POLYGON_NOZZLE_LEVEL_MK3S[j], "lightgrey");
|
||||
}
|
||||
|
||||
if (!nozzle_unreachable_polygons.empty())
|
||||
{
|
||||
for (int j = 0; j < nozzle_unreachable_polygons.size(); ++j)
|
||||
for (unsigned int j = 0; j < nozzle_unreachable_polygons.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(nozzle_unreachable_polygons[j], "lightgrey");
|
||||
}
|
||||
@ -385,14 +385,14 @@ void test_preprocess_3(void)
|
||||
//preview_svg.draw(PRUSA_PART_POLYGONS[p], "blue");
|
||||
|
||||
|
||||
for (int j = 0; j < SEQ_UNREACHABLE_POLYGON_NOZZLE_LEVEL_MK3S.size(); ++j)
|
||||
for (unsigned int j = 0; j < SEQ_UNREACHABLE_POLYGON_NOZZLE_LEVEL_MK3S.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(SEQ_UNREACHABLE_POLYGON_NOZZLE_LEVEL_MK3S[j], "lightgrey");
|
||||
}
|
||||
|
||||
if (!nozzle_unreachable_polygons.empty())
|
||||
{
|
||||
for (int j = 0; j < nozzle_unreachable_polygons.size(); ++j)
|
||||
for (unsigned int j = 0; j < nozzle_unreachable_polygons.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(nozzle_unreachable_polygons[j], "lightgrey");
|
||||
}
|
||||
@ -415,14 +415,14 @@ void test_preprocess_3(void)
|
||||
|
||||
//preview_svg.draw(PRUSA_PART_POLYGONS[p], "blue");
|
||||
|
||||
for (int j = 0; j < SEQ_UNREACHABLE_POLYGON_EXTRUDER_LEVEL_MK3S.size(); ++j)
|
||||
for (unsigned int j = 0; j < SEQ_UNREACHABLE_POLYGON_EXTRUDER_LEVEL_MK3S.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(SEQ_UNREACHABLE_POLYGON_EXTRUDER_LEVEL_MK3S[j], "lightgrey");
|
||||
}
|
||||
|
||||
if (!extruder_unreachable_polygons.empty())
|
||||
{
|
||||
for (int j = 0; j < extruder_unreachable_polygons.size(); ++j)
|
||||
for (unsigned int j = 0; j < extruder_unreachable_polygons.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(extruder_unreachable_polygons[j], "lightgrey");
|
||||
}
|
||||
@ -446,14 +446,14 @@ void test_preprocess_3(void)
|
||||
//preview_svg.draw(PRUSA_PART_POLYGONS[p], "blue");
|
||||
|
||||
|
||||
for (int j = 0; j < SEQ_UNREACHABLE_POLYGON_EXTRUDER_LEVEL_MK3S.size(); ++j)
|
||||
for (unsigned int j = 0; j < SEQ_UNREACHABLE_POLYGON_EXTRUDER_LEVEL_MK3S.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(SEQ_UNREACHABLE_POLYGON_EXTRUDER_LEVEL_MK3S[j], "lightgrey");
|
||||
}
|
||||
|
||||
if (!extruder_unreachable_polygons.empty())
|
||||
{
|
||||
for (int j = 0; j < extruder_unreachable_polygons.size(); ++j)
|
||||
for (unsigned int j = 0; j < extruder_unreachable_polygons.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(extruder_unreachable_polygons[j], "lightgrey");
|
||||
}
|
||||
@ -476,14 +476,14 @@ void test_preprocess_3(void)
|
||||
|
||||
//preview_svg.draw(PRUSA_PART_POLYGONS[p], "blue");
|
||||
|
||||
for (int j = 0; j < SEQ_UNREACHABLE_POLYGON_HOSE_LEVEL_MK3S.size(); ++j)
|
||||
for (unsigned int j = 0; j < SEQ_UNREACHABLE_POLYGON_HOSE_LEVEL_MK3S.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(SEQ_UNREACHABLE_POLYGON_HOSE_LEVEL_MK3S[j], "lightgrey");
|
||||
}
|
||||
|
||||
if (!hose_unreachable_polygons.empty())
|
||||
{
|
||||
for (int j = 0; j < hose_unreachable_polygons.size(); ++j)
|
||||
for (unsigned int j = 0; j < hose_unreachable_polygons.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(hose_unreachable_polygons[j], "lightgrey");
|
||||
}
|
||||
@ -507,14 +507,14 @@ void test_preprocess_3(void)
|
||||
//preview_svg.draw(PRUSA_PART_POLYGONS[p], "blue");
|
||||
|
||||
|
||||
for (int j = 0; j < SEQ_UNREACHABLE_POLYGON_HOSE_LEVEL_MK3S.size(); ++j)
|
||||
for (unsigned int j = 0; j < SEQ_UNREACHABLE_POLYGON_HOSE_LEVEL_MK3S.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(SEQ_UNREACHABLE_POLYGON_HOSE_LEVEL_MK3S[j], "lightgrey");
|
||||
}
|
||||
|
||||
if (!hose_unreachable_polygons.empty())
|
||||
{
|
||||
for (int j = 0; j < hose_unreachable_polygons.size(); ++j)
|
||||
for (unsigned int j = 0; j < hose_unreachable_polygons.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(hose_unreachable_polygons[j], "lightgrey");
|
||||
}
|
||||
@ -537,14 +537,14 @@ void test_preprocess_3(void)
|
||||
|
||||
//preview_svg.draw(PRUSA_PART_POLYGONS[p], "blue");
|
||||
|
||||
for (int j = 0; j < SEQ_UNREACHABLE_POLYGON_GANTRY_LEVEL_MK3S.size(); ++j)
|
||||
for (unsigned int j = 0; j < SEQ_UNREACHABLE_POLYGON_GANTRY_LEVEL_MK3S.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(SEQ_UNREACHABLE_POLYGON_GANTRY_LEVEL_MK3S[j], "lightgrey");
|
||||
}
|
||||
|
||||
if (!gantry_unreachable_polygons.empty())
|
||||
{
|
||||
for (int j = 0; j < gantry_unreachable_polygons.size(); ++j)
|
||||
for (unsigned int j = 0; j < gantry_unreachable_polygons.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(gantry_unreachable_polygons[j], "lightgrey");
|
||||
}
|
||||
@ -568,14 +568,14 @@ void test_preprocess_3(void)
|
||||
//preview_svg.draw(PRUSA_PART_POLYGONS[p], "blue");
|
||||
|
||||
|
||||
for (int j = 0; j < SEQ_UNREACHABLE_POLYGON_GANTRY_LEVEL_MK3S.size(); ++j)
|
||||
for (unsigned int j = 0; j < SEQ_UNREACHABLE_POLYGON_GANTRY_LEVEL_MK3S.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(SEQ_UNREACHABLE_POLYGON_GANTRY_LEVEL_MK3S[j], "lightgrey");
|
||||
}
|
||||
|
||||
if (!gantry_unreachable_polygons.empty())
|
||||
{
|
||||
for (int j = 0; j < gantry_unreachable_polygons.size(); ++j)
|
||||
for (unsigned int j = 0; j < gantry_unreachable_polygons.size(); ++j)
|
||||
{
|
||||
preview_svg.draw(gantry_unreachable_polygons[j], "lightgrey");
|
||||
}
|
||||
@ -634,7 +634,7 @@ void test_preprocess_4(void)
|
||||
vector<int> polygon_index_map;
|
||||
vector<int> decided_polygons;
|
||||
|
||||
for (int index = 0; index < polygons.size(); ++index)
|
||||
for (unsigned int index = 0; index < polygons.size(); ++index)
|
||||
{
|
||||
polygon_index_map.push_back(index);
|
||||
}
|
||||
@ -663,12 +663,12 @@ void test_preprocess_4(void)
|
||||
if (optimized)
|
||||
{
|
||||
printf("Polygon positions:\n");
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (unsigned 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 (int i = 0; i < remaining_polygons.size(); ++i)
|
||||
for (unsigned 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 (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());
|
||||
@ -686,7 +686,7 @@ void test_preprocess_4(void)
|
||||
printf(" xy: %d, %d\n", polygons[decided_polygons[i]].points[k].x(), polygons[decided_polygons[i]].points[k].y());
|
||||
}
|
||||
*/
|
||||
for (int j = 0; j < unreachable_polygons[decided_polygons[i]].size(); ++j)
|
||||
for (unsigned int j = 0; j < unreachable_polygons[decided_polygons[i]].size(); ++j)
|
||||
{
|
||||
/*
|
||||
for (int k = 0; k < unreachable_polygons[decided_polygons[i]][j].points.size(); ++k)
|
||||
@ -702,7 +702,7 @@ void test_preprocess_4(void)
|
||||
}
|
||||
}
|
||||
|
||||
for (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(),
|
||||
@ -794,11 +794,11 @@ void test_preprocess_4(void)
|
||||
vector<Polygon> next_polygons;
|
||||
vector<vector<Polygon> > next_unreachable_polygons;
|
||||
|
||||
for (int i = 0; i < polygon_index_map.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_index_map.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", polygon_index_map[i]);
|
||||
}
|
||||
for (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]]);
|
||||
next_unreachable_polygons.push_back(unreachable_polygons[remaining_polygons[i]]);
|
||||
@ -811,7 +811,7 @@ void test_preprocess_4(void)
|
||||
polygons = next_polygons;
|
||||
unreachable_polygons = next_unreachable_polygons;
|
||||
|
||||
for (int index = 0; index < polygons.size(); ++index)
|
||||
for (unsigned int index = 0; index < polygons.size(); ++index)
|
||||
{
|
||||
polygon_index_map.push_back(index);
|
||||
}
|
||||
@ -838,7 +838,7 @@ void test_preprocess_5(void)
|
||||
std::vector<Slic3r::Polygon> polygons;
|
||||
std::vector<std::vector<Slic3r::Polygon> > unreachable_polygons;
|
||||
|
||||
for (int i = 0; i < PRUSA_PART_POLYGONS.size(); ++i)
|
||||
for (unsigned 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 (int i = 0; i < PRUSA_PART_POLYGONS.size(); ++i)
|
||||
for (unsigned int i = 0; i < PRUSA_PART_POLYGONS.size(); ++i)
|
||||
{
|
||||
Polygon decimated_polygon;
|
||||
decimate_PolygonForSequentialSolver(solver_configuration,
|
||||
@ -929,7 +929,7 @@ void test_preprocess_6(void)
|
||||
vector<int> polygon_index_map;
|
||||
vector<int> decided_polygons;
|
||||
|
||||
for (int index = 0; index < polygons.size(); ++index)
|
||||
for (unsigned int index = 0; index < polygons.size(); ++index)
|
||||
{
|
||||
polygon_index_map.push_back(index);
|
||||
}
|
||||
@ -958,12 +958,12 @@ void test_preprocess_6(void)
|
||||
if (optimized)
|
||||
{
|
||||
printf("Polygon positions:\n");
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (unsigned 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 (int i = 0; i < remaining_polygons.size(); ++i)
|
||||
for (unsigned 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 (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());
|
||||
@ -981,7 +981,7 @@ void test_preprocess_6(void)
|
||||
printf(" xy: %d, %d\n", polygons[decided_polygons[i]].points[k].x(), polygons[decided_polygons[i]].points[k].y());
|
||||
}
|
||||
*/
|
||||
for (int j = 0; j < unreachable_polygons[decided_polygons[i]].size(); ++j)
|
||||
for (unsigned int j = 0; j < unreachable_polygons[decided_polygons[i]].size(); ++j)
|
||||
{
|
||||
/*
|
||||
for (int k = 0; k < unreachable_polygons[decided_polygons[i]][j].points.size(); ++k)
|
||||
@ -997,7 +997,7 @@ void test_preprocess_6(void)
|
||||
}
|
||||
}
|
||||
|
||||
for (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(),
|
||||
@ -1089,11 +1089,11 @@ void test_preprocess_6(void)
|
||||
vector<Polygon> next_polygons;
|
||||
vector<vector<Polygon> > next_unreachable_polygons;
|
||||
|
||||
for (int i = 0; i < polygon_index_map.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_index_map.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", polygon_index_map[i]);
|
||||
}
|
||||
for (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]]);
|
||||
next_unreachable_polygons.push_back(unreachable_polygons[remaining_polygons[i]]);
|
||||
@ -1106,7 +1106,7 @@ void test_preprocess_6(void)
|
||||
polygons = next_polygons;
|
||||
unreachable_polygons = next_unreachable_polygons;
|
||||
|
||||
for (int index = 0; index < polygons.size(); ++index)
|
||||
for (unsigned int index = 0; index < polygons.size(); ++index)
|
||||
{
|
||||
polygon_index_map.push_back(index);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ Polygon scale_UP(const Polygon &polygon)
|
||||
{
|
||||
Polygon poly = polygon;
|
||||
|
||||
for (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);
|
||||
}
|
||||
@ -59,7 +59,7 @@ Polygon scale_UP(const Polygon &polygon, double x_pos, double y_pos)
|
||||
{
|
||||
Polygon poly = polygon;
|
||||
|
||||
for (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);
|
||||
@ -142,18 +142,25 @@ void test_sequential_1(void)
|
||||
printf("Printing model:\n");
|
||||
cout << z_model << "\n";
|
||||
|
||||
for (int i = 0; i < z_model.size(); ++i)
|
||||
for (unsigned int i = 0; i < z_model.size(); ++i)
|
||||
{
|
||||
printf("Variable:%s\n", z_model[i].name().str().c_str());
|
||||
printf("Printing interpretation:\n");
|
||||
|
||||
cout << z_model.get_const_interp(z_model[i]) << "\n";
|
||||
|
||||
switch (z_model.get_const_interp(z_model[i]).is_bool())
|
||||
if (z_model.get_const_interp(z_model[i]).is_bool())
|
||||
{
|
||||
printf(" value: TRUE\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(" value: FALSE\n");
|
||||
}
|
||||
/*
|
||||
case Z3_L_FALSE:
|
||||
{
|
||||
printf(" value: FALSE\n");
|
||||
printf(" value: FALSE\n");
|
||||
break;
|
||||
}
|
||||
case Z3_L_TRUE:
|
||||
@ -170,7 +177,8 @@ void test_sequential_1(void)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
printf("Testing sequential scheduling 1 ... finished\n");
|
||||
@ -395,7 +403,7 @@ void test_sequential_2(void)
|
||||
|
||||
finish = clock();
|
||||
|
||||
for (int i = 0; i < z_model.size(); ++i)
|
||||
for (unsigned int i = 0; i < z_model.size(); ++i)
|
||||
{
|
||||
printf("Variable:%s\n", z_model[i].name().str().c_str());
|
||||
|
||||
@ -672,7 +680,7 @@ void test_sequential_3(void)
|
||||
|
||||
finish = clock();
|
||||
|
||||
for (int i = 0; i < z_model.size(); ++i)
|
||||
for (unsigned int i = 0; i < z_model.size(); ++i)
|
||||
{
|
||||
printf("Variable:%s\n", z_model[i].name().str().c_str());
|
||||
|
||||
@ -789,7 +797,7 @@ void test_sequential_4(void)
|
||||
Y_positions.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (int i = 0; i < polygon_1.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_1.points.size(); ++i)
|
||||
{
|
||||
string name = "t_time-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -888,7 +896,7 @@ void test_sequential_4(void)
|
||||
*/
|
||||
|
||||
printf("Printing interpretation:\n");
|
||||
for (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());
|
||||
|
||||
@ -1036,7 +1044,7 @@ void test_sequential_4(void)
|
||||
cout << z_model << "\n";
|
||||
*/
|
||||
|
||||
for (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();
|
||||
@ -1250,7 +1258,7 @@ void test_sequential_5(void)
|
||||
Y_positions.push_back(expr(z_context.real_const(name.c_str())));
|
||||
}
|
||||
|
||||
for (int i = 0; i < polygon_1.points.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_1.points.size(); ++i)
|
||||
{
|
||||
string name = "t_time-" + to_string(i);
|
||||
printf("name: %s\n", name.c_str());
|
||||
@ -1350,7 +1358,7 @@ void test_sequential_5(void)
|
||||
cout << z_model << "\n";
|
||||
*/
|
||||
printf("Printing interpretation:\n");
|
||||
for (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());
|
||||
|
||||
@ -1515,7 +1523,7 @@ void test_sequential_5(void)
|
||||
cout << z_model << "\n";
|
||||
*/
|
||||
|
||||
for (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();
|
||||
@ -1675,25 +1683,25 @@ void test_sequential_5(void)
|
||||
|
||||
SVG preview_svg("sequential_test_5.svg");
|
||||
|
||||
for (int i = 0; i < unreachable_polygons[0].size(); ++i)
|
||||
for (unsigned int i = 0; i < unreachable_polygons[0].size(); ++i)
|
||||
{
|
||||
Polygon display_pro_polygon_1 = scale_UP(unreachable_polygons[0][i], _poly_1_pos_x.as_double(), _poly_1_pos_y.as_double());
|
||||
preview_svg.draw(display_pro_polygon_1, "lightgrey");
|
||||
}
|
||||
|
||||
for (int i = 0; i < unreachable_polygons[1].size(); ++i)
|
||||
for (unsigned int i = 0; i < unreachable_polygons[1].size(); ++i)
|
||||
{
|
||||
Polygon display_pro_polygon_2 = scale_UP(unreachable_polygons[1][i], _poly_2_pos_x.as_double(), _poly_2_pos_y.as_double());
|
||||
preview_svg.draw(display_pro_polygon_2, "lightgrey");
|
||||
}
|
||||
|
||||
for (int i = 0; i < unreachable_polygons[2].size(); ++i)
|
||||
for (unsigned int i = 0; i < unreachable_polygons[2].size(); ++i)
|
||||
{
|
||||
Polygon display_pro_polygon_3 = scale_UP(unreachable_polygons[2][i], _poly_3_pos_x.as_double(), _poly_3_pos_y.as_double());
|
||||
preview_svg.draw(display_pro_polygon_3, "lightgrey");
|
||||
}
|
||||
|
||||
for (int i = 0; i < unreachable_polygons[3].size(); ++i)
|
||||
for (unsigned int i = 0; i < unreachable_polygons[3].size(); ++i)
|
||||
{
|
||||
Polygon display_pro_polygon_4 = scale_UP(unreachable_polygons[3][i], _poly_4_pos_x.as_double(), _poly_4_pos_y.as_double());
|
||||
preview_svg.draw(display_pro_polygon_4, "lightgrey");
|
||||
@ -1811,7 +1819,7 @@ void test_sequential_6(void)
|
||||
}
|
||||
*/
|
||||
|
||||
for (int index = 0; index < polygons.size(); ++index)
|
||||
for (unsigned int index = 0; index < polygons.size(); ++index)
|
||||
{
|
||||
polygon_index_map.push_back(index);
|
||||
}
|
||||
@ -1854,13 +1862,13 @@ void test_sequential_6(void)
|
||||
if (optimized)
|
||||
{
|
||||
printf("Polygon positions:\n");
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (unsigned 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(" [%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 (int i = 0; i < remaining_polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < remaining_polygons.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", remaining_polygons[i]);
|
||||
}
|
||||
@ -1869,7 +1877,7 @@ void test_sequential_6(void)
|
||||
|
||||
if (!unreachable_polygons.empty())
|
||||
{
|
||||
for (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());
|
||||
@ -1888,7 +1896,7 @@ void test_sequential_6(void)
|
||||
}
|
||||
}
|
||||
|
||||
for (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(),
|
||||
@ -1978,11 +1986,11 @@ void test_sequential_6(void)
|
||||
vector<Polygon> next_polygons;
|
||||
vector<Polygon> next_unreachable_polygons;
|
||||
|
||||
for (int i = 0; i < polygon_index_map.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_index_map.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", polygon_index_map[i]);
|
||||
}
|
||||
for (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]]);
|
||||
next_unreachable_polygons.push_back(unreachable_polygons[remaining_polygons[i]]);
|
||||
@ -1995,7 +2003,7 @@ void test_sequential_6(void)
|
||||
polygons = next_polygons;
|
||||
unreachable_polygons = next_unreachable_polygons;
|
||||
|
||||
for (int index = 0; index < polygons.size(); ++index)
|
||||
for (unsigned int index = 0; index < polygons.size(); ++index)
|
||||
{
|
||||
polygon_index_map.push_back(index);
|
||||
}
|
||||
@ -2094,7 +2102,7 @@ void test_sequential_7(void)
|
||||
}
|
||||
*/
|
||||
|
||||
for (int index = 0; index < polygons.size(); ++index)
|
||||
for (unsigned int index = 0; index < polygons.size(); ++index)
|
||||
{
|
||||
polygon_index_map.push_back(index);
|
||||
}
|
||||
@ -2128,12 +2136,12 @@ void test_sequential_7(void)
|
||||
if (optimized)
|
||||
{
|
||||
printf("Polygon positions:\n");
|
||||
for (int i = 0; i < decided_polygons.size(); ++i)
|
||||
for (unsigned 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 (int i = 0; i < remaining_polygons.size(); ++i)
|
||||
for (unsigned int i = 0; i < remaining_polygons.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", remaining_polygons[i]);
|
||||
}
|
||||
@ -2142,7 +2150,7 @@ void test_sequential_7(void)
|
||||
|
||||
if (!unreachable_polygons.empty())
|
||||
{
|
||||
for (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());
|
||||
@ -2151,7 +2159,7 @@ void test_sequential_7(void)
|
||||
printf(" xy: %d, %d\n", polygons[decided_polygons[i]].points[k].x(), polygons[decided_polygons[i]].points[k].y());
|
||||
}
|
||||
*/
|
||||
for (int j = 0; j < unreachable_polygons[decided_polygons[i]].size(); ++j)
|
||||
for (unsigned int j = 0; j < unreachable_polygons[decided_polygons[i]].size(); ++j)
|
||||
{
|
||||
/*
|
||||
for (int k = 0; k < unreachable_polygons[decided_polygons[i]][j].points.size(); ++k)
|
||||
@ -2167,7 +2175,7 @@ void test_sequential_7(void)
|
||||
}
|
||||
}
|
||||
|
||||
for (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(),
|
||||
@ -2257,11 +2265,11 @@ void test_sequential_7(void)
|
||||
vector<Polygon> next_polygons;
|
||||
vector<vector<Polygon> > next_unreachable_polygons;
|
||||
|
||||
for (int i = 0; i < polygon_index_map.size(); ++i)
|
||||
for (unsigned int i = 0; i < polygon_index_map.size(); ++i)
|
||||
{
|
||||
printf(" %d\n", polygon_index_map[i]);
|
||||
}
|
||||
for (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]]);
|
||||
next_unreachable_polygons.push_back(unreachable_polygons[remaining_polygons[i]]);
|
||||
@ -2274,7 +2282,7 @@ void test_sequential_7(void)
|
||||
polygons = next_polygons;
|
||||
unreachable_polygons = next_unreachable_polygons;
|
||||
|
||||
for (int index = 0; index < polygons.size(); ++index)
|
||||
for (unsigned int index = 0; index < polygons.size(); ++index)
|
||||
{
|
||||
polygon_index_map.push_back(index);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user