KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_zone_filler.cpp File Reference
#include <qa_utils/wx_utils/unit_test_utils.h>
#include <boost/test/data/test_case.hpp>
#include <pcbnew_utils/board_test_utils.h>
#include <board.h>
#include <board_commit.h>
#include <board_design_settings.h>
#include <drc/drc_engine.h>
#include <pad.h>
#include <pcb_track.h>
#include <footprint.h>
#include <zone.h>
#include <drc/drc_item.h>
#include <settings/settings_manager.h>
#include <geometry/shape_poly_set.h>
#include <advanced_config.h>
#include <connectivity/connectivity_data.h>
#include <teardrop/teardrop.h>

Go to the source code of this file.

Classes

struct  ZONE_FILL_TEST_FIXTURE
 

Functions

 BOOST_FIXTURE_TEST_CASE (BasicZoneFills, ZONE_FILL_TEST_FIXTURE)
 
 BOOST_FIXTURE_TEST_CASE (NotchedZones, ZONE_FILL_TEST_FIXTURE)
 
 BOOST_DATA_TEST_CASE_F (ZONE_FILL_TEST_FIXTURE, RegressionZoneFillTests, boost::unit_test::data::make(RegressionZoneFillTests_tests), relPath)
 
 BOOST_FIXTURE_TEST_CASE (RegressionZoneClearanceWithIterativeRefill, ZONE_FILL_TEST_FIXTURE)
 Test for issue 23053: Zone clearance violations between zones with iterative refill.
 
 BOOST_DATA_TEST_CASE_F (ZONE_FILL_TEST_FIXTURE, RegressionSliverZoneFillTests, boost::unit_test::data::make(RegressionSliverZoneFillTests_tests), relPath)
 
 BOOST_DATA_TEST_CASE_F (ZONE_FILL_TEST_FIXTURE, RegressionTeardropFill, boost::unit_test::data::make(RegressionTeardropFill_tests), test)
 
 BOOST_FIXTURE_TEST_CASE (RegressionNetTie, ZONE_FILL_TEST_FIXTURE)
 
 BOOST_FIXTURE_TEST_CASE (RegressionZonePriorityIsolatedIslands, ZONE_FILL_TEST_FIXTURE)
 Test for issue 21746: Lower priority zones should fill areas where higher priority zones have isolated islands that get removed.
 
 BOOST_FIXTURE_TEST_CASE (RegressionViaFlashingUnreachableZone, ZONE_FILL_TEST_FIXTURE)
 Test for issue 22010: Via annular rings should not appear on zone layers when the zone fill doesn't actually reach the via.
 
 BOOST_FIXTURE_TEST_CASE (RegressionViaZoneNetShort, ZONE_FILL_TEST_FIXTURE)
 Test for issue 12964: Vias with remove_unused_layers should not flash on layers where they would short to a zone with a different net.
 
 BOOST_FIXTURE_TEST_CASE (HatchZoneThermalConnectivity, ZONE_FILL_TEST_FIXTURE)
 Test that hatch zone thermal reliefs maintain connectivity even when the hatch gap is larger than the thermal ring diameter.
 
 BOOST_FIXTURE_TEST_CASE (RegressionShallowArcZoneFill, ZONE_FILL_TEST_FIXTURE)
 Test for issue 22475: Zone fill should not produce artifacts when tracks contain shallow-radius arcs (where the mid-point is nearly collinear with start and end).
 
 BOOST_FIXTURE_TEST_CASE (RegressionIterativeRefillRespectsKeepouts, ZONE_FILL_TEST_FIXTURE)
 Test for issue 22809: Zone keepouts should be respected by iterative refiller.
 
 BOOST_FIXTURE_TEST_CASE (RegressionTHPadInnerLayerFlashing, ZONE_FILL_TEST_FIXTURE)
 Test for issue 22826: TH pads with remove_unused_layers should properly flash on inner layers when inside a zone of the same net.
 
 BOOST_FIXTURE_TEST_CASE (RegressionRoundRectTeardropGeometry, ZONE_FILL_TEST_FIXTURE)
 Test for issue 19405: Rounded teardrop geometry should not create concave shapes when connecting to rounded rectangle pads at corners.
 
 BOOST_FIXTURE_TEST_CASE (OvalPadTeardropGeometry, ZONE_FILL_TEST_FIXTURE)
 Test that teardrops connecting to oval pads at their curved ends have proper tangent curves.
 
 BOOST_FIXTURE_TEST_CASE (LargeCircleTeardropGeometry, ZONE_FILL_TEST_FIXTURE)
 Test that teardrops connecting to large circular pads maintain proper tangent contact.
 
 BOOST_FIXTURE_TEST_CASE (RegressionCoincidentPadClearance, ZONE_FILL_TEST_FIXTURE)
 Test for issue 23123: Coincident pads from different footprints with different nets must each get proper zone treatment.
 
 BOOST_FIXTURE_TEST_CASE (ZoneViaNetClearance, ZONE_FILL_TEST_FIXTURE)
 Verify zone fills clear PTH pads on different nets.
 
 BOOST_FIXTURE_TEST_CASE (ZoneLayerSpecificRules, ZONE_FILL_TEST_FIXTURE)
 Verify that custom DRC rules with identical conditions but different layer scopes are both applied correctly during zone fill.
 
 BOOST_FIXTURE_TEST_CASE (RegressionZoneFillMinWidthAfterKnockout, ZONE_FILL_TEST_FIXTURE)
 
 BOOST_FIXTURE_TEST_CASE (RegressionSameNetOverlappingZones, ZONE_FILL_TEST_FIXTURE)
 
 BOOST_FIXTURE_TEST_CASE (RegressionDiffNetOverlappingZones, ZONE_FILL_TEST_FIXTURE)
 
 BOOST_FIXTURE_TEST_CASE (RegressionThermalReliefsToNowhere, ZONE_FILL_TEST_FIXTURE)
 Test for issue 23535: Thermal relief spokes should not extend into areas knocked out by higher-priority zones on different nets.
 
 BOOST_FIXTURE_TEST_CASE (OffCenterTeardropSymmetry, ZONE_FILL_TEST_FIXTURE)
 Test for issue 23380: Teardrops on off-center tracks should be approximately symmetric about the track axis.
 
 BOOST_FIXTURE_TEST_CASE (RegressionKeepoutBoundaryMissingFill, ZONE_FILL_TEST_FIXTURE)
 Test for issue 23515: Zone fills have random pieces missing near keepout boundaries.
 
 BOOST_FIXTURE_TEST_CASE (HatchZoneViaConnectionRespectsSetting, ZONE_FILL_TEST_FIXTURE)
 Test for issue 23516: Vias in hatched fill zones should respect the zone connection setting (FULL vs THERMAL).
 

