pcbnew: Move zone-knockout to default high def

Most rounding operations have been shifted to an absolute error
calculation and the ability to adjust zone segment counts has been
removed in 5.1.  The remaining elements that use fixed segment counts
are either 18 (DRC) or 32 (plotting).  This aligns the punchout segment
count with the higher (32) definition value
This commit is contained in:
Seth Hillbrand 2019-01-03 05:22:32 -07:00
parent 7d06651a10
commit 064303e238
2 changed files with 9 additions and 16 deletions

View File

@ -312,21 +312,19 @@ bool ZONE_FILLER::Fill( std::vector<ZONE_CONTAINER*> aZones, bool aCheck )
void ZONE_FILLER::buildZoneFeatureHoleList( const ZONE_CONTAINER* aZone, void ZONE_FILLER::buildZoneFeatureHoleList( const ZONE_CONTAINER* aZone,
SHAPE_POLY_SET& aFeatures ) const SHAPE_POLY_SET& aFeatures ) const
{ {
int segsPerCircle;
double correctionFactor;
// Set the number of segments in arc approximations // Set the number of segments in arc approximations
if( aZone->GetArcSegmentCount() > SEGMENT_COUNT_CROSSOVER ) // Since we can no longer edit the segment count in pcbnew, we set
segsPerCircle = ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF; // the fill to our high-def count to avoid jagged knock-outs
else // However, if the user has edited their zone to increase the segment count,
segsPerCircle = ARC_APPROX_SEGMENTS_COUNT_LOW_DEF; // we keep this preference
int segsPerCircle = std::max( aZone->GetArcSegmentCount(), ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF );
/* calculates the coeff to compensate radius reduction of holes clearance /* calculates the coeff to compensate radius reduction of holes clearance
* due to the segment approx. * due to the segment approx.
* For a circle the min radius is radius * cos( 2PI / segsPerCircle / 2) * For a circle the min radius is radius * cos( 2PI / segsPerCircle / 2)
* correctionFactor is 1 /cos( PI/segsPerCircle ) * correctionFactor is 1 /cos( PI/segsPerCircle )
*/ */
correctionFactor = GetCircletoPolyCorrectionFactor( segsPerCircle ); double correctionFactor = GetCircletoPolyCorrectionFactor( segsPerCircle );
aFeatures.RemoveAllContours(); aFeatures.RemoveAllContours();
@ -701,22 +699,17 @@ void ZONE_FILLER::computeRawFilledAreas( const ZONE_CONTAINER* aZone,
SHAPE_POLY_SET& aRawPolys, SHAPE_POLY_SET& aRawPolys,
SHAPE_POLY_SET& aFinalPolys ) const SHAPE_POLY_SET& aFinalPolys ) const
{ {
int segsPerCircle;
double correctionFactor;
int outline_half_thickness = aZone->GetMinThickness() / 2; int outline_half_thickness = aZone->GetMinThickness() / 2;
std::unique_ptr<SHAPE_FILE_IO> dumper( new SHAPE_FILE_IO( std::unique_ptr<SHAPE_FILE_IO> dumper( new SHAPE_FILE_IO(
s_DumpZonesWhenFilling ? "zones_dump.txt" : "", SHAPE_FILE_IO::IOM_APPEND ) ); s_DumpZonesWhenFilling ? "zones_dump.txt" : "", SHAPE_FILE_IO::IOM_APPEND ) );
// Set the number of segments in arc approximations // Set the number of segments in arc approximations
if( aZone->GetArcSegmentCount() == ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF ) int segsPerCircle = std::max( aZone->GetArcSegmentCount(), ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF );
segsPerCircle = ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF;
else
segsPerCircle = ARC_APPROX_SEGMENTS_COUNT_LOW_DEF;
/* calculates the coeff to compensate radius reduction of holes clearance /* calculates the coeff to compensate radius reduction of holes clearance
*/ */
correctionFactor = GetCircletoPolyCorrectionFactor( segsPerCircle ); double correctionFactor = GetCircletoPolyCorrectionFactor( segsPerCircle );
if( s_DumpZonesWhenFilling ) if( s_DumpZonesWhenFilling )
dumper->BeginGroup( "clipper-zone" ); dumper->BeginGroup( "clipper-zone" );

View File

@ -51,7 +51,7 @@ ZONE_SETTINGS::ZONE_SETTINGS()
m_CurrentZone_Layer = F_Cu; // Layer used to create the current zone m_CurrentZone_Layer = F_Cu; // Layer used to create the current zone
m_Zone_HatchingStyle = ZONE_CONTAINER::DIAGONAL_EDGE; // Option to show the zone area (outlines only, short hatches or full hatches m_Zone_HatchingStyle = ZONE_CONTAINER::DIAGONAL_EDGE; // Option to show the zone area (outlines only, short hatches or full hatches
m_ArcToSegmentsCount = ARC_APPROX_SEGMENTS_COUNT_LOW_DEF; // Option to select number of segments to approximate a circle m_ArcToSegmentsCount = ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF; // Option to select number of segments to approximate a circle
// ARC_APPROX_SEGMENTS_COUNT_LOW_DEF // ARC_APPROX_SEGMENTS_COUNT_LOW_DEF
// or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF segments // or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF segments