mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-02 07:00:40 +08:00

WIP GCode/SmoothPath.cpp,hpp cache for interpolating extrusion path with arches. Removed Perl test t/geometry.t, replaced with C++ tests. Refactored ExtrusionEntity and derived classes to hold extrusion attributes in new ExtrusionFlow/ExtrusionAttributes classes. Reworked path ordering in G-code export to never copy polylines, but to work with a new "flipped" attribute. Reworked G-code export to interpolate extrusion paths with smooth paths and to extrude those smooth paths. New parameters: arc_fitting, arc_fitting_tolerance Renamed GCode class to GCodeGenerator Moved GCodeWriter.cpp/hpp to GCode/ Moved Wipe from from GCode.cpp,hpp to GCode/Wipe.cpp,hpp Moved WipeTowerIntegration from GCode.cpp,hpp to GCode/WipeTowerIntegration.cpp,hpp New variant of douglas_peucker() to simplify range of iterators in place. Refactored wipe in general and wipe on perimeters / hiding seams. WIP: Convert estimate_speed_from_extrusion_quality() and its application to smooth paths. WIP: Cooling buffer to process G2G3, disable arc fitting for filters that cannot process it.
23 lines
568 B
C++
23 lines
568 B
C++
#include <catch2/catch.hpp>
|
|
|
|
#include <memory>
|
|
|
|
#include "libslic3r/GCode.hpp"
|
|
|
|
using namespace Slic3r;
|
|
|
|
SCENARIO("Origin manipulation", "[GCode]") {
|
|
Slic3r::GCodeGenerator gcodegen;
|
|
WHEN("set_origin to (10,0)") {
|
|
gcodegen.set_origin(Vec2d(10,0));
|
|
REQUIRE(gcodegen.origin() == Vec2d(10, 0));
|
|
}
|
|
WHEN("set_origin to (10,0) and translate by (5, 5)") {
|
|
gcodegen.set_origin(Vec2d(10,0));
|
|
gcodegen.set_origin(gcodegen.origin() + Vec2d(5, 5));
|
|
THEN("origin returns reference to point") {
|
|
REQUIRE(gcodegen.origin() == Vec2d(15,5));
|
|
}
|
|
}
|
|
}
|