Variables

int delta = KiROUND( 0.006 * pcbIUScale.IU_PER_MM )
 
static const std::vector< wxString > RegressionZoneFillTests_tests
 
static const std::vector< wxString > RegressionSliverZoneFillTests_tests
 
static const std::vector< std::pair< wxString, int > > RegressionTeardropFill_tests
 

Function Documentation

◆ BOOST_DATA_TEST_CASE_F() [1/3]

◆ BOOST_DATA_TEST_CASE_F() [2/3]

BOOST_DATA_TEST_CASE_F ( ZONE_FILL_TEST_FIXTURE ,
RegressionTeardropFill ,
boost::unit_test::data::make(RegressionTeardropFill_tests) ,
test  )

◆ BOOST_DATA_TEST_CASE_F() [3/3]

◆ BOOST_FIXTURE_TEST_CASE() [1/24]

◆ BOOST_FIXTURE_TEST_CASE() [2/24]

BOOST_FIXTURE_TEST_CASE ( HatchZoneThermalConnectivity ,
ZONE_FILL_TEST_FIXTURE  )

Test that hatch zone thermal reliefs maintain connectivity even when the hatch gap is larger than the thermal ring diameter.

The test board has:

  • A hatch zone with large gap (6mm) and thermal relief settings
  • A pad with thermal relief connection to the zone
  • A track that should be connected to the pad via the zone

Without the fix, the thermal ring around the pad could be entirely inside a hatch hole, leaving it electrically isolated from the zone webbing.

Definition at line 687 of file test_zone_filler.cpp.

References BOOST_CHECK_MESSAGE(), KI_TEST::FillZones(), and KI_TEST::LoadBoard().

◆ BOOST_FIXTURE_TEST_CASE() [3/24]

BOOST_FIXTURE_TEST_CASE ( HatchZoneViaConnectionRespectsSetting ,
ZONE_FILL_TEST_FIXTURE  )

Test for issue 23516: Vias in hatched fill zones should respect the zone connection setting (FULL vs THERMAL).

Before this fix, thermal relief was always forced on all vias in hatch-fill zones regardless of the zone's "Pad connections" setting.

With FULL connection, the zone fill should touch the via directly. With THERMAL connection, the fill is cut away around the via with a thermal gap.

Definition at line 1887 of file test_zone_filler.cpp.

