Ported custom_gcode and print unit tests from Perl to C++.
This commit is contained in:
parent
6ab517187f
commit
e687db9eb0
10 changed files with 289 additions and 453 deletions
|
@ -13,6 +13,7 @@
|
|||
#include <boost/nowide/cstdio.hpp>
|
||||
#include <boost/nowide/fstream.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
#include <libslic3r/ModelArrange.hpp>
|
||||
|
||||
using namespace std;
|
||||
|
@ -228,6 +229,7 @@ void init_print(std::vector<TriangleMesh> &&meshes, Slic3r::Print &print, Slic3r
|
|||
object->add_instance();
|
||||
}
|
||||
arrange_objects(model, InfiniteBed{}, ArrangeParams{ scaled(min_object_distance(config))});
|
||||
model.center_instances_around_point({100, 100});
|
||||
for (ModelObject *mo : model.objects) {
|
||||
mo->ensure_on_bed();
|
||||
print.auto_assign_extruders(mo);
|
||||
|
@ -352,6 +354,17 @@ std::string slice(std::initializer_list<TriangleMesh> meshes, std::initializer_l
|
|||
return gcode(print);
|
||||
}
|
||||
|
||||
bool contains(const std::string &data, const std::string &pattern)
|
||||
{
|
||||
return data.find(pattern) != data.npos;
|
||||
}
|
||||
|
||||
bool contains_regex(const std::string &data, const std::string &pattern)
|
||||
{
|
||||
boost::regex re(pattern);
|
||||
return boost::regex_match(data, re);
|
||||
}
|
||||
|
||||
} } // namespace Slic3r::Test
|
||||
|
||||
#include <catch2/catch.hpp>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue