Fix missing filtering of teardrop targets.

This commit is contained in:
jean-pierre charras 2022-01-16 15:00:40 +01:00
parent 516d038bdf
commit ef6ce972d6
3 changed files with 12 additions and 3 deletions

View File

@ -102,8 +102,11 @@ int TEARDROP_MANAGER::SetTeardrops( BOARD_COMMIT* aCommitter,
// get vias, PAD_ATTRIB_PTH and others if aIncludeNotDrilled == true
// (custom pads are not collected)
std::vector< VIAPAD > viapad_list;
collectVias( viapad_list );
collectPadsCandidate( viapad_list, m_applyToRoundShapesOnly, m_applyToSurfacePads );
if( m_applyToViaPads )
collectVias( viapad_list );
collectPadsCandidate( viapad_list, m_applyToViaPads, m_applyToRoundShapesOnly, m_applyToSurfacePads );
TRACK_BUFFER trackLookupList;
@ -257,7 +260,7 @@ int TEARDROP_MANAGER::addTeardropsOnTracks( BOARD_COMMIT* aCommitter )
// teardrop inside a pad or via area
std::vector< VIAPAD > viapad_list;
collectVias( viapad_list );
collectPadsCandidate( viapad_list, true, true );
collectPadsCandidate( viapad_list, true, true, true );
m_CurrParams = &m_Parameters[TARGET_TRACK];
// Explore groups (a group is a set of tracks on the same layer and the same net):

View File

@ -250,10 +250,12 @@ private:
* Pads with no net are not candidate (and have no track connected
* Custom pads are not candidate because one cannot define a teardrop shape
* @param aList is the list of VIAPAD to fill
* @param aDrilledViaPad = true to include drilled shapes
* @param aRoundShapesOnly = true to ignore not round shapes
* @param aIncludeNotDrilled = true to include not drilled pads like SMD
*/
void collectPadsCandidate( std::vector< VIAPAD >& aList,
bool aDrilledViaPad,
bool aRoundShapesOnly,
bool aIncludeNotDrilled ) const;

View File

@ -110,6 +110,7 @@ void TEARDROP_MANAGER::collectVias( std::vector< VIAPAD >& aList ) const
void TEARDROP_MANAGER::collectPadsCandidate( std::vector< VIAPAD >& aList,
bool aDrilledViaPad,
bool aRoundShapesOnly,
bool aIncludeNotDrilled ) const
{
@ -137,6 +138,9 @@ void TEARDROP_MANAGER::collectPadsCandidate( std::vector< VIAPAD >& aList,
bool has_hole = pad->GetDrillSizeX() > 0 && pad->GetDrillSizeY() > 0;
if( has_hole && !aDrilledViaPad )
continue;
if( has_hole || aIncludeNotDrilled )
aList.emplace_back( pad );
}