References std::abs(), ZONE::AddPolygon(), PADSTACK::ALL_LAYERS, SHAPE_POLY_SET::Append(), B_Cu, BOOST_CHECK_MESSAGE(), SHAPE_POLY_SET::COutline(), F_Cu, KI_TEST::FillZones(), FULL, ZONE::GetFilledPolysList(), NETINFO_ITEM::GetNetCode(), ZONE::HasFilledPolysForLayer(), HATCH_PATTERN, BOARD_DESIGN_SETTINGS::m_DRCEngine, BOARD_DESIGN_SETTINGS::m_MinClearance, SHAPE_POLY_SET::NewOutline(), pcbIUScale, BOARD_DESIGN_SETTINGS::SetCopperLayerCount(), ZONE::SetFillMode(), ZONE::SetHatchGap(), ZONE::SetHatchThickness(), ZONE::SetLayer(), ZONE::SetMinThickness(), BOARD_CONNECTED_ITEM::SetNetCode(), ZONE::SetPadConnection(), ZONE::SetThermalReliefGap(), ZONE::SetThermalReliefSpokeWidth(), THERMAL, and via.

◆ BOOST_FIXTURE_TEST_CASE() [4/24]

BOOST_FIXTURE_TEST_CASE ( LargeCircleTeardropGeometry ,
ZONE_FILL_TEST_FIXTURE  )

Test that teardrops connecting to large circular pads maintain proper tangent contact.

When a circle is larger than the configured teardrop max width, the anchor points should still be on the actual circle edge (not on a clipped boundary) to ensure the teardrop curve is tangent to the circle.

Definition at line 1119 of file test_zone_filler.cpp.

References _, std::abs(), BOOST_CHECK_MESSAGE(), BOOST_TEST_MESSAGE(), chain, CIRCLE, COMMIT::Empty(), F_Cu, PAD::GetPosition(), PAD::GetSize(), KI_TEST::LoadBoard(), next(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), pad, BOARD_COMMIT::Push(), TOOL_MANAGER::RegisterTool(), TOOL_MANAGER::SetEnvironment(), SKIP_SET_DIRTY, SKIP_UNDO, TEARDROP_MANAGER::UpdateTeardrops(), v1, v2, and VECTOR2< T >::x.

◆ BOOST_FIXTURE_TEST_CASE() [5/24]

◆ BOOST_FIXTURE_TEST_CASE() [6/24]

BOOST_FIXTURE_TEST_CASE ( OffCenterTeardropSymmetry ,
ZONE_FILL_TEST_FIXTURE  )

Test for issue 23380: Teardrops on off-center tracks should be approximately symmetric about the track axis.

When a track connects to a pad off-center (not through the pad center), the teardrop shape should still flare out symmetrically from the track. Before the fix, the teardrop axis was computed from the track to the pad center, causing the clipping rectangle (and thus the anchor points) to be skewed relative to the track path.

Definition at line 1716 of file test_zone_filler.cpp.

References _, BOOST_CHECK_MESSAGE(), chain, COMMIT::Empty(), KI_TEST::LoadBoard(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), pcbIUScale, BOARD_COMMIT::Push(), TOOL_MANAGER::RegisterTool(), TOOL_MANAGER::SetEnvironment(), SKIP_SET_DIRTY, SKIP_UNDO, and TEARDROP_MANAGER::UpdateTeardrops().

◆ BOOST_FIXTURE_TEST_CASE() [7/24]

BOOST_FIXTURE_TEST_CASE ( OvalPadTeardropGeometry ,
ZONE_FILL_TEST_FIXTURE  )

Test that teardrops connecting to oval pads at their curved ends have proper tangent curves.

Oval pads have semicircular ends. When a track connects to the curved end, the teardrop curve should be tangent to the semicircle, similar to how rounded rectangle corners are handled.

Definition at line 1041 of file test_zone_filler.cpp.

References _, BOOST_CHECK_MESSAGE(), BOOST_TEST_MESSAGE(), chain, COMMIT::Empty(), KI_TEST::LoadBoard(), next(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), BOARD_COMMIT::Push(), TOOL_MANAGER::RegisterTool(), TOOL_MANAGER::SetEnvironment(), SKIP_SET_DIRTY, SKIP_UNDO, TEARDROP_MANAGER::UpdateTeardrops(), v1, and v2.

◆ BOOST_FIXTURE_TEST_CASE() [8/24]

BOOST_FIXTURE_TEST_CASE ( RegressionCoincidentPadClearance ,
ZONE_FILL_TEST_FIXTURE  )

