KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_custom_pad_primitive_roundtrip.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <base_units.h>
#include <board.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_point.h>
#include <pcb_shape.h>
#include <geometry/eda_angle.h>
#include <geometry/shape_line_chain.h>
#include <geometry/shape_poly_set.h>
#include <pcbnew_utils/board_file_utils.h>
#include <filesystem>
#include <memory>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (BezierAndPolyOnTransformedFootprint)
 A custom pad's bezier and polygon primitives must survive a save/reload unchanged, even when the parent footprint carries a non-trivial transform (rotated + non-uniform scale).
 
 BOOST_AUTO_TEST_CASE (ScaledFootprintRoundTripStable)
 
 BOOST_AUTO_TEST_CASE (PadPositionAndOrientationRoundTripStable)
 
 BOOST_AUTO_TEST_CASE (PadDeltaRoundTripStable)
 
 BOOST_AUTO_TEST_CASE (PadOffsetRoundTripStable)
 
 BOOST_AUTO_TEST_CASE (FootprintPointRoundTripStable)
 
 BOOST_AUTO_TEST_CASE (RotatedPadSizeRoundTripStable)
 
 BOOST_AUTO_TEST_CASE (PadSizeScalesAlongFootprintAxisRegardlessOfPadOrientation)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/8]

BOOST_AUTO_TEST_CASE ( BezierAndPolyOnTransformedFootprint )

A custom pad's bezier and polygon primitives must survive a save/reload unchanged, even when the parent footprint carries a non-trivial transform (rotated + non-uniform scale).

Pad primitives are stored in raw library coordinates and are not baked by the footprint transform, so the writer must emit those raw coordinates: applying the footprint transform on save (but reading raw on load) corrupts the round-trip.

Definition at line 113 of file test_custom_pad_primitive_roundtrip.cpp.

References SHAPE_POLY_SET::AddOutline(), PADSTACK::ALL_LAYERS, APPEND, BEZIER, BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), chain, CIRCLE, CUSTOM, DEGREES_T, KI_TEST::DumpBoardToFile(), F_Cu, PCB_SHAPE::GetLibraryBezierC1(), PCB_SHAPE::GetLibraryBezierC2(), PCB_SHAPE::GetLibraryEnd(), PCB_SHAPE::GetLibraryPolyShape(), PCB_SHAPE::GetLibraryStart(), PCB_SHAPE::GetWidth(), SHAPE::GetWidth(), EDA_SHAPE::IsPolyShapeValid(), pad, FOOTPRINT::Pads(), POLY, KI_TEST::ReadBoardFromFileOrStream(), SMD, VECTOR2< T >::x, and VECTOR2< T >::y.

◆ BOOST_AUTO_TEST_CASE() [2/8]

◆ BOOST_AUTO_TEST_CASE() [3/8]

◆ BOOST_AUTO_TEST_CASE() [4/8]

◆ BOOST_AUTO_TEST_CASE() [5/8]

◆ BOOST_AUTO_TEST_CASE() [6/8]

◆ BOOST_AUTO_TEST_CASE() [7/8]

◆ BOOST_AUTO_TEST_CASE() [8/8]