Pcbnew: prepare the new zone filling algo (filled polygons with no thickness). Work in progress.

This commit is contained in:
jean-pierre charras 2019-06-04 21:15:21 +02:00
parent 0ea75cb4e7
commit eb1faebf1f
4 changed files with 22 additions and 2 deletions

View File

@ -77,6 +77,7 @@ feature2
fill
fill_segments
filled_polygon
filled_areas_thickness
fillet
font
fp_arc

View File

@ -589,7 +589,7 @@ public:
unsigned int GetCornerRadius() const { return m_cornerRadius; }
bool GetFilledPolysUseThickness() const { return m_FilledPolysUseThickness; }
void SetFilledPolysUseThickness( bool aWidth ) { m_FilledPolysUseThickness = aWidth; }
void SetFilledPolysUseThickness( bool aOption ) { m_FilledPolysUseThickness = aOption; }
/**

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2012 CERN
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -529,6 +529,10 @@ void PCB_IO::formatSetup( BOARD* aBoard, int aNestLevel ) const
m_out->Print( aNestLevel+1, "(max_error %s)\n",
FormatInternalUnits( dsnSettings.m_MaxError ).c_str() );
// Store this option only if it is not the legacy option:
if( dsnSettings.m_ZoneUseNoOutlineInFill )
m_out->Print( aNestLevel+1, "(filled_areas_thickness no)\n" );
// 6.0 TODO: are we going to update the tokens we save these under?
// 6.0 TODO: need to save the LAYER_CLASS_OTHERS stuff
// 6.0 TODO: need to save the TextItalic and TextUpright settings
@ -1710,6 +1714,11 @@ void PCB_IO::format( ZONE_CONTAINER* aZone, int aNestLevel ) const
m_out->Print( aNestLevel+1, "(min_thickness %s)",
FormatInternalUnits( aZone->GetMinThickness() ).c_str() );
// write it only if V 6.O version option is not used (i.e. do not write if the
// "legacy" algorithm is used)
if( !aZone->GetFilledPolysUseThickness() )
m_out->Print( 0, " (filled_areas_thickness no)" );
m_out->Print( 0, "\n" );
if( aZone->GetIsKeepout() )

View File

@ -1385,6 +1385,11 @@ void PCB_PARSER::parseSetup()
NeedRIGHT();
break;
case T_filled_areas_thickness:
designSettings.m_ZoneUseNoOutlineInFill = not parseBool();
NeedRIGHT();
break;
case T_pcbplotparams:
{
PCB_PLOT_PARAMS plotParams;
@ -3174,6 +3179,11 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER()
NeedRIGHT();
break;
case T_filled_areas_thickness:
zone->SetFilledPolysUseThickness( parseBool() );
NeedRIGHT();
break;
case T_fill:
for( token = NextTok(); token != T_RIGHT; token = NextTok() )
{