Test for issue 23123: Coincident pads from different footprints with different nets must each get proper zone treatment.

When two pads occupy the same position with the same geometry but different nets, the zone filler's deduplication must not skip the second pad. A pad whose net differs from the zone needs clearance; a pad matching the zone net gets thermal relief. If the deduplication key omits the net code, the second pad is silently dropped and no clearance is created.

Definition at line 1244 of file test_zone_filler.cpp.

References BOOST_CHECK_MESSAGE(), BOOST_TEST_MESSAGE(), clearance, KI_TEST::FillZones(), KI_TEST::LoadBoard(), and pad.

◆ BOOST_FIXTURE_TEST_CASE() [9/24]

◆ BOOST_FIXTURE_TEST_CASE() [10/24]

BOOST_FIXTURE_TEST_CASE ( RegressionIterativeRefillRespectsKeepouts ,
ZONE_FILL_TEST_FIXTURE  )

Test for issue 22809: Zone keepouts should be respected by iterative refiller.

The test board has:

  • A net zone that covers most of the board
  • Several zone keepouts (rule areas with copperpour not_allowed)

Before the fix, when iterative refill was enabled (ADVANCED_CFG::m_ZoneFillIterativeRefill), zone keepouts were being completely ignored because the code path that handled keepouts (buildCopperItemClearances with aIncludeZoneClearances=true) was skipped when iterative refill was enabled. Additionally, refillZoneFromCache did not subtract keepouts.

Definition at line 784 of file test_zone_filler.cpp.

References std::abs(), SHAPE_LINE_CHAIN::Area(), SHAPE_POLY_SET::BooleanIntersection(), BOOST_CHECK_MESSAGE(), BOOST_TEST_MESSAGE(), SHAPE_POLY_SET::ClearArcs(), KI_TEST::FillZones(), ADVANCED_CFG::GetCfg(), KI_TEST::LoadBoard(), ADVANCED_CFG::m_ZoneFillIterativeRefill, SHAPE_POLY_SET::Outline(), and SHAPE_POLY_SET::OutlineCount().

◆ BOOST_FIXTURE_TEST_CASE() [11/24]

BOOST_FIXTURE_TEST_CASE ( RegressionKeepoutBoundaryMissingFill ,
ZONE_FILL_TEST_FIXTURE  )

Test for issue 23515: Zone fills have random pieces missing near keepout boundaries.

The test board is a reporter-provided v9 board file with stored zone fill from the v9 algorithm. That stored fill is the oracle. Re-filling the same board with the current algorithm should not lose noticeable area near keepout boundaries.

Definition at line 1800 of file test_zone_filler.cpp.

References std::abs(), BOOST_CHECK_MESSAGE(), KI_TEST::FillZones(), ADVANCED_CFG::GetCfg(), KI_TEST::LoadBoard(), ADVANCED_CFG::m_ZoneFillIterativeRefill, and totalArea.

◆ BOOST_FIXTURE_TEST_CASE() [12/24]

BOOST_FIXTURE_TEST_CASE ( RegressionNetTie ,
ZONE_FILL_TEST_FIXTURE  )

◆ BOOST_FIXTURE_TEST_CASE() [13/24]

BOOST_FIXTURE_TEST_CASE ( RegressionRoundRectTeardropGeometry ,
ZONE_FILL_TEST_FIXTURE  )

Test for issue 19405: Rounded teardrop geometry should not create concave shapes when connecting to rounded rectangle pads at corners.

The test board has a rounded rectangle pad with a track connecting to its short side (hitting the corner radius). With curved teardrops enabled, the teardrop should not intersect the pad's corner radius, which would create sharp inside corners.

Definition at line 954 of file test_zone_filler.cpp.

References _, BOOST_CHECK_MESSAGE(), BOOST_TEST_MESSAGE(), chain, COMMIT::Empty(), KI_TEST::LoadBoard(), next(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), BOARD_COMMIT::Push(), TOOL_MANAGER::RegisterTool(), TOOL_MANAGER::SetEnvironment(), SKIP_SET_DIRTY, SKIP_UNDO, TEARDROP_MANAGER::UpdateTeardrops(), v1, and v2.

◆ BOOST_FIXTURE_TEST_CASE() [14/24]

◆ BOOST_FIXTURE_TEST_CASE() [15/24]

BOOST_FIXTURE_TEST_CASE ( RegressionShallowArcZoneFill ,
ZONE_FILL_TEST_FIXTURE  )

Test for issue 22475: Zone fill should not produce artifacts when tracks contain shallow-radius arcs (where the mid-point is nearly collinear with start and end).

