mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 03:09:11 +08:00
Fixed unit tests for seq printing (failing after the new test was added into Print::validate)
This commit is contained in:
parent
e244eca3c2
commit
7c108ccb16
@ -1,8 +1,8 @@
|
|||||||
find_package(Z3 REQUIRED)
|
find_package(Z3 REQUIRED)
|
||||||
slic3r_remap_configs("z3::libz3" RelWithDebInfo Release)
|
slic3r_remap_configs("z3::libz3" RelWithDebInfo Release)
|
||||||
|
|
||||||
find_package(Catch2 2.9 REQUIRED)
|
#find_package(Catch2 2.9 REQUIRED)
|
||||||
include(Catch)
|
#include(Catch)
|
||||||
|
|
||||||
add_library(libseqarrange STATIC src/seq_interface.cpp src/seq_preprocess.cpp src/seq_sequential.cpp src/seq_utilities.cpp)
|
add_library(libseqarrange STATIC src/seq_interface.cpp src/seq_preprocess.cpp src/seq_sequential.cpp src/seq_utilities.cpp)
|
||||||
target_include_directories(libseqarrange PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/include/libseqarrange)
|
target_include_directories(libseqarrange PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/include/libseqarrange)
|
||||||
|
@ -175,11 +175,13 @@ static Sequential::PrinterGeometry get_printer_geometry(const ConfigBase& config
|
|||||||
}
|
}
|
||||||
if (slices.empty()) {
|
if (slices.empty()) {
|
||||||
// Fallback to primitive model using radius and height.
|
// Fallback to primitive model using radius and height.
|
||||||
coord_t r = scaled(std::max(0.1, config.opt_float("extruder_clearance_radius")));
|
coord_t r = scaled(std::max(0., config.opt_float("extruder_clearance_radius")));
|
||||||
coord_t h = scaled(std::max(0.1, config.opt_float("extruder_clearance_height")));
|
coord_t h = scaled(std::max(0.1, config.opt_float("extruder_clearance_height")));
|
||||||
slices.push_back(ExtruderSlice{ 0, CONVEX, { { { -5000000, -5000000 }, { 5000000, -5000000 }, { 5000000, 5000000 }, { -5000000, 5000000 } } } });
|
if (r > 0.001) {
|
||||||
slices.push_back(ExtruderSlice{ 1000000, BOX, { { { -r, -r }, { r, -r }, { r, r }, { -r, r } } } });
|
slices.push_back(ExtruderSlice{ 0, CONVEX, { { { -5000000, -5000000 }, { 5000000, -5000000 }, { 5000000, 5000000 }, { -5000000, 5000000 } } } });
|
||||||
slices.push_back(ExtruderSlice{ h, BOX, { { { -scaled(bed_x), -r }, { scaled(bed_x), -r }, { scaled(bed_x), r }, { -scaled(bed_x), r}}}});
|
slices.push_back(ExtruderSlice{ 1000000, BOX, { { { -r, -r }, { r, -r }, { r, r }, { -r, r } } } });
|
||||||
|
slices.push_back(ExtruderSlice{ h, BOX, { { { -scaled(bed_x), -r }, { scaled(bed_x), -r }, { scaled(bed_x), r }, { -scaled(bed_x), r}}} });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,7 +314,12 @@ bool check_seq_printability(const Model& model, const ConfigBase& config)
|
|||||||
Sequential::SolverConfiguration solver_config = get_solver_config(printer_geometry);
|
Sequential::SolverConfiguration solver_config = get_solver_config(printer_geometry);
|
||||||
std::vector<Sequential::ObjectToPrint> objects = get_objects_to_print(model, printer_geometry);
|
std::vector<Sequential::ObjectToPrint> objects = get_objects_to_print(model, printer_geometry);
|
||||||
|
|
||||||
// FIXME: This does not consider plates, non-printable objects and instances.
|
if (printer_geometry.extruder_slices.empty()) {
|
||||||
|
// If there are no data for extruder (such as extruder_clearance_radius set to 0),
|
||||||
|
// consider it printable.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
Sequential::ScheduledPlate plate;
|
Sequential::ScheduledPlate plate;
|
||||||
for (const ModelObject* mo : model.objects) {
|
for (const ModelObject* mo : model.objects) {
|
||||||
int inst_id = -1;
|
int inst_id = -1;
|
||||||
|
@ -170,7 +170,7 @@ TEST_CASE_METHOD(CancelObjectFixture, "Single extruder", "[CancelObject]") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE_METHOD(CancelObjectFixture, "Sequential print", "[CancelObject]") {
|
TEST_CASE_METHOD(CancelObjectFixture, "Sequential print", "[CancelObject]") {
|
||||||
config.set_deserialize_strict({{"complete_objects", 1}});
|
config.set_deserialize_strict({{"complete_objects", 1} });
|
||||||
|
|
||||||
Print print;
|
Print print;
|
||||||
print.apply(two_cubes, config);
|
print.apply(two_cubes, config);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user