diff options
author | tamasmeszaros <meszaros.q@gmail.com> | 2020-04-23 19:19:03 +0300 |
---|---|---|
committer | tamasmeszaros <meszaros.q@gmail.com> | 2020-04-23 19:19:03 +0300 |
commit | 1bffc2b99bedb0d0d76baeec52523dc1fef737e1 (patch) | |
tree | ac55976385137cc0d2ec3914a9ef34d7b9d6531a /tests | |
parent | 44ca0a6c3d8857428d0b59c5c35859442724928d (diff) |
Add ModelArrange.hpp as extension to Model.hpp, use it for duplicating
Refactored Arrange interface: remove the union based BedShapeHint, replace it with proper function overloads
WARN: this commit is only intermediate, it does not compile.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fff_print/test_data.cpp | 4 | ||||
-rw-r--r-- | tests/fff_print/test_model.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/fff_print/test_data.cpp b/tests/fff_print/test_data.cpp index 77c82d77b..70f82f4a5 100644 --- a/tests/fff_print/test_data.cpp +++ b/tests/fff_print/test_data.cpp @@ -12,6 +12,7 @@ #include <boost/nowide/cstdio.hpp> #include <boost/filesystem.hpp> +#include <libslic3r/ModelArrange.hpp> using namespace std; @@ -167,8 +168,7 @@ void init_print(std::vector<TriangleMesh> &&meshes, Slic3r::Print &print, Slic3r object->add_volume(std::move(t)); object->add_instance(); } - model.arrange_objects(min_object_distance(config)); - model.center_instances_around_point(Slic3r::Vec2d(100, 100)); + arrange_objects(model, InfiniteBed{}, ArrangeParams{ scaled(min_object_distance(config))}); for (ModelObject *mo : model.objects) { mo->ensure_on_bed(); print.auto_assign_extruders(mo); diff --git a/tests/fff_print/test_model.cpp b/tests/fff_print/test_model.cpp index addb2cd7a..6cb926621 100644 --- a/tests/fff_print/test_model.cpp +++ b/tests/fff_print/test_model.cpp @@ -2,6 +2,7 @@ #include "libslic3r/libslic3r.h" #include "libslic3r/Model.hpp" +#include "libslic3r/ModelArrange.hpp" #include <boost/nowide/cstdio.hpp> #include <boost/filesystem.hpp> @@ -41,8 +42,7 @@ SCENARIO("Model construction", "[Model]") { } } model_object->add_instance(); - model.arrange_objects(min_object_distance(config)); - model.center_instances_around_point(Slic3r::Vec2d(100, 100)); + arrange_objects(model, InfiniteBed{scaled(Vec2d(100, 100))}, ArrangeParams{scaled(min_object_distance(config))}); model_object->ensure_on_bed(); print.auto_assign_extruders(model_object); THEN("Print works?") { |