The test board has:

  • A GND zone on In1.Cu
  • PCB_ARC tracks with very shallow radii causing mid-points to be within 250µm of the start-end line

Before the fix, these shallow arcs caused TransformArcToPolygon to compute extremely large radii, leading to integer overflow and invalid clearance hole geometry. This resulted in phantom voids and disconnected fill areas in the zone.

The fix treats arcs with mid-point distance <= 250µm from the chord as straight line segments, avoiding numerical instability.

Definition at line 722 of file test_zone_filler.cpp.

References std::abs(), SHAPE_POLY_SET::Area(), BOOST_CHECK_EQUAL(), KI_TEST::FillZones(), ZONE::GetFilledPolysList(), ZONE::HasFilledPolysForLayer(), KI_TEST::LoadBoard(), and ZONE::Outline().

◆ BOOST_FIXTURE_TEST_CASE() [16/24]

BOOST_FIXTURE_TEST_CASE ( RegressionThermalReliefsToNowhere ,
ZONE_FILL_TEST_FIXTURE  )

Test for issue 23535: Thermal relief spokes should not extend into areas knocked out by higher-priority zones on different nets.

The test board has:

  • A GND zone (priority 0) covering x=0..12mm
  • A VCC zone (priority 1) covering x=8..20mm
  • An SMD pad at (6.5, 5) on net GND with thermal relief connection

The VCC zone knockout removes GND copper from roughly x=7.5 onward (VCC boundary at x=8 minus 0.5mm clearance). The pad's thermal gap extends to x=7.75 on the right side. Without the fix, a right-pointing thermal spoke is incorrectly kept because the spoke endpoint test area does not account for zone-to-zone clearances. This leaves a stub of copper in the thermal gap that does not connect to zone copper.

Definition at line 1653 of file test_zone_filler.cpp.

References BOOST_CHECK_MESSAGE(), BOOST_REQUIRE(), F_Cu, KI_TEST::FillZones(), ADVANCED_CFG::GetCfg(), ZONE::GetFilledPolysList(), ZONE::HasFilledPolysForLayer(), KI_TEST::LoadBoard(), ADVANCED_CFG::m_ZoneFillIterativeRefill, and pcbIUScale.

◆ BOOST_FIXTURE_TEST_CASE() [17/24]

BOOST_FIXTURE_TEST_CASE ( RegressionTHPadInnerLayerFlashing ,
ZONE_FILL_TEST_FIXTURE  )

Test for issue 22826: TH pads with remove_unused_layers should properly flash on inner layers when inside a zone of the same net.

The test board has:

  • TH pads with remove_unused_layers enabled, on the VBUS_DUT net
  • A VBUS_DUT zone on In2.Cu
  • Pads that are within the zone boundary

Before the fix, the zone filler checked if fill->Contains(pad_center) without tolerance, which would fail because the fill has a thermal relief cutout around the pad. The fix uses the pad's drill radius as tolerance, similar to how vias are handled.

Definition at line 878 of file test_zone_filler.cpp.

References BOOST_CHECK_MESSAGE(), BOOST_TEST_MESSAGE(), KI_TEST::FillZones(), KI_TEST::LoadBoard(), and pad.

◆ BOOST_FIXTURE_TEST_CASE() [18/24]

BOOST_FIXTURE_TEST_CASE ( RegressionViaFlashingUnreachableZone ,
ZONE_FILL_TEST_FIXTURE  )

Test for issue 22010: Via annular rings should not appear on zone layers when the zone fill doesn't actually reach the via.

The test board has:

  • A GND zone on In1.Cu and In2.Cu with large clearance
  • GND vias with "remove unused layers" and "keep start/end layers" enabled
  • Tracks that block the zone fill from reaching some vias

Before the fix, vias within the zone outline would flash even if the zone fill didn't reach them due to obstacles (tracks). This caused false DRC violations for clearances and blocked dense routing near the vias.

Definition at line 512 of file test_zone_filler.cpp.

References BOOST_CHECK_MESSAGE(), BOOST_TEST_MESSAGE(), KI_TEST::FillZones(), KI_TEST::LoadBoard(), PCB_VIA_T, and via.

◆ BOOST_FIXTURE_TEST_CASE() [19/24]

BOOST_FIXTURE_TEST_CASE ( RegressionViaZoneNetShort ,
ZONE_FILL_TEST_FIXTURE  )

Test for issue 12964: Vias with remove_unused_layers should not flash on layers where they would short to a zone with a different net.

