|
KiCad PCB EDA Suite
|
#include "zone_utils.h"#include <board.h>#include <footprint.h>#include <pad.h>#include <pcb_track.h>#include <thread_pool.h>#include <zone.h>#include <geometry/shape_poly_set.h>#include <algorithm>#include <cmath>#include <future>#include <optional>#include <unordered_map>#include <unordered_set>Go to the source code of this file.
Functions | |
| static bool | RuleAreasHaveSameProps (const ZONE &a, const ZONE &b) |
| std::vector< std::unique_ptr< ZONE > > | MergeZonesWithSameOutline (std::vector< std::unique_ptr< ZONE > > &&aZones) |
| Merges zones with identical outlines and nets on different layers into single multi-layer zones. | |
| static std::vector< ZONE_OVERLAP_PAIR > | findOverlappingPairs (BOARD *aBoard) |
| static std::optional< ZONE_PRIORITY_EDGE > | computeConstraint (const ZONE_OVERLAP_PAIR &aPair, BOARD *aBoard) |
| static void | assignPrioritiesFromGraph (const std::vector< ZONE_PRIORITY_EDGE > &aEdges, std::vector< ZONE * > &aAllZones) |
| static ZONE * | ufFind (std::unordered_map< ZONE *, ZONE * > &aParent, ZONE *aZone) |
| static void | ufUnion (std::unordered_map< ZONE *, ZONE * > &aParent, std::unordered_map< ZONE *, int > &aRank, ZONE *aA, ZONE *aB) |
| bool | AutoAssignZonePriorities (BOARD *aBoard, PROGRESS_REPORTER *aReporter) |
| Automatically assign zone priorities based on connectivity analysis of overlapping regions. | |
|
static |
Definition at line 363 of file zone_utils.cpp.
Referenced by AutoAssignZonePriorities().
| bool AutoAssignZonePriorities | ( | BOARD * | aBoard, |
| PROGRESS_REPORTER * | aReporter = nullptr ) |
Automatically assign zone priorities based on connectivity analysis of overlapping regions.
For each pair of overlapping zones, counts pads and vias per-net in the intersection area. The zone whose net has more items in the overlap gets higher priority. When item counts are within 20% of the larger count, the smaller zone gets higher priority. Overlap analysis for each pair runs in parallel via the KiCad thread pool.
| aBoard | the board whose zone priorities will be reassigned |
| aReporter | optional progress reporter |
Definition at line 501 of file zone_utils.cpp.
References assignPrioritiesFromGraph(), findOverlappingPairs(), GetKiCadThreadPool(), result, tp, ufFind(), ufUnion(), and BOARD::Zones().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), DIALOG_ZONE_MANAGER::OnAutoAssignClick(), and FABMASTER::orderZones().
|
static |
Definition at line 251 of file zone_utils.cpp.
References std::abs(), SHAPE_POLY_SET::Area(), SHAPE_POLY_SET::BooleanIntersection(), SHAPE_POLY_SET::BuildBBoxCaches(), SHAPE_POLY_SET::ClearArcs(), SHAPE_POLY_SET::CloneDropTriangulation(), SHAPE_POLY_SET::Contains(), BOARD::Footprints(), BOARD_CONNECTED_ITEM::GetNetCode(), SHAPE_POLY_SET::IsEmpty(), ZONE::Outline(), pad, PCB_VIA_T, LSET::Seq(), BOARD::Tracks(), and via.
|
static |
Definition at line 206 of file zone_utils.cpp.
References LSET::AllCuMask(), SHAPE_POLY_SET::Collide(), SHAPE_POLY_SET::Contains(), SHAPE_POLY_SET::CVertex(), ZONE::GetBoundingBox(), ZONE::GetIsRuleArea(), ZONE::GetLayerSet(), BOX2< Vec >::Intersects(), ZONE::IsOnCopperLayer(), ZONE::IsTeardropArea(), ZONE::Outline(), and BOARD::Zones().
Referenced by AutoAssignZonePriorities().
| std::vector< std::unique_ptr< ZONE > > MergeZonesWithSameOutline | ( | std::vector< std::unique_ptr< ZONE > > && | aZones | ) |
Merges zones with identical outlines and nets on different layers into single multi-layer zones.
| aZones | is the zones to merge. Ownership of all the zones is taken (some will be returned) |
Definition at line 55 of file zone_utils.cpp.
References SHAPE_LINE_CHAIN::BBox(), SHAPE_LINE_CHAIN::CompareGeometry(), SHAPE_POLY_SET::CPolygon(), ZONE::GetFill(), ZONE::GetLayerSet(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), SHAPE_LINE_CHAIN::PointCount(), RuleAreasHaveSameProps(), ZONE::SetFilledPolysList(), ZONE::SetIsFilled(), ZONE::SetLayerSet(), and ZONE::SetNeedRefill().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and ALLEGRO::BOARD_BUILDER::createZones().
Definition at line 42 of file zone_utils.cpp.
References ZONE::GetDoNotAllowFootprints(), ZONE::GetDoNotAllowPads(), ZONE::GetDoNotAllowTracks(), ZONE::GetDoNotAllowVias(), ZONE::GetDoNotAllowZoneFills(), and ZONE::GetIsRuleArea().
Referenced by MergeZonesWithSameOutline().
Definition at line 470 of file zone_utils.cpp.
References ufFind().
Referenced by AutoAssignZonePriorities(), ufFind(), and ufUnion().
|
static |
Definition at line 481 of file zone_utils.cpp.
References ufFind().
Referenced by AutoAssignZonePriorities().