|
KiCad PCB EDA Suite
|
TEARDROP_MANAGER manage and build teardrop areas A teardrop area is a polygonal area (a copper ZONE) having: 2 points on the track connected to a pad or via 2 points on the outline of this pad or via 1 point near the pad/via position (calculated in order to have this pad/via position inside the area The 2 sides joining a point on the track to the corresponding point on the pad/via outline can be a straight line or a curved shape (defined from a Bezier curve) This curved shape is built by segments (3 to 10) from this Bezier curve Size of area (height and length) are defined from the pad/via size or for pads having a size X and a size Y, the smallest of X,Y size. More...
#include <teardrop.h>
Public Types | |
| enum | TEARDROP_VARIANT { TD_TYPE_PADVIA , TD_TYPE_TRACKEND } |
Public Member Functions | |
| TEARDROP_MANAGER (BOARD *aBoard, TOOL_MANAGER *aToolManager) | |
| void | RemoveTeardrops (BOARD_COMMIT &aCommit, std::vector< BOARD_ITEM * > *dirtyPadsAndVias, std::set< PCB_TRACK * > *dirtyTracks, const std::vector< BOARD_ITEM * > *dirtyCopper=nullptr) |
| Remove teardrops on dirty pads, vias or tracks, and any whose neighbouring copper moved, dirtying the anchors of the latter. | |
| void | UpdateTeardrops (BOARD_COMMIT &aCommit, const std::vector< BOARD_ITEM * > *dirtyPadsAndVias, const std::set< PCB_TRACK * > *dirtyTracks, bool aForceFullUpdate=false) |
| Update teardrops on a list of items. | |
| void | AddTeardropsOnTracks (BOARD_COMMIT &aCommit, const std::set< PCB_TRACK * > *aTracks, bool aForceFullUpdate=false, bool aSetPriorities=true) |
| Add teardrop on tracks of different sizes connected by their end. | |
| void | DeleteTrackToTrackTeardrops (BOARD_COMMIT &aCommit) |
| void | BuildTrackCaches () |
Static Public Member Functions | |
| static int | GetWidth (BOARD_ITEM *aItem, PCB_LAYER_ID aLayer) |
| static bool | IsRound (BOARD_ITEM *aItem, PCB_LAYER_ID aLayer) |
| static bool | IsUniformlyRound (BOARD_ITEM *aItem) |
Private Member Functions | |
| bool | areItemsInSameZone (BOARD_ITEM *aPadOrVia, PCB_TRACK *aTrack) const |
| const std::vector< std::set< const BOARD_ITEM * > > & | zoneConnections (ZONE *aZone, PCB_LAYER_ID aLayer) const |
| int | pairClearance (PCB_TRACK *aSourceTrack, BOARD_ITEM *aItem, PCB_LAYER_ID aLayer) const |
| void | ensureCopperIndex () const |
| Build the copper collision index, deferred so a commit with no teardrop candidate never pays for it. | |
| bool | collidesWithOtherNets (const std::vector< VECTOR2I > &aPoints, PCB_TRACK *aSourceTrack, const std::vector< const BOARD_ITEM * > &aExempt) const |
| bool | computeFittedTeardropPolygon (const TEARDROP_PARAMETERS &aParams, std::vector< VECTOR2I > &aPoints, PCB_TRACK *aTrack, PCB_TRACK *aSourceTrack, BOARD_ITEM *aOther, const VECTOR2I &aOtherPos) const |
| Widen a teardrop as far as the surrounding copper allows. | |
| int | computeChordThroughShape (PCB_TRACK *aTrack, BOARD_ITEM *aOther, PCB_LAYER_ID aLayer, const VECTOR2I &aInsidePoint) const |
| Return the centerline chord length through aOther's copper span at aInsidePoint. | |
| void | computeCurvedForRoundShape (const TEARDROP_PARAMETERS &aParams, std::vector< VECTOR2I > &aPoly, PCB_LAYER_ID aLayer, int aTrackHalfWidth, const VECTOR2D &aTrackDir, BOARD_ITEM *aOther, const VECTOR2I &aOtherPos, std::vector< VECTOR2I > &aPts) const |
| Compute the curve part points for teardrops connected to a round shape The Bezier curve control points are optimized for a round pad/via shape, and do not give a good curve shape for other pad shapes use m_m_heightRatio. | |
| void | computeCurvedForRectShape (const TEARDROP_PARAMETERS &aParams, std::vector< VECTOR2I > &aPoly, int aTdWidth, int aTrackHalfWidth, std::vector< VECTOR2I > &aPts, const VECTOR2I &aIntersection, BOARD_ITEM *aOther, const VECTOR2I &aOtherPos, PCB_LAYER_ID aLayer) const |
| Compute the curve part points for teardrops connected to a rectangular/polygonal shape The Bezier curve control points are not optimized for a special shape, so use computeCurvedForRoundShape() for round shapes for better result. | |
| bool | computeTeardropPolygon (const TEARDROP_PARAMETERS &aParams, std::vector< VECTOR2I > &aCorners, PCB_TRACK *aTrack, PCB_TRACK *aSourceTrack, BOARD_ITEM *aOther, const VECTOR2I &aOtherPos) const |
| Compute all teardrop points of the polygon shape. | |
| bool | computeAnchorPoints (const TEARDROP_PARAMETERS &aParams, PCB_LAYER_ID aLayer, BOARD_ITEM *aItem, const VECTOR2I &aPos, std::vector< VECTOR2I > &aPts) const |
| Compute the 2 points on pad/via of the teardrop shape. | |
| PCB_TRACK * | findTouchingTrack (EDA_ITEM_FLAGS &aMatchType, PCB_TRACK *aTrackRef, PCB_TRACK *aSourceTrack, const VECTOR2I &aEndPoint) const |
| Find a track connected to the end of another track. | |
| ZONE * | createTeardrop (TEARDROP_VARIANT aTeardropVariant, std::vector< VECTOR2I > &aPoints, PCB_TRACK *aSourceTrack, const KIID &aUuid) const |
| Creates a teardrop (a ZONE item) from its polygonal shape, track netcode and layer. | |
| ZONE * | createTeardropMask (TEARDROP_VARIANT aTeardropVariant, std::vector< VECTOR2I > &aPoints, PCB_TRACK *aSourceTrack, const KIID &aUuid) const |
| void | createAndAddTeardropWithMask (BOARD_COMMIT &aCommit, TEARDROP_VARIANT aTeardropVariant, std::vector< VECTOR2I > &aPoints, PCB_TRACK *aSourceTrack, const KIID &aUuid) |
| Creates and adds a teardrop with optional mask to the board. | |
| bool | tryCreateTrackTeardrop (BOARD_COMMIT &aCommit, const TEARDROP_PARAMETERS &aParams, TEARDROP_VARIANT aTeardropVariant, PCB_TRACK *aTrack, PCB_TRACK *aSourceTrack, BOARD_ITEM *aCandidate, const VECTOR2I &aPos, const KIID &aUuid) |
| Attempts to create a track-to-track teardrop. | |
| void | setTeardropPriorities () |
| Set priority of created teardrops. | |
| bool | findAnchorPointsOnTrack (const TEARDROP_PARAMETERS &aParams, VECTOR2I &aStartPoint, VECTOR2I &aEndPoint, VECTOR2I &aIntersection, PCB_TRACK *&aTrack, PCB_TRACK *aSourceTrack, BOARD_ITEM *aOther, const VECTOR2I &aOtherPos, int *aEffectiveTeardropLen) const |
Static Private Member Functions | |
| static int | copperNetcode (const BOARD_ITEM *aItem) |
| static KIID | teardropUuid (const PCB_TRACK *aTrack, const BOARD_ITEM *aCandidate, int aSlot) |
| Build the UUID a teardrop is created with. | |
| static KIID | maskUuidFor (const KIID &aCopperUuid) |
| Build the UUID of the mask sibling of aCopperUuid. | |
| static void | buildCrossingStub (PCB_TRACK &aStub, const PCB_TRACK *aTrack, const VECTOR2I &aEnd) |
| Set aStub up as the segment from one end of aTrack to aEnd, for a track that crosses the pad or via it connects to. | |
Private Attributes | |
| int | m_tolerance |
| BOARD * | m_board |
| TOOL_MANAGER * | m_toolManager |
| TEARDROP_PARAMETERS_LIST * | m_prmsList |
| DRC_RTREE | m_tracksRTree |
| TRACK_BUFFER | m_trackLookupList |
| std::vector< ZONE * > | m_createdTdList |
| DRC_RTREE | m_copperRTree |
| Every copper item plus the teardrops built so far, to keep teardrops off other nets. | |
| bool | m_copperIndexed |
| std::unordered_map< PTR_LAYER_CACHE_KEY, std::vector< std::set< const BOARD_ITEM * > > > | m_zoneConnectionCache |
| std::unordered_map< PTR_PTR_LAYER_CACHE_KEY, int > | m_pairClearanceCache |
Friends | |
| class | TEARDROP_PARAMETERS |
TEARDROP_MANAGER manage and build teardrop areas A teardrop area is a polygonal area (a copper ZONE) having: 2 points on the track connected to a pad or via 2 points on the outline of this pad or via 1 point near the pad/via position (calculated in order to have this pad/via position inside the area The 2 sides joining a point on the track to the corresponding point on the pad/via outline can be a straight line or a curved shape (defined from a Bezier curve) This curved shape is built by segments (3 to 10) from this Bezier curve Size of area (height and length) are defined from the pad/via size or for pads having a size X and a size Y, the smallest of X,Y size.
For a custom pad that size and position describe only the anchor; the copper may lie far away and need not be convex or connected, so anchor-derived geometry must be clamped to that copper
Definition at line 85 of file teardrop.h.
| Enumerator | |
|---|---|
| TD_TYPE_PADVIA | |
| TD_TYPE_TRACKEND | |
Definition at line 90 of file teardrop.h.
| TEARDROP_MANAGER::TEARDROP_MANAGER | ( | BOARD * | aBoard, |
| TOOL_MANAGER * | aToolManager ) |
Definition at line 48 of file teardrop.cpp.
References m_board, m_copperIndexed, m_prmsList, m_tolerance, and m_toolManager.
| void TEARDROP_MANAGER::AddTeardropsOnTracks | ( | BOARD_COMMIT & | aCommit, |
| const std::set< PCB_TRACK * > * | aTracks, | ||
| bool | aForceFullUpdate = false, | ||
| bool | aSetPriorities = true ) |
Add teardrop on tracks of different sizes connected by their end.
| aSetPriorities | is false when the caller numbers them itself once the rest are built |
Definition at line 682 of file teardrop.cpp.
References PCB_TRACK::GetEnd(), PCB_TRACK::GetLength(), TRACK_BUFFER::GetNetcodeAndLayerFromIndex(), PCB_TRACK::GetStart(), PCB_TRACK::GetWidth(), GetWidth(), PCB_TRACK::IsPointOnEnds(), KiROUND(), m_board, m_prmsList, m_tolerance, m_trackLookupList, TEARDROP_PARAMETERS::m_WidthtoSizeFilterRatio, pad, setTeardropPriorities(), TARGET_TRACK, TD_TYPE_TRACKEND, TEARDROP_PARAMETERS, teardropUuid(), tryCreateTrackTeardrop(), and via.
Referenced by DIALOG_GLOBAL_EDIT_TEARDROPS::TransferDataFromWindow(), and UpdateTeardrops().
|
private |
Definition at line 230 of file teardrop_utils.cpp.
References BOARD_CONNECTED_ITEM::GetLayer(), BOARD_CONNECTED_ITEM::GetNetCode(), m_board, and zoneConnections().
Referenced by UpdateTeardrops().
|
staticprivate |
Set aStub up as the segment from one end of aTrack to aEnd, for a track that crosses the pad or via it connects to.
Definition at line 81 of file teardrop.cpp.
References BOARD_CONNECTED_ITEM::GetLayer(), PCB_TRACK::GetLocalSolderMaskMargin(), BOARD_CONNECTED_ITEM::GetNet(), PCB_TRACK::GetWidth(), PCB_TRACK::HasSolderMask(), PCB_TRACK::SetEnd(), PCB_TRACK::SetHasSolderMask(), BOARD_CONNECTED_ITEM::SetLayer(), PCB_TRACK::SetLocalSolderMaskMargin(), BOARD_CONNECTED_ITEM::SetNet(), and PCB_TRACK::SetWidth().
Referenced by UpdateTeardrops().
| void TEARDROP_MANAGER::BuildTrackCaches | ( | ) |
Definition at line 119 of file teardrop_utils.cpp.
References CLEARANCE_CONSTRAINT, m_board, m_trackLookupList, m_tracksRTree, PCB_ARC_T, and PCB_TRACE_T.
Referenced by DIALOG_GLOBAL_EDIT_TEARDROPS::TransferDataFromWindow(), and UpdateTeardrops().
|
private |
| aExempt | are the items it overlaps by construction, its anchor and its track(s); without them a no-net teardrop collides with its own anchor, no net being shared with none |
Definition at line 264 of file teardrop_utils.cpp.
References SHAPE_POLY_SET::Append(), alg::contains(), copperNetcode(), ensureCopperIndex(), BOARD_CONNECTED_ITEM::GetLayer(), BOARD_CONNECTED_ITEM::GetNetCode(), m_board, m_copperRTree, SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::OutlineCount(), pairClearance(), and SHAPE_POLY_SET::Simplify().
Referenced by computeFittedTeardropPolygon().
|
private |
Compute the 2 points on pad/via of the teardrop shape.
| aLayer | is the layer for the teardrop |
| aItem | is the via/pad/track used to build the teardrop |
| aPos | is the via/pad position, or track start or end teardrop height = aViaPad size * aHeightRatio |
| aPts | is the buffer that contains initial and final teardrop polygonal shape in aPts: A and B ( aPts[0] and aPts[1] ) are points on the track C and E ( aPts[2] and aPts[4] ) are points on the aViaPad D ( aPts[3] ) is midpoint behind the aViaPad centre m_heightRatio is the factor to calculate the aViaPad teardrop size |
Definition at line 934 of file teardrop_utils.cpp.
References SHAPE_POLY_SET::Append(), SHAPE_LINE_CHAIN::Area(), SHAPE_POLY_SET::BooleanIntersection(), BuildConvexHull(), SHAPE_LINE_CHAIN::CPoints(), ERROR_INSIDE, VECTOR2< T >::EuclideanNorm(), GetWidth(), IsRound(), KiROUND(), TEARDROP_PARAMETERS::m_BestWidthRatio, m_board, TEARDROP_PARAMETERS::m_TdMaxWidth, SHAPE_POLY_SET::Move(), SHAPE_POLY_SET::NewOutline(), next(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), pad, PCB_PAD_T, SHAPE_POLY_SET::Rotate(), TEARDROP_PARAMETERS, TransformCircleToPolygon(), and EDA_ITEM::Type().
Referenced by computeTeardropPolygon().
|
private |
Return the centerline chord length through aOther's copper span at aInsidePoint.
Degenerate, arc, or non-crossing cases return INT_MAX to avoid rejection.
Definition at line 425 of file teardrop_utils.cpp.
References SHAPE_POLY_SET::BBox(), SHAPE_POLY_SET::Contains(), delta, BOX2< Vec >::Diagonal(), ERROR_INSIDE, PCB_TRACK::GetEnd(), EDA_ITEM::GetPosition(), PCB_TRACK::GetStart(), GetWidth(), SHAPE_POLY_SET::Hole(), SHAPE_POLY_SET::HoleCount(), SHAPE_LINE_CHAIN::Intersect(), IsRound(), KiROUND(), m_board, SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), PCB_ARC_T, PCB_PAD_T, radius, SHAPE_LINE_CHAIN::SetClosed(), TransformCircleToPolygon(), EDA_ITEM::Type(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by UpdateTeardrops().
|
private |
Compute the curve part points for teardrops connected to a rectangular/polygonal shape The Bezier curve control points are not optimized for a special shape, so use computeCurvedForRoundShape() for round shapes for better result.
For rounded rectangles, special handling ensures curves are tangent to corner radii.
Definition at line 804 of file teardrop_utils.cpp.
References computeCornerTangentControlPoint(), VECTOR2< T >::EuclideanNorm(), BEZIER_POLY::GetPoly(), isPointOnOvalEnd(), isPointOnRoundedCorner(), m_board, OVAL, pad, PCB_PAD_T, VECTOR2< T >::Resize(), ROUNDRECT, TEARDROP_PARAMETERS, and EDA_ITEM::Type().
Referenced by computeTeardropPolygon().
|
private |
Compute the curve part points for teardrops connected to a round shape The Bezier curve control points are optimized for a round pad/via shape, and do not give a good curve shape for other pad shapes use m_m_heightRatio.
Definition at line 577 of file teardrop_utils.cpp.
References std::abs(), VECTOR2< T >::EuclideanNorm(), BEZIER_POLY::GetPoly(), GetWidth(), KiROUND(), SEG::Length(), TEARDROP_PARAMETERS::m_BestWidthRatio, m_board, TEARDROP_PARAMETERS::m_TdMaxWidth, radius, VECTOR2< T >::Resize(), TEARDROP_PARAMETERS, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by computeTeardropPolygon().
|
private |
Widen a teardrop as far as the surrounding copper allows.
The requested width knows nothing of what is nearby, so bisect down from it; the result is within a few percent.
Definition at line 355 of file teardrop_utils.cpp.
References collidesWithOtherNets(), computeTeardropPolygon(), BOARD_CONNECTED_ITEM::GetLayer(), PCB_TRACK::GetWidth(), GetWidth(), KiROUND(), TEARDROP_PARAMETERS::m_BestWidthRatio, TEARDROP_PARAMETERS::m_TdMaxWidth, and TEARDROP_PARAMETERS.
Referenced by tryCreateTrackTeardrop().
|
private |
Compute all teardrop points of the polygon shape.
Definition at line 1329 of file teardrop_utils.cpp.
References std::abs(), center, computeAnchorPoints(), computeCurvedForRectShape(), computeCurvedForRoundShape(), SHAPE_POLY_SET::Contains(), CUSTOM, end, ERROR_INSIDE, findAnchorPointsOnTrack(), BOARD_CONNECTED_ITEM::GetLayer(), PCB_TRACK::GetWidth(), GetWidth(), SHAPE_POLY_SET::Hole(), SHAPE_POLY_SET::HoleCount(), SHAPE_LINE_CHAIN::Intersect(), IsRound(), KiROUND(), TEARDROP_PARAMETERS::m_BestWidthRatio, m_board, TEARDROP_PARAMETERS::m_CurvedEdges, TEARDROP_PARAMETERS::m_TdMaxWidth, NormalizeVector(), SHAPE_POLY_SET::Outline(), SHAPE_POLY_SET::OutlineCount(), pad, PCB_ARC_T, PCB_PAD_T, pcbIUScale, SHAPE_LINE_CHAIN::SetClosed(), TEARDROP_PARAMETERS, EDA_ITEM::Type(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by computeFittedTeardropPolygon().
|
staticprivate |
Definition at line 174 of file teardrop_utils.cpp.
References NETINFO_LIST::UNCONNECTED.
Referenced by collidesWithOtherNets(), and RemoveTeardrops().
|
private |
Creates and adds a teardrop with optional mask to the board.
| aCommit | the board commit to add the teardrop to |
| aTeardropVariant | = variant of the teardrop( attached to a pad, or a track end ) |
| aPoints | is the polygonal shape |
| aSourceTrack | is the board track the teardrop belongs to |
| aUuid | is the UUID to give the teardrop |
Definition at line 184 of file teardrop.cpp.
References COMMIT::Added(), BULK_INSERT, CLEARANCE_CONSTRAINT, createTeardrop(), createTeardropMask(), ensureCopperIndex(), BOARD_CONNECTED_ITEM::GetLayer(), ZONE::GetLayer(), PCB_TRACK::HasSolderMask(), IsExternalCopperLayer(), m_board, m_copperRTree, and m_createdTdList.
Referenced by tryCreateTrackTeardrop().
|
private |
Creates a teardrop (a ZONE item) from its polygonal shape, track netcode and layer.
| aTeardropVariant | = variant of the teardrop( attached to a pad, or a track end ) |
| aPoints | is the polygonal shape |
| aSourceTrack | is the board track it belongs to, not the stub geometry came from |
| aUuid | is the UUID to give the teardrop |
Definition at line 95 of file teardrop.cpp.
References SHAPE_POLY_SET::Append(), ZONE::CalculateFilledArea(), ZONE_SETTINGS::ExportSetting(), FULL, ZONE_SETTINGS::GetDefaultSettings(), BOARD_CONNECTED_ITEM::GetLayer(), BOARD_CONNECTED_ITEM::GetNetCode(), INVISIBLE_BORDER, m_board, NEVER, SHAPE_POLY_SET::NewOutline(), ZONE::Outline(), pcbIUScale, ZONE::SetBorderDisplayStyle(), ZONE::SetFilledPolysList(), ZONE::SetIsFilled(), ZONE::SetIslandRemovalMode(), ZONE::SetLayer(), ZONE::SetLocalClearance(), ZONE::SetMinThickness(), ZONE::SetNetCode(), ZONE::SetPadConnection(), ZONE::SetTeardropAreaType(), BOARD_ITEM::SetUuidDirect(), TD_TRACKEND, TD_TYPE_PADVIA, and TD_VIAPAD.
Referenced by createAndAddTeardropWithMask().
|
private |
Definition at line 137 of file teardrop.cpp.
References ALLOW_ACUTE_CORNERS, SHAPE_POLY_SET::Append(), B_Mask, ZONE_SETTINGS::ExportSetting(), F_Cu, F_Mask, ZONE_SETTINGS::GetDefaultSettings(), BOARD_CONNECTED_ITEM::GetLayer(), ZONE::GetLayer(), ZONE::GetMinThickness(), PCB_TRACK::GetSolderMaskExpansion(), SHAPE_POLY_SET::Inflate(), INVISIBLE_BORDER, m_board, maskUuidFor(), NEVER, SHAPE_POLY_SET::NewOutline(), ZONE::Outline(), pcbIUScale, ZONE::SetBorderDisplayStyle(), ZONE::SetFilledPolysList(), ZONE::SetIsFilled(), ZONE::SetIslandRemovalMode(), ZONE::SetLayer(), ZONE::SetMinThickness(), ZONE::SetTeardropAreaType(), BOARD_ITEM::SetUuidDirect(), TD_TRACKEND, TD_TYPE_PADVIA, and TD_VIAPAD.
Referenced by createAndAddTeardropWithMask().
| void TEARDROP_MANAGER::DeleteTrackToTrackTeardrops | ( | BOARD_COMMIT & | aCommit | ) |
Definition at line 604 of file teardrop.cpp.
References m_board, STRUCT_DELETED, and TD_TRACKEND.
Referenced by DIALOG_GLOBAL_EDIT_TEARDROPS::TransferDataFromWindow().
|
private |
Build the copper collision index, deferred so a commit with no teardrop candidate never pays for it.
Definition at line 134 of file teardrop_utils.cpp.
References CLEARANCE_CONSTRAINT, ZONE::IsTeardropArea(), m_board, m_copperIndexed, m_copperRTree, PCB_GROUP_T, PCB_ZONE_T, and RECURSE.
Referenced by collidesWithOtherNets(), and createAndAddTeardropWithMask().
|
private |
| aStartPoint | is the start point of the track found (always inside the teardrop) |
| aEndPoint | is the start point of the track found (always outside the teardrop) |
| aIntersection | is the point where the track's centerline meets the pad/via edge |
| aTrack | is the track connected to the pad/via used to search a anchor point this reference can be modified if a connected track to the initial track is selected |
| aOther | is the via/pad/track used to build the teardrop |
| aOtherPos | is the via/pad position, or track start or end |
| aEffectiveTeardropLen | is the actual teardrop length, that can be smaller than expected if the connected track length is too small |
| aFollowTracks | = true to use a connected track to aTrack if aTrack is too small |
| aTrackLookupList | is the list of tracks to explore if aFollowTracks = true m_lengthRatio is the length of teardrop (ratio pad/via size/teardrop len) |
Definition at line 1122 of file teardrop_utils.cpp.
References SHAPE_ARC::ConvertToPolyline(), SHAPE_LINE_CHAIN::CPoint(), end, ERROR_INSIDE, findTouchingTrack(), PCB_TRACK::GetEnd(), BOARD_CONNECTED_ITEM::GetLayer(), PCB_TRACK::GetLength(), PCB_ARC::GetMid(), PCB_TRACK::GetStart(), PCB_TRACK::GetWidth(), GetWidth(), EDA_ITEM::HitTest(), SHAPE_LINE_CHAIN::Intersect(), IsRound(), KiROUND(), TEARDROP_PARAMETERS::m_AllowUseTwoTracks, TEARDROP_PARAMETERS::m_BestLengthRatio, m_board, TEARDROP_PARAMETERS::m_TdMaxLen, SHAPE_ARC::NearestPoint(), NormalizeVector(), SHAPE_POLY_SET::Outline(), PCB_ARC_T, PCB_PAD_T, SHAPE_LINE_CHAIN::PointCount(), radius, SHAPE_ARC::Reverse(), SHAPE_LINE_CHAIN::SetClosed(), SHAPE_LINE_CHAIN::SetPoint(), STARTPOINT, TEARDROP_PARAMETERS, TransformCircleToPolygon(), EDA_ITEM::Type(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by computeTeardropPolygon().
|
private |
Find a track connected to the end of another track.
| aMatchType | returns the end point id 0, STARTPOINT, ENDPOINT |
| aTrackRef | is the reference track |
| aSourceTrack | is the board track aTrackRef stands in for, excluded from the search |
| aEndpoint | is the coordinate to test |
| tracksRTree | is an RTree containing the available tracks |
Definition at line 511 of file teardrop_utils.cpp.
References BOARD_CONNECTED_ITEM::GetLayer(), and m_tracksRTree.
Referenced by findAnchorPointsOnTrack().
|
static |
Definition at line 58 of file teardrop_utils.cpp.
References PCB_TRACK::GetWidth(), pad, PCB_ARC_T, PCB_PAD_T, PCB_TRACE_T, PCB_VIA_T, EDA_ITEM::Type(), and via.
Referenced by AddTeardropsOnTracks(), computeAnchorPoints(), computeChordThroughShape(), computeCurvedForRoundShape(), computeFittedTeardropPolygon(), computeTeardropPolygon(), and findAnchorPointsOnTrack().
|
static |
Definition at line 80 of file teardrop_utils.cpp.
References CIRCLE, OVAL, pad, PCB_PAD_T, PCB_VIA_T, EDA_ITEM::Type(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by computeAnchorPoints(), computeChordThroughShape(), computeTeardropPolygon(), findAnchorPointsOnTrack(), and IsUniformlyRound().
|
static |
Definition at line 98 of file teardrop_utils.cpp.
References IsRound(), PCB_PAD_T, PCB_VIA_T, and EDA_ITEM::Type().
Referenced by DIALOG_GLOBAL_EDIT_TEARDROPS::processItem(), and DIALOG_GLOBAL_EDIT_TEARDROPS::visitItem().
Build the UUID of the mask sibling of aCopperUuid.
Producer and consumer of that pairing are far apart, so it has one home.
Definition at line 72 of file teardrop.cpp.
References KIID::Increment().
Referenced by createTeardropMask(), and RemoveTeardrops().
|
private |
Definition at line 183 of file teardrop_utils.cpp.
References clearance, CLEARANCE_CONSTRAINT, BOARD_DESIGN_SETTINGS::GetDRCEpsilon(), MINOPTMAX< T >::HasMin(), m_board, BOARD_DESIGN_SETTINGS::m_DRCEngine, m_pairClearanceCache, MINOPTMAX< T >::Min(), and DRC_CONSTRAINT::Value().
Referenced by collidesWithOtherNets().
| void TEARDROP_MANAGER::RemoveTeardrops | ( | BOARD_COMMIT & | aCommit, |
| std::vector< BOARD_ITEM * > * | dirtyPadsAndVias, | ||
| std::set< PCB_TRACK * > * | dirtyTracks, | ||
| const std::vector< BOARD_ITEM * > * | dirtyCopper = nullptr ) |
Remove teardrops on dirty pads, vias or tracks, and any whose neighbouring copper moved, dirtying the anchors of the latter.
Call this BEFORE connectivity is updated.
Definition at line 228 of file teardrop.cpp.
References B_Cu, BOX2< Vec >::Contains(), copperNetcode(), F_Cu, F_Mask, BOX2< Vec >::GetCenter(), BOX2< Vec >::Inflate(), BOX2< Vec >::Intersects(), m_board, maskUuidFor(), pad, STRUCT_DELETED, and via.
Referenced by BOARD_COMMIT::Push().
|
private |
Set priority of created teardrops.
smaller have bigger priority
Definition at line 616 of file teardrop.cpp.
References ZONE::GetFirstLayer(), ZONE::GetOutlineArea(), m_board, m_createdTdList, EDA_ITEM::m_Uuid, and MAGIC_TEARDROP_ZONE_ID.
Referenced by AddTeardropsOnTracks(), and UpdateTeardrops().
|
staticprivate |
Build the UUID a teardrop is created with.
| aSlot | separates the two teardrops of a crossing track; each slot spans two UUIDs |
Definition at line 58 of file teardrop.cpp.
References KIID::Combine(), KIID::Increment(), and EDA_ITEM::m_Uuid.
Referenced by AddTeardropsOnTracks(), and UpdateTeardrops().
|
private |
Attempts to create a track-to-track teardrop.
| aCommit | the board commit to add the teardrop to |
| aParams | the teardrop parameters |
| aTeardropVariant | = variant of the teardrop( attached to a pad, or a track end ) |
| aTrack | the track the teardrop geometry is built from |
| aSourceTrack | the board track it belongs to, the same as aTrack unless that is a stub |
| aCandidate | the target item |
| aPos | the connection position |
| aUuid | is the UUID to give the teardrop |
Definition at line 209 of file teardrop.cpp.
References computeFittedTeardropPolygon(), createAndAddTeardropWithMask(), and TEARDROP_PARAMETERS.
Referenced by AddTeardropsOnTracks(), and UpdateTeardrops().
| void TEARDROP_MANAGER::UpdateTeardrops | ( | BOARD_COMMIT & | aCommit, |
| const std::vector< BOARD_ITEM * > * | dirtyPadsAndVias, | ||
| const std::set< PCB_TRACK * > * | dirtyTracks, | ||
| bool | aForceFullUpdate = false ) |
Update teardrops on a list of items.
Definition at line 422 of file teardrop.cpp.
References AddTeardropsOnTracks(), areItemsInSameZone(), buildCrossingStub(), BuildTrackCaches(), computeChordThroughShape(), TEARDROP_PARAMETERS::m_BestWidthRatio, m_board, TEARDROP_PARAMETERS::m_Enabled, m_prmsList, TEARDROP_PARAMETERS::m_TdMaxWidth, TEARDROP_PARAMETERS::m_TdOnPadsInZones, m_tolerance, TEARDROP_PARAMETERS::m_WidthtoSizeFilterRatio, pad, PCB_ARC_T, PCB_TRACE_T, pcbIUScale, PCB_TRACK::SetStart(), setTeardropPriorities(), STRUCT_DELETED, TARGET_TRACK, TD_TYPE_PADVIA, TEARDROP_PARAMETERS, teardropUuid(), tryCreateTrackTeardrop(), via, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), ZONE_FILLER_TOOL::FillAllZones(), BOARD_COMMIT::Push(), and DIALOG_GLOBAL_EDIT_TEARDROPS::TransferDataFromWindow().
|
private |
Definition at line 215 of file teardrop_utils.cpp.
References m_board, and m_zoneConnectionCache.
Referenced by areItemsInSameZone().
|
friend |
Definition at line 87 of file teardrop.h.
References TEARDROP_PARAMETERS.
Referenced by AddTeardropsOnTracks(), computeAnchorPoints(), computeCurvedForRectShape(), computeCurvedForRoundShape(), computeFittedTeardropPolygon(), computeTeardropPolygon(), findAnchorPointsOnTrack(), TEARDROP_PARAMETERS, tryCreateTrackTeardrop(), and UpdateTeardrops().
|
private |
Definition at line 324 of file teardrop.h.
Referenced by AddTeardropsOnTracks(), areItemsInSameZone(), BuildTrackCaches(), collidesWithOtherNets(), computeAnchorPoints(), computeChordThroughShape(), computeCurvedForRectShape(), computeCurvedForRoundShape(), computeTeardropPolygon(), createAndAddTeardropWithMask(), createTeardrop(), createTeardropMask(), DeleteTrackToTrackTeardrops(), ensureCopperIndex(), findAnchorPointsOnTrack(), pairClearance(), RemoveTeardrops(), setTeardropPriorities(), TEARDROP_MANAGER(), UpdateTeardrops(), and zoneConnections().
|
mutableprivate |
Definition at line 334 of file teardrop.h.
Referenced by ensureCopperIndex(), and TEARDROP_MANAGER().
|
mutableprivate |
Every copper item plus the teardrops built so far, to keep teardrops off other nets.
Definition at line 333 of file teardrop.h.
Referenced by collidesWithOtherNets(), createAndAddTeardropWithMask(), and ensureCopperIndex().
|
private |
Definition at line 330 of file teardrop.h.
Referenced by createAndAddTeardropWithMask(), and setTeardropPriorities().
|
mutableprivate |
Definition at line 339 of file teardrop.h.
Referenced by pairClearance().
|
private |
Definition at line 326 of file teardrop.h.
Referenced by AddTeardropsOnTracks(), TEARDROP_MANAGER(), and UpdateTeardrops().
|
private |
Definition at line 322 of file teardrop.h.
Referenced by AddTeardropsOnTracks(), TEARDROP_MANAGER(), and UpdateTeardrops().
|
private |
Definition at line 325 of file teardrop.h.
Referenced by TEARDROP_MANAGER().
|
private |
Definition at line 329 of file teardrop.h.
Referenced by AddTeardropsOnTracks(), and BuildTrackCaches().
|
private |
Definition at line 328 of file teardrop.h.
Referenced by BuildTrackCaches(), and findTouchingTrack().
|
mutableprivate |
Definition at line 337 of file teardrop.h.
Referenced by zoneConnections().