A better blob vs web detector.
Since we're in a deflated state, a long web *could* still have a very
small area. So check max extents instead.
(cherry picked from commit 1dae5eb7c4
)
This commit is contained in:
parent
601995c759
commit
a60e7e27b6
|
@ -50,6 +50,15 @@ public:
|
|||
m_init( true )
|
||||
{ }
|
||||
|
||||
template<class T>
|
||||
EDA_RECT( const BOX2<T> aBox )
|
||||
{
|
||||
m_pos = (wxPoint) aBox.GetPosition();
|
||||
m_size.x = aBox.GetWidth();
|
||||
m_size.y = aBox.GetHeight();
|
||||
m_init = true;
|
||||
}
|
||||
|
||||
virtual ~EDA_RECT() { };
|
||||
|
||||
wxPoint Centre() const
|
||||
|
|
|
@ -1190,15 +1190,14 @@ bool ZONE_FILLER::computeRawFilledArea( const ZONE* aZone,
|
|||
|
||||
// Min-thickness is the web thickness. On the other hand, a blob min-thickness by
|
||||
// min-thickness is not useful. Since there's no obvious definition of web vs. blob, we
|
||||
// arbitrarily choose "at least 2X the area".
|
||||
double minArea = (double) aZone->GetMinThickness() * aZone->GetMinThickness() * 2;
|
||||
|
||||
for( int ii = aFillPolys.OutlineCount() - 1; ii >= 0; ii-- )
|
||||
// arbitrarily choose "at least 1/2 min-thickness on one axis".
|
||||
for( int ii = aRawPolys.OutlineCount() - 1; ii >= 0; ii-- )
|
||||
{
|
||||
std::vector<SHAPE_LINE_CHAIN>& island = aFillPolys.Polygon( ii );
|
||||
std::vector<SHAPE_LINE_CHAIN>& island = aRawPolys.Polygon( ii );
|
||||
EDA_RECT islandExtents = island.front().BBox();
|
||||
|
||||
if( island.empty() || island.front().Area() < minArea )
|
||||
aFillPolys.DeletePolygon( ii );
|
||||
if( islandExtents.GetSizeMax() < half_min_width )
|
||||
aRawPolys.DeletePolygon( ii );
|
||||
}
|
||||
|
||||
DUMP_POLYS_TO_COPPER_LAYER( aRawPolys, In9_Cu, wxT( "deflated" ) );
|
||||
|
|
Loading…
Reference in New Issue