The test board has:

  • GND vias (net 1) with remove_unused_layers enabled
  • A +3.3V zone (net 2) on F.Cu that the vias pass through
  • A GND zone (net 1) on F.Cu

After zone fill, the vias should NOT flash on F.Cu in areas covered by the +3.3V zone, as that would short GND to +3.3V.

Definition at line 609 of file test_zone_filler.cpp.

References BOOST_CHECK_MESSAGE(), BOOST_TEST_MESSAGE(), KI_TEST::FillZones(), KI_TEST::LoadBoard(), PCB_VIA_T, via, VECTOR2< T >::x, and VECTOR2< T >::y.

◆ BOOST_FIXTURE_TEST_CASE() [20/24]

BOOST_FIXTURE_TEST_CASE ( RegressionZoneClearanceWithIterativeRefill ,
ZONE_FILL_TEST_FIXTURE  )

Test for issue 23053: Zone clearance violations between zones with iterative refill.

When iterative refill is enabled, zone-to-zone clearance knockouts were applied after the min-width deflate/inflate cycle. The reinflation could push copper into the zone clearance area, causing DRC clearance violations between different-net zones.

Also verifies the non-iterative path produces no violations on the same board.

Definition at line 245 of file test_zone_filler.cpp.

References BOOST_CHECK_MESSAGE(), BOOST_TEST_MESSAGE(), DRCE_CLEARANCE, KI_TEST::FillZones(), ADVANCED_CFG::GetCfg(), KI_TEST::LoadBoard(), BOARD_DESIGN_SETTINGS::m_DRCEngine, ADVANCED_CFG::m_ZoneFillIterativeRefill, MM, pcbIUScale, RPT_SEVERITY_ERROR, DRC_ENGINE::RunTests(), and DRC_ENGINE::SetViolationHandler().

◆ BOOST_FIXTURE_TEST_CASE() [21/24]

◆ BOOST_FIXTURE_TEST_CASE() [22/24]

BOOST_FIXTURE_TEST_CASE ( RegressionZonePriorityIsolatedIslands ,
ZONE_FILL_TEST_FIXTURE  )

Test for issue 21746: Lower priority zones should fill areas where higher priority zones have isolated islands that get removed.

The test board has:

  • A VDD zone with priority 1 (higher priority)
  • A GND zone with priority 0 (lower priority, default)

The VDD zone only connects to a small area, creating an isolated island that should be removed. The GND zone should then fill that area.

With the bug, GND is knocked out by VDD before VDD's isolated island is removed, leaving GND mostly empty.

Definition at line 439 of file test_zone_filler.cpp.

References SHAPE_LINE_CHAIN::Area(), BOOST_CHECK_MESSAGE(), BOOST_TEST_MESSAGE(), ZONE::CalculateFilledArea(), KI_TEST::FillZones(), ADVANCED_CFG::GetCfg(), ZONE::GetFilledArea(), KI_TEST::LoadBoard(), ADVANCED_CFG::m_ZoneFillIterativeRefill, SHAPE_POLY_SET::Outline(), and SHAPE_POLY_SET::OutlineCount().

◆ BOOST_FIXTURE_TEST_CASE() [23/24]

BOOST_FIXTURE_TEST_CASE ( ZoneLayerSpecificRules ,
ZONE_FILL_TEST_FIXTURE  )

Verify that custom DRC rules with identical conditions but different layer scopes are both applied correctly during zone fill.

Two rules: outer layer 4.6mm clearance, inner layer 2.3mm clearance, both with the same condition "A.hasNetclass('HV') && B.hasNetclass('LV')". After fill, the zone-to-zone clearance should match the rule for that layer.

Regression test for https://gitlab.com/kicad/code/kicad/-/issues/23339

Definition at line 1353 of file test_zone_filler.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_TEST_MESSAGE(), CLEARANCE_CONSTRAINT, DRCE_CLEARANCE, DRC_ENGINE::EvalRules(), F_Cu, KI_TEST::FillZones(), DRC_CONSTRAINT::GetValue(), In1_Cu, DRC_ENGINE::InitEngine(), KI_TEST::LoadBoard(), BOARD_DESIGN_SETTINGS::m_DRCEngine, MINOPTMAX< T >::Min(), MM, pcbIUScale, DRC_ENGINE::RunTests(), and DRC_ENGINE::SetViolationHandler().

◆ BOOST_FIXTURE_TEST_CASE() [24/24]

BOOST_FIXTURE_TEST_CASE ( ZoneViaNetClearance ,
ZONE_FILL_TEST_FIXTURE  )

Verify zone fills clear PTH pads on different nets.

