Fix invalid extrusion expand value in SeamGeometry

This commit is contained in:
Martin Šach 2024-07-18 13:00:13 +02:00 committed by Lukas Matena
parent ef2a64032a
commit a56bd7e21d
2 changed files with 2 additions and 2 deletions

View File

@ -215,7 +215,7 @@ BoundedPolygons project_to_geometry(const Geometry::Extrusions &external_perimet
)};
if (distance > max_bb_distance) {
Polygons expanded_extrusion{expand(external_perimeter.polygon, external_perimeter.width / 2.0)};
Polygons expanded_extrusion{expand(external_perimeter.polygon, Slic3r::scaled(external_perimeter.width / 2.0))};
if (!expanded_extrusion.empty()) {
return BoundedPolygon{
expanded_extrusion.front(), expanded_extrusion.front().bounding_box(), external_perimeter.polygon.is_clockwise(), 0.0

View File

@ -52,7 +52,7 @@ TEST_CASE_METHOD(ProjectionFixture, "Project to geometry does not match", "[Seam
REQUIRE(result.size() == 1);
REQUIRE(result[0].polygon.size() == 4);
const Polygon expanded{expand(extrusions.front().polygon, extrusion_width / 2.0).front()};
const Polygon expanded{expand(extrusions.front().polygon, scaled(extrusion_width / 2.0)).front()};
// The extrusion is expanded and returned.
CHECK(result[0].polygon == expanded);