Zone filler: clamp thermal stub width to the pad minimal size.
Setting stub width to a ridiculous large value (for instance 100 times the pad size) creates strange and broken shapes, and obviously stubs cannot be built. Ensure also the thermal shape is inside the zone boundary (because the algo adds areas this was previously possible) Fixes: lp:1837559 https://bugs.launchpad.net/kicad/+bug/1837559
This commit is contained in:
parent
30c724e858
commit
d208447cba
|
@ -760,6 +760,9 @@ void ZONE_FILLER::computeRawFilledArea( const ZONE_CONTAINER* aZone,
|
|||
}
|
||||
}
|
||||
|
||||
// Ensure previous changes (adding thermal stubs) do not add
|
||||
// filled areas outside the zone boundary
|
||||
aRawPolys.BooleanIntersection( aSmoothedOutline, SHAPE_POLY_SET::PM_FAST );
|
||||
aRawPolys.Simplify( SHAPE_POLY_SET::PM_FAST );
|
||||
|
||||
if( s_DumpZonesWhenFilling )
|
||||
|
@ -793,7 +796,7 @@ void ZONE_FILLER::computeRawFilledArea( const ZONE_CONTAINER* aZone,
|
|||
|
||||
// If we've deflated/inflated by something near our corner radius then we will have
|
||||
// ended up with too-sharp corners. Apply outline smoothing again.
|
||||
if( aZone->GetMinThickness() > aZone->GetCornerRadius() )
|
||||
if( aZone->GetMinThickness() > (int)aZone->GetCornerRadius() )
|
||||
aRawPolys.BooleanIntersection( aSmoothedOutline, SHAPE_POLY_SET::PM_FAST );
|
||||
}
|
||||
|
||||
|
@ -901,7 +904,14 @@ void ZONE_FILLER::buildThermalSpokes( const ZONE_CONTAINER* aZone,
|
|||
int thermalReliefGap = aZone->GetThermalReliefGap( pad );
|
||||
|
||||
// Calculate thermal bridge half width
|
||||
int spoke_half_w = aZone->GetThermalReliefCopperBridge( pad ) / 2;
|
||||
int spoke_w = aZone->GetThermalReliefCopperBridge( pad );
|
||||
// Avoid spoke_w bigger than the smaller pad size, because
|
||||
// it is not possible to create stubs bigger than the pad.
|
||||
// Possible refinement: have a separate size for vertical and horizontal stubs
|
||||
spoke_w = std::min( spoke_w, pad->GetSize().x );
|
||||
spoke_w = std::min( spoke_w, pad->GetSize().y );
|
||||
|
||||
int spoke_half_w = spoke_w / 2;
|
||||
|
||||
// Quick test here to possibly save us some work
|
||||
BOX2I itemBB = pad->GetBoundingBox();
|
||||
|
|
Loading…
Reference in New Issue