mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-31 20:02:02 +08:00
Use approx with a margin instead of trying for exact floating point matches.
This commit is contained in:
parent
5b06201e18
commit
1ea86dcb5d
@ -37,7 +37,7 @@ SCENARIO("Extrusion width specifics", "[!mayfail]") {
|
|||||||
const auto layer_height { config->getFloat("layer_height") };
|
const auto layer_height { config->getFloat("layer_height") };
|
||||||
parser.parse_stream(gcode, [&E_per_mm_bottom, layer_height] (Slic3r::GCodeReader& self, const Slic3r::GCodeReader::GCodeLine& line)
|
parser.parse_stream(gcode, [&E_per_mm_bottom, layer_height] (Slic3r::GCodeReader& self, const Slic3r::GCodeReader::GCodeLine& line)
|
||||||
{
|
{
|
||||||
if (self.Z == layer_height) { // only consider first layer
|
if (self.Z == Approx(layer_height).margin(0.01)) { // only consider first layer
|
||||||
if (line.extruding() && line.dist_XY() > 0) {
|
if (line.extruding() && line.dist_XY() > 0) {
|
||||||
E_per_mm_bottom.emplace_back(line.dist_E() / line.dist_XY());
|
E_per_mm_bottom.emplace_back(line.dist_E() / line.dist_XY());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user