KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_ipc2581.cpp File Reference
#include <filesystem>
#include <fstream>
#include <iterator>
#include <map>
#include <string>
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <pcbnew/pcb_io/ipc2581/pcb_io_ipc2581.h>
#include <board.h>
#include <footprint.h>
#include <pad.h>
#include <lset.h>
#include <base_units.h>
#include <core/mirror.h>
#include <wx/filename.h>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (Issue18013_FlippedFootprintRotation)
 Test that flipped footprint rotations are exported to IPC-2581 with the board-top adjustment applied.
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( Issue18013_FlippedFootprintRotation )

Test that flipped footprint rotations are exported to IPC-2581 with the board-top adjustment applied.

Per IPC-2581 the Component rotation is viewed from the board top while mirror="true" accounts for the bottom placement, so a flipped footprint at board orientation A is exported as ( -A - 180 ) normalized into [0, 360). A footprint flipped with no rotation therefore exports rotation="180.0", and one at 30 degrees exports rotation="150.0".

Regression test for https://gitlab.com/kicad/code/kicad/-/issues/18013. A 30 degree angle is used deliberately because 90 and 270 are fixed points of the transform and so cannot distinguish the corrected formula from the unadjusted one.

Definition at line 56 of file test_ipc2581.cpp.

References BOARD::Add(), FOOTPRINT::Add(), PADSTACK::ALL_LAYERS, BOOST_AUTO_TEST_CASE(), BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), end, F_Cu, F_Mask, FOOTPRINT::Flip(), FOOTPRINT, FOOTPRINT::GetPosition(), FOOTPRINT::IsFlipped(), PAD, pad, pcbIUScale, RECTANGLE, PCB_IO_IPC2581::SaveBoard(), FOOTPRINT::SetOrientationDegrees(), FOOTPRINT::SetPosition(), FOOTPRINT::SetReference(), SMD, top(), and TOP_BOTTOM.