1 #include <catch2/catch.hpp>
2 
3 #include <memory>
4 
5 #include "libslic3r/GCode.hpp"
6 
7 using namespace Slic3r;
8 
9 SCENARIO("Origin manipulation", "[GCode]") {
10 	Slic3r::GCode gcodegen;
11 	WHEN("set_origin to (10,0)") {
12     	gcodegen.set_origin(Vec2d(10,0));
13     	REQUIRE(gcodegen.origin() == Vec2d(10, 0));
14     }
15 	WHEN("set_origin to (10,0) and translate by (5, 5)") {
16 		gcodegen.set_origin(Vec2d(10,0));
17 		gcodegen.set_origin(gcodegen.origin() + Vec2d(5, 5));
18 		THEN("origin returns reference to point") {
19     		REQUIRE(gcodegen.origin() == Vec2d(15,5));
20     	}
21     }
22 }
23