#13356·PrusaSlicer

ClipperUtils::clip_clipper_polygon_with_subject_bbox bug

Author: supermerillCreated Sep 11, 2024Updated Sep 29, 2026
Labelslegacy-issue

Description of the bug

with this test case:

    GIVEN("weird thing"){
        Slic3r::Polygon polytest({Point{-5253696,6941803},Point{-5390322,7004051},Point{-5529994,7112838},Point{-5642583,7262245},Point{-5708854,7426076},Point{-5731772,7600991},Point{-5710375,7774699},Point{-5643429,7942791},Point{-3001108,11534999},Point{-2782155,11687851},Point{-2602580,11739919},Point{-2335818,11727897},Point{-2161635,11659878},Point{-1955359,11486297},Point{-1830017,11244692},Point{-1806677,10973499},Point{-1888105,10716510},Point{-4515353,7139500},Point{-4638040,7031082},Point{-4773007,6958051},Point{-4924657,6915497},Point{-5069276,6907438}});
        BoundingBox boxtest(Point{-1854941, 7335228}, Point{4734351, 9668157});
        Slic3r::Polygon result = ClipperUtils::clip_clipper_polygon_with_subject_bbox(polytest, boxtest);
        REQUIRE(result.empty());
    }

the ClipperUtils::clip_clipper_polygon_with_subject_bbox create a polygon with a single point. Which is clearly wrong.

Here is a picture of the polygons: grey is the bounding box, blue the polygon outline, the green point the result:

image

Project file & How to reproduce

run the test case

Checklist of files included above

  • Project file
  • Screenshot

Version of PrusaSlicer

2.7.2 but there is no change in this function in 2.8

Operating system

windows 10

Printer model

XL