Skip to content

Commit

Permalink
Merge pull request #501 from LibrePCB/500-fix-plane-board-outlines
Browse files Browse the repository at this point in the history
Fix missing plane cut-out for board outlines in footprints
(cherry picked from commit 4df4887)
  • Loading branch information
ubruhin committed Nov 17, 2019
1 parent 02d2f08 commit 40bdff3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libs/librepcb/project/boards/boardplanefragmentsbuilder.cpp
Expand Up @@ -100,6 +100,20 @@ void BoardPlaneFragmentsBuilder::clipToBoardOutline() {
boardAreaClipper.AddPath(path, ClipperLib::ptSubject, true);
}
}
foreach (const BI_Device* device, mPlane.getBoard().getDeviceInstances()) {
const BI_Footprint& footprint = device->getFootprint();
for (const Polygon& polygon : device->getLibFootprint().getPolygons()) {
if (polygon.getLayerName() == GraphicsLayer::sBoardOutlines) {
Path path = polygon.getPath();
path.rotate(footprint.getRotation());
if (footprint.getIsMirrored()) path.mirror(Qt::Horizontal);
path.translate(footprint.getPosition());
ClipperLib::Path clipperPath =
ClipperHelpers::convert(path, maxArcTolerance());
boardAreaClipper.AddPath(clipperPath, ClipperLib::ptSubject, true);
}
}
}
boardAreaClipper.Execute(ClipperLib::ctXor, boardArea, ClipperLib::pftEvenOdd,
ClipperLib::pftEvenOdd);

Expand Down

0 comments on commit 40bdff3

Please sign in to comment.