c++ - Clipper2 intersecting not fully closing - Stack Overflow

So I generate 2 rectangles, one horizontally, one vertically. They actually intersect which should give

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742324562a4422485.html

相关推荐

  • c++ - Clipper2 intersecting not fully closing - Stack Overflow

    So I generate 2 rectangles, one horizontally, one vertically. They actually intersect which should give

    9小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信