After fill, DRC must report zero zone-to-pad clearance violations. Clipper2 rounds corridor-cut vertices to integer coordinates; they can land within 1nm of a segment endpoint but are not true pinch points. Exact collinearity detection keeps them from triggering splits that extend triangles into knockout areas.

Definition at line 1308 of file test_zone_filler.cpp.

References BOOST_CHECK_EQUAL(), DRCE_CLEARANCE, KI_TEST::FillZones(), DRC_ENGINE::InitEngine(), KI_TEST::LoadBoard(), BOARD_DESIGN_SETTINGS::m_DRCEngine, MM, DRC_ENGINE::RunTests(), and DRC_ENGINE::SetViolationHandler().

Variable Documentation

◆ delta

int delta = KiROUND( 0.006 * pcbIUScale.IU_PER_MM )

Definition at line 55 of file test_zone_filler.cpp.

Referenced by SYMBOL_EDITOR_MOVE_TOOL::AlignElements(), AlignSchematicItemsToGrid(), SCH_MOVE_TOOL::AlignToGrid(), EC_PERPLINE::Apply(), PNS::ApproximateSegmentAsRect(), PDF_PLOTTER::arcPath(), arcPts(), BezierToPolyline(), BOOST_FIXTURE_TEST_CASE(), PNS::DP_GATEWAYS::buildDpContinuation(), SPRINT_LAYOUT_PARSER::buildOutline(), PCB_IO_KICAD_SEXPR_PARSER::checkpoint(), CircleToEndSegmentDeltaRadius(), LENGTH_DELAY_CALCULATION::clipLineToPad(), Collide(), Collide(), Collide(), Collide(), Collide(), SHAPE_POLY_SET::CollideVertex(), commitSnapshotWithLock(), SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint(), COUPLED_MICROSTRIP::conductor_losses(), MICROSTRIP::conductor_losses(), ConnectBoardShapes(), ConvertArcToPolyline(), ConvertArcToPolyline(), GERBER_DRAW_ITEM::ConvertSegmentToPolygon(), AM_PRIMITIVE::ConvertShapeToPolygon(), D_CODE::ConvertShapeToPolygon(), PNS::coupledBypass(), BOARD_ADAPTER::createArcSegments(), EXCELLON_WRITER::createDrillFile(), ALIGN_DISTRIBUTE_TOOL::doDistributeCenters(), ALIGN_DISTRIBUTE_TOOL::doDistributeGaps(), SCH_MOVE_TOOL::doMoveSelection(), SYMBOL_EDITOR_MOVE_TOOL::doMoveSelection(), KIGFX::SCH_PAINTER::draw(), DRAWING_TOOL::DrawDimension(), D_CODE::DrawFlashedShape(), KIGFX::GERBVIEW_PAINTER::drawFlashedShape(), DrawHalfOpenCylinder(), KIGFX::PREVIEW::DRAW_CONTEXT::DrawLineDashed(), editArcEndpointKeepTangent(), fillArcGBRITEM(), PSLIKE_PLOTTER::FlashPadOval(), PCB_IO_KICAD_SEXPR::format(), RENDER_3D_OPENGL::generate3dGrid(), RENDER_3D_OPENGL::generateDimple(), RENDER_3D_OPENGL::generateDisk(), RENDER_3D_OPENGL::generateRing(), KIBIS_MODEL::generateSquareWave(), PCB_DIM_ALIGNED::GetAngle(), SCH_NO_CONNECT::GetBoundingBox(), GetDeltasForDistributeByGaps(), GetDeltasForDistributeByPoints(), KIGIT_COMMON::GetDifferentFiles(), SNAP_LINE_MANAGER::GetNearestSnapLinePoint(), BOARD::GetPad(), SCH_FIELD::GetRenderCache(), GERBER_DRAW_ITEM::GetTextD_CodePrms(), PAD::HitTest(), PAD::HitTest(), SCH_NO_CONNECT::HitTest(), SCH_DRAWING_TOOLS::ImportGraphics(), SYMBOL_EDITOR_DRAWING_TOOLS::ImportGraphics(), SCH_DRAWING_TOOLS::ImportSheet(), SCH_MOVE_TOOL::initializeMoveOperation(), CYLINDER::Intersect(), CYLINDER::IntersectP(), BOX2< VECTOR2I >::Intersects(), BEZIER_POLY::isFlat(), PNS::IsSegment45Degree(), CADSTAR_SCH_ARCHIVE_LOADER::loadLibPart(), PCB_IO_EAGLE::loadPlain(), PCB_SELECTION_TOOL::Main(), PL_EDIT_TOOL::Main(), SCH_SELECTION_TOOL::Main(), DSN::SPECCTRA_DB::makePADSTACK(), TRANSFORM::MapAngles(), MapAnglesV6(), SCH_DIRECTIVE_LABEL::MirrorHorizontally(), SCH_LABEL_BASE::MirrorHorizontally(), SCH_DIRECTIVE_LABEL::MirrorSpinStyle(), SCH_LABEL_BASE::MirrorSpinStyle(), SCH_DIRECTIVE_LABEL::MirrorVertically(), SCH_LABEL_BASE::MirrorVertically(), mpInfoLayer::Move(), PNS::HOLE::Move(), SCH_ALIGN_TOOL::moveItem(), SCH_MOVE_TOOL::moveItem(), NearestPoints(), SCH_TEXT::NormalizeJustification(), DIALOG_SHIM::OnCharHook(), KIGFX::WX_VIEW_CONTROLS::onMotion(), KIGFX::WX_VIEW_CONTROLS::onScroll(), PCB_POINT_EDITOR::OnSelectionChange(), KIGFX::WX_VIEW_CONTROLS::onWheel(), PCB_IO_EAGLE::packageCircle(), PCB_IO_EAGLE::packagePolygon(), PCB_IO_EASYEDAPRO_PARSER::ParseBoard(), PCB_IO_EASYEDAPRO_PARSER::ParseContour(), PCB_IO_GEDA::parseElement(), GPCB_FPL_CACHE::parseFOOTPRINT(), EASYEDA_PARSER_BASE::ParseLineChains(), PCB_IO_KICAD_SEXPR_PARSER::parsePAD(), PCB_IO_KICAD_SEXPR_PARSER::parsePadstack(), PCB_IO_EASYEDAPRO_PARSER::ParsePoly(), PCB_IO_EASYEDA_PARSER::ParseToBoardItemContainer(), DRAWING_TOOL::PlaceImportedGraphics(), SCH_NO_CONNECT::Plot(), PLOTTER::polyArc(), EDA_DRAW_PANEL_GAL::Refresh(), SCH_SHEET_PIN::Rotate(), CURSOR::SetCoordX(), SCH_LINE::SetLength(), PNS::SOLID::SetPos(), FOOTPRINT::SetPosition(), PCB_BARCODE::SetPosition(), PCB_GROUP::SetPosition(), SCH_GROUP::SetPosition(), SCH_SHEET::SetPositionIgnoringPins(), PCB_BARCODE::SetRect(), KIGFX::VIEW::SetScale(), PCB_TEXTBOX::SetTextAngle(), GRID_HELPER::SnapToConstructionLines(), COUPLED_STRIPLINE::Synthesize(), TestSegmentHit(), BEZIER_POLY::thirdControlPointDeviation(), KIGFX::COLOR4D::ToHSV(), DIALOG_PAD_PROPERTIES::transferDataToPad(), TransformCircleToPolygon(), TransformCircleToPolygon(), TransformOvalToPolygon(), PAD::TransformShapeToPolygon(), SETTINGS_MANAGER::TriggerBackupIfNeeded(), DIM_LEADER_POINT_EDIT_BEHAVIOR::UpdateItem(), SHAPE_GROUP_POINT_EDIT_BEHAVIOR::UpdateItem(), BOARD_INSPECTION_TOOL::UpdateLocalRatsnest(), and PCB_PROPERTIES_PANEL::valueChanged().

◆ RegressionSliverZoneFillTests_tests

const std::vector<wxString> RegressionSliverZoneFillTests_tests
static
Initial value:
= {
"issue16182"
}

Definition at line 311 of file test_zone_filler.cpp.

Referenced by BOOST_DATA_TEST_CASE_F().

◆ RegressionTeardropFill_tests

const std::vector<std::pair<wxString,int> > RegressionTeardropFill_tests
static
Initial value:
= {
{ "teardrop_issue_JPC2", 5 },
}

Definition at line 358 of file test_zone_filler.cpp.

Referenced by BOOST_DATA_TEST_CASE_F().

◆ RegressionZoneFillTests_tests

const std::vector<wxString> RegressionZoneFillTests_tests
static
Initial value:
= {
"issue18",
"issue2568",
"issue3812",
"issue5102",
"issue5313",
"issue5320",
"issue5567",
"issue5830",
"issue6039",
"issue6260",
"issue6284",
"issue7086",
"issue14294",
"fill_bad"
}

Definition at line 177 of file test_zone_filler.cpp.

Referenced by BOOST_DATA_TEST_CASE_F().