admin管理员组

文章数量:1333725

So I generate 2 rectangles, one horizontally, one vertically. They actually intersect which should give a closed square but I do get an open square. Im pretty sure there is nothing wrong with creating the paths, something wrong intersecting.What might cause this?:

PathD generateHorRectangle(float density, float nozzleThickness, PointD min, PointD max)
{
    PathD infill;
    float x = min.x;
    float y = min.y;

    PointD current = {x, y};
    infill.push_back(current);
    current.x = max.x;
    infill.push_back(current);
    current.y += step;
    infill.push_back(current);
    current.x = min.x;
    infill.push_back(current);
    current = {x, y};
    infill.push_back(current);
    return infill;
}
PathD horizontalRectangle = generateHorRectangle(state.infillDensity, printer.getNozzle(), min, max);
PathD verticalRectangle = generateVerRectangle(state.infillDensity, printer.getNozzle(), min, max);
auto intersectOfLeftCornerShouldBeSquare = Intersect({horizontalRectangle}, {verticalRectangle}, FillRule::EvenOdd);

Result I get.

本文标签: cClipper2 intersecting not fully closingStack Overflow