diff --git a/src/libseqarrange/include/libseqarrange/seq_interface.hpp b/src/libseqarrange/include/libseqarrange/seq_interface.hpp index 3a2253ef67..c9ed679a28 100644 --- a/src/libseqarrange/include/libseqarrange/seq_interface.hpp +++ b/src/libseqarrange/include/libseqarrange/seq_interface.hpp @@ -133,7 +133,7 @@ struct ScheduledPlate { bool check_ScheduledObjectsForSequentialPrintability(const SolverConfiguration &solver_configuration, const PrinterGeometry &printer_geometry, const std::vector &objects_to_print, - const std::vector &scheduled_plates); + const std::vector &scheduled_plates); /*----------------------------------------------------------------*/ @@ -147,18 +147,26 @@ bool check_ScheduledObjectsForSequentialPrintability(const SolverConfiguration is unable to scedule even single object on the plate. The latter case is detected by timeout and should not normally happen. These failures are reported via exceptions. + + The trans_bed_glue parameter should be set to false when scheduling + all objects. If only objects on a separate bed are scheduled, then + trans_bed_glue should be set to true when there is an object on the + previous bed that is temporally glued to the first scheduled object. + In such a case, the first object will be scheduled as first temporally. */ std::vector schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver_configuration, const PrinterGeometry &printer_geometry, const std::vector &objects_to_print, - std::function progress_callback = [](int progress){}); + std::function progress_callback = [](int progress){}, + bool trans_bed_glue = false); void schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver_configuration, const PrinterGeometry &printer_geometry, const std::vector &objects_to_print, std::vector &scheduled_plates, - std::function progress_callback = [](int progress){}); + std::function progress_callback = [](int progress){}, + bool trans_bed_glue = false); /*----------------------------------------------------------------*/ @@ -169,7 +177,8 @@ void schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver int schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver_configuration, const std::vector &objects_to_print, std::vector &scheduled_plates, - std::function progress_callback = [](int progress){}); + std::function progress_callback = [](int progress){}, + bool trans_bed_glue = false); void setup_ExtruderUnreachableZones(const SolverConfiguration &solver_configuration, std::vector > &convex_unreachable_zones, @@ -180,7 +189,8 @@ int schedule_ObjectsForSequentialPrint(const SolverConfiguration const std::vector > &convex_unreachable_zones, const std::vector > &box_unreachable_zones, std::vector &scheduled_plates, - std::function progress_callback = [](int progress){}); + std::function progress_callback = [](int progress){}, + bool trans_bed_glue = false); /*----------------------------------------------------------------*/ diff --git a/src/libseqarrange/src/seq_interface.cpp b/src/libseqarrange/src/seq_interface.cpp index fa147f288d..7359ba6f35 100644 --- a/src/libseqarrange/src/seq_interface.cpp +++ b/src/libseqarrange/src/seq_interface.cpp @@ -319,7 +319,8 @@ bool check_ScheduledObjectsForSequentialPrintability(const SolverConfiguration std::vector schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver_configuration, const PrinterGeometry &printer_geometry, const std::vector &objects_to_print, - std::function progress_callback) + std::function progress_callback, + bool trans_bed_glue) { std::vector scheduled_plates; @@ -327,7 +328,8 @@ std::vector schedule_ObjectsForSequentialPrint(const SolverConfi printer_geometry, objects_to_print, scheduled_plates, - progress_callback); + progress_callback, + trans_bed_glue); return scheduled_plates; } @@ -349,7 +351,8 @@ void schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver const PrinterGeometry &printer_geometry, const std::vector &objects_to_print, std::vector &scheduled_plates, - std::function progress_callback) + std::function progress_callback, + bool trans_bed_glue) { #ifdef PROFILE clock_t start, finish; @@ -421,7 +424,7 @@ void schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver int progress_object_phases_done = 0; int progress_object_phases_total = SEQ_MAKE_EXTRA_PROGRESS((objects_to_print.size() * SEQ_PROGRESS_PHASES_PER_OBJECT)); - bool trans_bed_lepox = false; + bool trans_bed_lepox = trans_bed_glue; do { @@ -484,6 +487,7 @@ void schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver if (solvable_objects[i].lepox_to_next && !is_scheduled(i + 1, decided_polygons)) { split = true; + break; } } if (split) @@ -587,7 +591,8 @@ void schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver int schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver_configuration, const std::vector &objects_to_print, std::vector &scheduled_plates, - std::function progress_callback) + std::function progress_callback, + bool trans_bed_glue) { #ifdef PROFILE clock_t start, finish; @@ -837,7 +842,7 @@ int schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver_ int progress_object_phases_done = 0; int progress_object_phases_total = SEQ_MAKE_EXTRA_PROGRESS((objects_to_print.size() * SEQ_PROGRESS_PHASES_PER_OBJECT)); - bool trans_bed_lepox = false; + bool trans_bed_lepox = trans_bed_glue; do { @@ -900,6 +905,7 @@ int schedule_ObjectsForSequentialPrint(const SolverConfiguration &solver_ if (solvable_objects[i].lepox_to_next && !is_scheduled(i + 1, decided_polygons)) { split = true; + break; } } if (split) @@ -1038,7 +1044,8 @@ int schedule_ObjectsForSequentialPrint(const SolverConfiguration const std::vector > &convex_unreachable_zones, const std::vector > &box_unreachable_zones, std::vector &scheduled_plates, - std::function progress_callback) + std::function progress_callback, + bool trans_bed_glue) { #ifdef PROFILE clock_t start, finish; @@ -1174,7 +1181,7 @@ int schedule_ObjectsForSequentialPrint(const SolverConfiguration int progress_object_phases_done = 0; int progress_object_phases_total = SEQ_MAKE_EXTRA_PROGRESS((objects_to_print.size() * SEQ_PROGRESS_PHASES_PER_OBJECT)); - bool trans_bed_lepox = false; + bool trans_bed_lepox = trans_bed_glue; do { @@ -1238,6 +1245,7 @@ int schedule_ObjectsForSequentialPrint(const SolverConfiguration if (solvable_objects[i].lepox_to_next && !is_scheduled(i + 1, decided_polygons)) { split = true; + break; } } if (split)