Commit 96a77d76 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: Add a min width parameter to plot solder mask layers.

* If this param is set to 0, the previous behavior is used.
* Else the solder mask is plotted as polygon, with shapes near than  this min width value are  merged.
Pcbnew in nanometer version: fix a serious rounding issue due to the fact dialogs were using 4 digits for mantissa.
* This is not enough for nanometer coordinates ( 8 are needed to display a value in inches),
*  so sometimes after closing a dialog, some coordinates were modified, although no new value was entered.
Minor other bug fixed.
parents 31e58d87 703293fa
......@@ -427,6 +427,7 @@ set( BMAPS_MID
ortho
pad_sketch
pad
pad_dimensions
pads_mask_layers
palette
part_properties
......
/* Do not modify this file, it was automatically generated by the
* PNG2cpp CMake script, using a *.png file as input.
*/
#include <bitmaps.h>
static const unsigned char png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x1a, 0x08, 0x06, 0x00, 0x00, 0x00, 0xa9, 0x4a, 0x4c,
0xce, 0x00, 0x00, 0x04, 0x35, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0x9d, 0x95, 0x5d, 0x6c, 0x14,
0x55, 0x14, 0x80, 0xf7, 0xa7, 0xdd, 0xba, 0x3f, 0x33, 0x73, 0xa7, 0xdb, 0x9d, 0x69, 0xeb, 0x02,
0x16, 0x46, 0xda, 0x6d, 0x67, 0xfb, 0x60, 0x25, 0x14, 0xd1, 0x80, 0x82, 0x46, 0x48, 0x94, 0x46,
0x20, 0x60, 0x10, 0xf4, 0x41, 0x20, 0xfe, 0xbd, 0xc0, 0x83, 0x21, 0x15, 0x53, 0x51, 0xcc, 0x4a,
0xe5, 0xa1, 0x5a, 0x1f, 0xc0, 0x1f, 0x12, 0xb6, 0xc5, 0x62, 0xa4, 0xa0, 0x96, 0x16, 0x52, 0x69,
0x35, 0x8d, 0x60, 0x05, 0x62, 0xa2, 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0x44, 0xfe, 0x7e, 0xca, 0x29, 0xe2, 0x64, 0x05, 0xac, 0xde, 0x74,
0xa6, 0x2b, 0x91, 0x8d, 0x6c, 0xb3, 0xb7, 0xb1, 0x15, 0xac, 0x46, 0x68, 0x5f, 0x2b, 0x65, 0x13,
0x73, 0xd9, 0xe6, 0x9a, 0x49, 0xc4, 0xef, 0x19, 0x2d, 0x25, 0xbd, 0x6f, 0x90, 0x30, 0xdb, 0x03,
0x0d, 0x99, 0xcb, 0x26, 0xe1, 0x67, 0x31, 0xce, 0xac, 0x79, 0x72, 0x89, 0xd2, 0x84, 0x2e, 0x96,
0x30, 0x9f, 0x91, 0x97, 0x2a, 0xd3, 0x4c, 0x12, 0xca, 0xbf, 0x3d, 0x4e, 0xfc, 0x16, 0xbb, 0x02,
0x66, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
};
const BITMAP_OPAQUE pad_dimensions_xpm[1] = {{ png, sizeof( png ), "pad_dimensions_xpm" }};
//EOF
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
height="48"
width="48"
version="1.1"
id="svg3054"
inkscape:version="0.48.2 r9819"
sodipodi:docname="pad.svg">
<metadata
id="metadata3081">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="879"
inkscape:window-height="789"
id="namedview3079"
showgrid="false"
inkscape:zoom="4.9166667"
inkscape:cx="25.116"
inkscape:cy="26.510998"
inkscape:window-x="219"
inkscape:window-y="76"
inkscape:window-maximized="0"
inkscape:current-layer="svg3054" />
<defs
id="defs3056">
<filter
id="a"
height="1.2769"
width="1.2769"
color-interpolation-filters="sRGB"
y="-.13847"
x="-.13847">
<feGaussianBlur
stdDeviation="0.11539203"
id="feGaussianBlur3059" />
</filter>
<filter
color-interpolation-filters="sRGB"
inkscape:collect="always"
id="filter3879">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.24369333"
id="feGaussianBlur3881" />
</filter>
<marker
id="h"
refY="0"
refX="0"
overflow="visible"
orient="auto"
style="overflow:visible">
<path
d="M 8.7186,4.0337 -2.2074,0.016 8.7186,-4.0017 c -1.7455,2.3721 -1.7354,5.6175 -6e-7,8.0354 z"
transform="scale(0.6,0.6)"
id="path10"
inkscape:connector-curvature="0"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
</marker>
<marker
id="g"
refY="0"
refX="0"
overflow="visible"
orient="auto"
style="overflow:visible">
<path
d="M 8.7186,4.0337 -2.2074,0.016 8.7186,-4.0017 c -1.7455,2.3721 -1.7354,5.6175 -6e-7,8.0354 z"
transform="scale(-0.6,-0.6)"
id="path13"
inkscape:connector-curvature="0"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
</marker>
<filter
color-interpolation-filters="sRGB"
inkscape:collect="always"
id="filter3879-1">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.24369333"
id="feGaussianBlur3881-7" />
</filter>
<marker
id="h-4"
refY="0"
refX="0"
overflow="visible"
orient="auto"
style="overflow:visible">
<path
d="M 8.7186,4.0337 -2.2074,0.016 8.7186,-4.0017 c -1.7455,2.3721 -1.7354,5.6175 -6e-7,8.0354 z"
transform="scale(0.6,0.6)"
id="path10-0"
inkscape:connector-curvature="0"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
</marker>
<marker
id="g-9"
refY="0"
refX="0"
overflow="visible"
orient="auto"
style="overflow:visible">
<path
d="M 8.7186,4.0337 -2.2074,0.016 8.7186,-4.0017 c -1.7455,2.3721 -1.7354,5.6175 -6e-7,8.0354 z"
transform="scale(-0.6,-0.6)"
id="path13-4"
inkscape:connector-curvature="0"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
</marker>
<marker
id="marker4760"
refY="0"
refX="0"
overflow="visible"
orient="auto"
style="overflow:visible">
<path
d="M 8.7186,4.0337 -2.2074,0.016 8.7186,-4.0017 c -1.7455,2.3721 -1.7354,5.6175 -6e-7,8.0354 z"
transform="scale(0.6,0.6)"
id="path4762"
inkscape:connector-curvature="0"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
</marker>
<marker
id="marker4764"
refY="0"
refX="0"
overflow="visible"
orient="auto"
style="overflow:visible">
<path
d="M 8.7186,4.0337 -2.2074,0.016 8.7186,-4.0017 c -1.7455,2.3721 -1.7354,5.6175 -6e-7,8.0354 z"
transform="scale(-0.6,-0.6)"
id="path4766"
inkscape:connector-curvature="0"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round" />
</marker>
</defs>
<g
transform="matrix(1.286,0,0,1.2826,58.06922,-14.528373)"
id="g3061">
<g
transform="matrix(11.8,0,0,11.536,-260.89,-12.073)"
id="g3063"
style="opacity:0.71875;filter:url(#a)">
<path
d="m -15.125,8.9375 a 0.90625,0.9375 0 1 1 -1.8125,0 0.90625,0.9375 0 1 1 1.8125,0 z"
transform="matrix(1.1034,0,-2.1667e-7,1.0667,37.69,-5.5333)"
id="path3065"
inkscape:connector-curvature="0"
style="fill-rule:evenodd" />
</g>
<path
d="m -15.125,8.9375 a 0.90625,0.9375 0 1 1 -1.8125,0 0.90625,0.9375 0 1 1 1.8125,0 z"
transform="matrix(9.1879,0,-1.8041e-6,8.7704,119.31,-46.412)"
id="path3067"
inkscape:connector-curvature="0"
style="fill:none;stroke:#16bf11;stroke-width:0.79392999" />
<g
transform="matrix(4.6582,0,0,4.6768,-121.15,13.266)"
id="g3069"
style="fill:#ffffff">
<path
d="m -15.125,8.9375 a 0.90625,0.9375 0 1 1 -1.8125,0 0.90625,0.9375 0 1 1 1.8125,0 z"
transform="matrix(1.1034,0,-2.1667e-7,1.0667,37.69,-5.5333)"
id="path3071"
inkscape:connector-curvature="0"
style="fill:#ffffff;fill-rule:evenodd" />
</g>
</g>
<g
transform="matrix(3.3534,0,0,2.4765,-1.5227797,14.344627)"
id="g3073">
<rect
height="16"
width="16"
y="0"
x="0"
id="rect3075"
style="fill-opacity:0" />
</g>
<path
d="m 30.69521,26.522581 a 8.707635,8.658066 0 0 1 -17.41527,0 8.707635,8.658066 0 1 1 17.41527,0 z"
id="path3077"
inkscape:connector-curvature="0"
style="fill:none;stroke:#ff0c0c;stroke-width:6.90841627;stroke-linejoin:round" />
<g
id="g4856"
transform="matrix(1,0,0,1.1269296,0,-3.477462)">
<path
d="M 8.3115104,8.2557245 36.075414,8.1934141"
id="path44"
style="fill:none;stroke:#000000;stroke-width:1.75850904px;marker-start:url(#h);marker-end:url(#g)"
inkscape:connector-curvature="0" />
<rect
height="24.035736"
width="3.0803609"
y="3.3610315"
x="3.8921013"
id="rect46"
style="fill:#2c2cff;fill-opacity:1" />
<rect
transform="scale(-1,1)"
height="23.291401"
width="3.0848782"
y="3.3610315"
x="-40.90612"
id="rect48"
style="fill:#2c2cff;fill-opacity:1" />
</g>
<g
id="g50"
transform="matrix(1.6262979,0,0,1.2104957,-29.057051,-8.38233)">
<rect
style="fill-opacity:0"
id="rect52"
x="0"
y="0"
width="16"
height="16" />
</g>
</svg>
......@@ -65,7 +65,15 @@ double To_User_Unit( EDA_UNITS_T aUnit, double aValue )
}
}
/* Convert a value to a string using double notation.
* For readability, the mantissa has 0, 1, 3 or 4 digits, depending on units
* for unit = inch the mantissa has 3 digits (Eeschema) or 4 digits
* for unit = mil the mantissa has 0 digits (Eeschema) or 1 digits
* for unit = mm the mantissa has 3 digits (Eeschema) or 4 digits
* Should be used only to display info in status,
* but not in dialogs, because 4 digits only
* could truncate the actual value
*/
wxString CoordinateToString( int aValue, bool aConvertToMils )
{
return LengthDoubleToString( (double) aValue, aConvertToMils );
......@@ -86,8 +94,7 @@ wxString LengthDoubleToString( double aValue, bool aConvertToMils )
#else
format = wxT( "%.1f" );
#endif
if( aConvertToMils )
value *= 1000;
value *= 1000;
}
else
{
......@@ -118,17 +125,49 @@ wxString LengthDoubleToString( double aValue, bool aConvertToMils )
}
/* Convert a value to a string using double notation.
* For readability, the mantissa has 3 or more digits (max 8 digits),
* the trailing 0 are removed if the mantissa has more than 3 digits
* and some trailing 0
* This function should be used to display values in dialogs because a value
* entered in mm (for instance 2.0 mm) could need up to 8 digits mantissa
* if displayed in inch to avoid truncation or rounding made just by the printf function.
* otherwise the actual value is rounded when read from dialog and converted
* in internal units, and therefore modified.
*/
wxString ReturnStringFromValue( EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymbol )
{
wxString StringValue;
wxString stringValue;
double value_to_print;
value_to_print = To_User_Unit( aUnit, aValue );
#if defined( PCBNEW )
StringValue.Printf( wxT( "%.4f" ), value_to_print );
#if defined( EESCHEMA )
stringValue.Printf( wxT( "%.3f" ), value_to_print );
#else
StringValue.Printf( wxT( "%.3f" ), value_to_print );
#if defined( USE_PCBNEW_NANOMETRES )
stringValue.Printf( wxT( "%.8f" ), value_to_print );
#else
stringValue.Printf( wxT( "%.4f" ), value_to_print );
#endif
// Strip trailing zeros. However, keep at least 3 digits in mantissa
// For readability
struct lconv * lc = localeconv();
char sep = lc->decimal_point[0];
unsigned sep_pos = stringValue.Find( sep );
if( sep_pos > 0 )
{
// We want to keep at least 3 digits after the separator
unsigned min_len = sep_pos + 4;
while( stringValue.Len() > min_len )
if( stringValue.Last() == '0' )
stringValue.RemoveLast();
else
break;
}
#endif
if( aAddUnitSymbol )
......@@ -136,11 +175,11 @@ wxString ReturnStringFromValue( EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymb
switch( aUnit )
{
case INCHES:
StringValue += _( " \"" );
stringValue += _( " \"" );
break;
case MILLIMETRES:
StringValue += _( " mm" );
stringValue += _( " mm" );
break;
case UNSCALED_UNITS:
......@@ -148,7 +187,7 @@ wxString ReturnStringFromValue( EDA_UNITS_T aUnit, int aValue, bool aAddUnitSymb
}
}
return StringValue;
return stringValue;
}
......
......@@ -119,6 +119,7 @@ pads
pad_drill
pad_size
pad_to_mask_clearance
solder_mask_min_width
pad_to_paste_clearance
pad_to_paste_clearance_ratio
page
......
......@@ -53,6 +53,11 @@ double To_User_Unit( EDA_UNITS_T aUnit, double aValue );
* is a helper to convert the \a integer coordinate \a aValue to a string in inches,
* millimeters, or unscaled units according to the current user units setting.
*
* Should be used only to display a coordinate in status, but not in dialogs,
* because the mantissa of the number displayed has 4 digits max for readability.
* (i.e. the value shows the decimils or the microns )
* However the actual internal value could need up to 8 digits to be printed
*
* @param aValue The integer coordinate to convert.
* @param aConvertToMils Convert inch values to mils if true. This setting has no effect if
* the current user unit is millimeters.
......@@ -65,6 +70,11 @@ wxString CoordinateToString( int aValue, bool aConvertToMils = false );
* is a helper to convert the \a double length \a aValue to a string in inches,
* millimeters, or unscaled units according to the current user units setting.
*
* Should be used only to display a coordinate in status, but not in dialogs,
* because the mantissa of the number displayed has 4 digits max for readability.
* (i.e. the value shows the decimils or the microns )
* However the actual internal value could need up to 8 digits to be printed
*
* @param aValue The double value to convert.
* @param aConvertToMils Convert inch values to mils if true. This setting has no effect if
* the current user unit is millimeters.
......@@ -76,6 +86,16 @@ wxString LengthDoubleToString( double aValue, bool aConvertToMils = false );
* Function ReturnStringFromValue
* returns the string from \a aValue according to units (inch, mm ...) for display,
* and the initial unit for value.
*
* For readability, the mantissa has 3 or more digits (max 8 digits),
* the trailing 0 are removed if the mantissa has more than 3 digits
* and some trailing 0
* This function should be used to display values in dialogs because a value
* entered in mm (for instance 2.0 mm) could need up to 8 digits mantissa
* if displayed in inch to avoid truncation or rounding made just by the printf function.
* otherwise the actual value is rounded when read from dialog and converted
* in internal units, and therefore modified.
*
* @param aUnit = display units (INCHES, MILLIMETRE ..)
* @param aValue = value in Internal_Unit
* @param aAddUnitSymbol = true to add symbol unit to the string value
......@@ -120,7 +140,7 @@ int ReturnValueFromString( EDA_UNITS_T aUnits, const wxString& aTextValue );
/**
* Function ReturnValueFromString
* converts \a aTextValue in \a aUnits to internal units used by the application,
* converts \a aTextValue in \a aUnits to internal units used by the application,
* unit type will be obtained from g_UserUnit.
*
* @param aTextValue A reference to a wxString object containing the string to convert.
......
......@@ -351,6 +351,7 @@ EXTERN_BITMAP( opt_show_polygon_xpm )
EXTERN_BITMAP( orient_xpm )
EXTERN_BITMAP( pad_sketch_xpm )
EXTERN_BITMAP( pad_xpm )
EXTERN_BITMAP( pad_dimensions_xpm )
EXTERN_BITMAP( pads_mask_layers_xpm )
EXTERN_BITMAP( palette_xpm )
EXTERN_BITMAP( part_properties_xpm )
......
......@@ -34,6 +34,9 @@ public:
// Global mask margins:
int m_SolderMaskMargin; ///< Solder mask margin
int m_SolderMaskMinWidth; ///< Solder mask min width
// 2 areas near than m_SolderMaskMinWidth
// are merged
int m_SolderPasteMargin; ///< Solder paste margin absolute value
double m_SolderPasteMarginRatio; ///< Solder pask margin ratio value of pad size
///< The final margin is the sum of these 2 values
......
......@@ -25,6 +25,7 @@
#define DEFAULT_GR_MODULE_THICKNESS Millimeter2iu( 0.15 )
#define DEFAULT_SOLDERMASK_CLEARANCE Millimeter2iu( 0.1 )
#define DEFAULT_SOLDERMASK_MIN_WIDTH Millimeter2iu( 0.0 )
BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
......@@ -63,7 +64,8 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
m_MicroViasMinDrill = DMils2iu( 50 ); // micro vias (not vias) min drill diameter
// Global mask margins:
m_SolderMaskMargin = DEFAULT_SOLDERMASK_CLEARANCE; // Solder mask margin
m_SolderMaskMargin = DEFAULT_SOLDERMASK_CLEARANCE; // Solder mask margin
m_SolderMaskMinWidth = DEFAULT_SOLDERMASK_MIN_WIDTH; // Solder mask min width
m_SolderPasteMargin = 0; // Solder paste margin absolute value
m_SolderPasteMarginRatio = 0.0; // Solder pask margin ratio value of pad size
// The final margin is the sum of these 2 values
......@@ -120,6 +122,11 @@ void BOARD_DESIGN_SETTINGS::AppendConfigs( PARAM_CFG_ARRAY* aResult )
DEFAULT_SOLDERMASK_CLEARANCE, 0, Millimeter2iu( 1.0 ),
NULL, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "SolderMaskMinWidth" ),
&m_SolderMaskMinWidth,
DEFAULT_SOLDERMASK_MIN_WIDTH, 0, Millimeter2iu( 0.5 ),
NULL, MM_PER_IU ) );
aResult->push_back( new PARAM_CFG_INT_WITH_SCALE( wxT( "DrawSegmentWidth" ),
&m_DrawSegmentWidth,
DEFAULT_GRAPHIC_THICKNESS,
......
......@@ -640,8 +640,8 @@ void D_PAD::DisplayInfo( EDA_DRAW_FRAME* frame )
{
Line = frame->CoordinateToString( (unsigned) m_Drill.x );
wxString msg;
Line = frame->CoordinateToString( (unsigned) m_Drill.y );
Line += wxT( " / " ) + msg;
msg = frame->CoordinateToString( (unsigned) m_Drill.y );
Line += wxT( "/" ) + msg;
frame->AppendMsgPanel( _( "Drill X / Y" ), Line, RED );
}
......@@ -649,10 +649,10 @@ void D_PAD::DisplayInfo( EDA_DRAW_FRAME* frame )
if( module_orient )
Line.Printf( wxT( "%3.1f(+%3.1f)" ),
(float) ( m_Orient - module_orient ) / 10,
(float) module_orient / 10 );
(double) ( m_Orient - module_orient ) / 10,
(double) module_orient / 10 );
else
Line.Printf( wxT( "%3.1f" ), (float) m_Orient / 10 );
Line.Printf( wxT( "%3.1f" ), (double) m_Orient / 10 );
frame->AppendMsgPanel( _( "Orient" ), Line, LIGHTBLUE );
......
......@@ -248,8 +248,12 @@ bool DIALOG_SVG_PRINT::CreateSVGFile( const wxString& aFullFileName )
PCB_PLOT_PARAMS m_plotOpts;
m_plotOpts.SetPlotFrameRef( PrintPageRef() );
// Adding drill marks
m_plotOpts.SetDrillMarksType( PCB_PLOT_PARAMS::FULL_DRILL_SHAPE );
// Adding drill marks, for copper layers
if( (m_PrintMaskLayer & ALL_CU_LAYERS) )
m_plotOpts.SetDrillMarksType( PCB_PLOT_PARAMS::FULL_DRILL_SHAPE );
else
m_plotOpts.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE );
m_plotOpts.SetSkipPlotNPTH_Pads( false );
......
......@@ -43,38 +43,40 @@
DIALOG_PADS_MASK_CLEARANCE::DIALOG_PADS_MASK_CLEARANCE( PCB_EDIT_FRAME* aParent ) :
DIALOG_PADS_MASK_CLEARANCE_BASE( aParent )
{
m_Parent = aParent;
m_BrdSettings = m_Parent->GetBoard()->GetDesignSettings();
m_parent = aParent;
m_brdSettings = m_parent->GetBoard()->GetDesignSettings();
MyInit();
myInit();
m_sdbButtonsSizerOK->SetDefault();
GetSizer()->SetSizeHints( this );
Centre();
}
void DIALOG_PADS_MASK_CLEARANCE::MyInit()
void DIALOG_PADS_MASK_CLEARANCE::myInit()
{
SetFocus();
m_SolderMaskMarginUnits->SetLabel( GetUnitsLabel( g_UserUnit ) );
m_solderMaskMinWidthUnit->SetLabel( GetUnitsLabel( g_UserUnit ) );
m_SolderPasteMarginUnits->SetLabel( GetUnitsLabel( g_UserUnit ) );
PutValueInLocalUnits( *m_SolderMaskMarginCtrl, m_BrdSettings.m_SolderMaskMargin );
PutValueInLocalUnits( *m_SolderMaskMarginCtrl, m_brdSettings.m_SolderMaskMargin );
PutValueInLocalUnits( *m_SolderMaskMinWidthCtrl, m_brdSettings.m_SolderMaskMinWidth );
// These 2 parameters are usually < 0, so prepare entering a negative
// value, if current is 0
PutValueInLocalUnits( *m_SolderPasteMarginCtrl, m_BrdSettings.m_SolderPasteMargin );
PutValueInLocalUnits( *m_SolderPasteMarginCtrl, m_brdSettings.m_SolderPasteMargin );
if( m_BrdSettings.m_SolderPasteMargin == 0 )
if( m_brdSettings.m_SolderPasteMargin == 0 )
m_SolderPasteMarginCtrl->SetValue( wxT( "-" ) +
m_SolderPasteMarginCtrl->GetValue() );
wxString msg;
msg.Printf( wxT( "%f" ), m_BrdSettings.m_SolderPasteMarginRatio * 100.0 );
msg.Printf( wxT( "%f" ), m_brdSettings.m_SolderPasteMarginRatio * 100.0 );
// Sometimes Printf adds a sign if the value is small
if( m_BrdSettings.m_SolderPasteMarginRatio == 0.0 && msg[0] == '0' )
if( m_brdSettings.m_SolderPasteMarginRatio == 0.0 && msg[0] == '0' )
m_SolderPasteMarginRatioCtrl->SetValue( wxT( "-" ) + msg );
else
m_SolderPasteMarginRatioCtrl->SetValue( msg );
......@@ -83,9 +85,10 @@ void DIALOG_PADS_MASK_CLEARANCE::MyInit()
void DIALOG_PADS_MASK_CLEARANCE::OnButtonOkClick( wxCommandEvent& event )
{
m_BrdSettings.m_SolderMaskMargin = ReturnValueFromTextCtrl( *m_SolderMaskMarginCtrl );
m_brdSettings.m_SolderMaskMargin = ReturnValueFromTextCtrl( *m_SolderMaskMarginCtrl );
m_brdSettings.m_SolderMaskMinWidth = ReturnValueFromTextCtrl( *m_SolderMaskMinWidthCtrl );
m_BrdSettings.m_SolderPasteMargin = ReturnValueFromTextCtrl( *m_SolderPasteMarginCtrl );
m_brdSettings.m_SolderPasteMargin = ReturnValueFromTextCtrl( *m_SolderPasteMarginCtrl );
double dtmp = 0;
wxString msg = m_SolderPasteMarginRatioCtrl->GetValue();
......@@ -99,9 +102,11 @@ void DIALOG_PADS_MASK_CLEARANCE::OnButtonOkClick( wxCommandEvent& event )
if( dtmp > +100 )
dtmp = +100;
m_BrdSettings.m_SolderPasteMarginRatio = dtmp / 100;
m_brdSettings.m_SolderPasteMarginRatio = dtmp / 100;
m_Parent->GetBoard()->SetDesignSettings( m_BrdSettings );
m_parent->OnModify();
m_parent->GetBoard()->SetDesignSettings( m_brdSettings );
EndModal( 1 );
}
......
......@@ -19,14 +19,14 @@
class DIALOG_PADS_MASK_CLEARANCE : public DIALOG_PADS_MASK_CLEARANCE_BASE
{
private:
PCB_EDIT_FRAME* m_Parent;
BOARD_DESIGN_SETTINGS m_BrdSettings;
PCB_EDIT_FRAME* m_parent;
BOARD_DESIGN_SETTINGS m_brdSettings;
public:
DIALOG_PADS_MASK_CLEARANCE( PCB_EDIT_FRAME* parent );
~DIALOG_PADS_MASK_CLEARANCE() {};
private:
void MyInit();
void myInit();
virtual void OnButtonOkClick( wxCommandEvent& event );
virtual void OnButtonCancelClick( wxCommandEvent& event );
};
......
......@@ -27,7 +27,7 @@ DIALOG_PADS_MASK_CLEARANCE_BASE::DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* pare
wxStaticBoxSizer* sbMiddleRightSizer;
sbMiddleRightSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Dimensions:") ), wxVERTICAL );
m_staticTextInfo = new wxStaticText( this, wxID_ANY, _("Note:\n- a positive value means a mask bigger than a pad\n- a negative value means a mask smaller than a pad\n"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextInfo = new wxStaticText( this, wxID_ANY, _("Note: For clearance values:\n- a positive value means a mask bigger than a pad\n- a negative value means a mask smaller than a pad\n"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextInfo->Wrap( -1 );
sbMiddleRightSizer->Add( m_staticTextInfo, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 );
......@@ -35,7 +35,8 @@ DIALOG_PADS_MASK_CLEARANCE_BASE::DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* pare
sbMiddleRightSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
wxFlexGridSizer* fgGridSolderMaskSizer;
fgGridSolderMaskSizer = new wxFlexGridSizer( 2, 3, 0, 0 );
fgGridSolderMaskSizer = new wxFlexGridSizer( 4, 3, 0, 0 );
fgGridSolderMaskSizer->AddGrowableCol( 1 );
fgGridSolderMaskSizer->SetFlexibleDirection( wxBOTH );
fgGridSolderMaskSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
......@@ -46,11 +47,33 @@ DIALOG_PADS_MASK_CLEARANCE_BASE::DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* pare
fgGridSolderMaskSizer->Add( m_MaskClearanceTitle, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_SolderMaskMarginCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgGridSolderMaskSizer->Add( m_SolderMaskMarginCtrl, 0, wxEXPAND|wxALL, 5 );
fgGridSolderMaskSizer->Add( m_SolderMaskMarginCtrl, 0, wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_SolderMaskMarginUnits = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 );
m_SolderMaskMarginUnits->Wrap( -1 );
fgGridSolderMaskSizer->Add( m_SolderMaskMarginUnits, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
fgGridSolderMaskSizer->Add( m_SolderMaskMarginUnits, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
m_staticTextMinWidth = new wxStaticText( this, wxID_ANY, _("Solder mask min width:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextMinWidth->Wrap( -1 );
m_staticTextMinWidth->SetToolTip( _("Min dist between 2 pad areas.\nTwo pad areas nearer than this value will be merged during plotting.\nThis parameter is used only to plot solder mask layers.") );
fgGridSolderMaskSizer->Add( m_staticTextMinWidth, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_SolderMaskMinWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgGridSolderMaskSizer->Add( m_SolderMaskMinWidthCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_solderMaskMinWidthUnit = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 );
m_solderMaskMinWidthUnit->Wrap( -1 );
fgGridSolderMaskSizer->Add( m_solderMaskMinWidthUnit, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgGridSolderMaskSizer->Add( m_staticline3, 0, wxEXPAND | wxALL, 5 );
m_staticline4 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgGridSolderMaskSizer->Add( m_staticline4, 0, wxEXPAND | wxALL, 5 );
m_staticline5 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
fgGridSolderMaskSizer->Add( m_staticline5, 0, wxEXPAND | wxALL, 5 );
m_staticTextSolderPaste = new wxStaticText( this, wxID_ANY, _("Solder paste clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextSolderPaste->Wrap( -1 );
......@@ -59,11 +82,11 @@ DIALOG_PADS_MASK_CLEARANCE_BASE::DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* pare
fgGridSolderMaskSizer->Add( m_staticTextSolderPaste, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_SolderPasteMarginCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgGridSolderMaskSizer->Add( m_SolderPasteMarginCtrl, 0, wxALL, 5 );
fgGridSolderMaskSizer->Add( m_SolderPasteMarginCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_SolderPasteMarginUnits = new wxStaticText( this, wxID_ANY, _("Inch"), wxDefaultPosition, wxDefaultSize, 0 );
m_SolderPasteMarginUnits->Wrap( -1 );
fgGridSolderMaskSizer->Add( m_SolderPasteMarginUnits, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
fgGridSolderMaskSizer->Add( m_SolderPasteMarginUnits, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
m_staticTextRatio = new wxStaticText( this, wxID_ANY, _("Solder mask ratio clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextRatio->Wrap( -1 );
......@@ -72,11 +95,11 @@ DIALOG_PADS_MASK_CLEARANCE_BASE::DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* pare
fgGridSolderMaskSizer->Add( m_staticTextRatio, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_SolderPasteMarginRatioCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgGridSolderMaskSizer->Add( m_SolderPasteMarginRatioCtrl, 0, wxALL, 5 );
fgGridSolderMaskSizer->Add( m_SolderPasteMarginRatioCtrl, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_SolderPasteRatioMarginUnits = new wxStaticText( this, wxID_ANY, _("%"), wxDefaultPosition, wxDefaultSize, 0 );
m_SolderPasteRatioMarginUnits->Wrap( -1 );
fgGridSolderMaskSizer->Add( m_SolderPasteRatioMarginUnits, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
fgGridSolderMaskSizer->Add( m_SolderPasteRatioMarginUnits, 0, wxTOP|wxBOTTOM|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
sbMiddleRightSizer->Add( fgGridSolderMaskSizer, 1, wxEXPAND, 5 );
......@@ -97,7 +120,7 @@ DIALOG_PADS_MASK_CLEARANCE_BASE::DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* pare
m_sdbButtonsSizer->AddButton( m_sdbButtonsSizerCancel );
m_sdbButtonsSizer->Realize();
bMainSizer->Add( m_sdbButtonsSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5 );
bMainSizer->Add( m_sdbButtonsSizer, 0, wxBOTTOM|wxALIGN_RIGHT, 5 );
this->SetSizer( bMainSizer );
......
......@@ -46,6 +46,12 @@ class DIALOG_PADS_MASK_CLEARANCE_BASE : public DIALOG_SHIM
wxStaticText* m_MaskClearanceTitle;
wxTextCtrl* m_SolderMaskMarginCtrl;
wxStaticText* m_SolderMaskMarginUnits;
wxStaticText* m_staticTextMinWidth;
wxTextCtrl* m_SolderMaskMinWidthCtrl;
wxStaticText* m_solderMaskMinWidthUnit;
wxStaticLine* m_staticline3;
wxStaticLine* m_staticline4;
wxStaticLine* m_staticline5;
wxStaticText* m_staticTextSolderPaste;
wxTextCtrl* m_SolderPasteMarginCtrl;
wxStaticText* m_SolderPasteMarginUnits;
......@@ -64,7 +70,7 @@ class DIALOG_PADS_MASK_CLEARANCE_BASE : public DIALOG_SHIM
public:
DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pads Mask Clearance"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 361,253 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_PADS_MASK_CLEARANCE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Pads Mask Clearance"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 361,292 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PADS_MASK_CLEARANCE_BASE();
};
......
......@@ -46,6 +46,7 @@ DIALOG_PLOT::DIALOG_PLOT( PCB_EDIT_FRAME* aParent ) :
m_plotOpts( aParent->GetPlotSettings() )
{
m_config = wxGetApp().GetSettings();
m_brdSettings = m_board->GetDesignSettings();
Init_Dialog();
......@@ -96,6 +97,11 @@ void DIALOG_PLOT::Init_Dialog()
break;
}
msg = ReturnStringFromValue( g_UserUnit, m_brdSettings.m_SolderMaskMargin, true );
m_SolderMaskMarginCurrValue->SetLabel( msg );
msg = ReturnStringFromValue( g_UserUnit, m_brdSettings.m_SolderMaskMinWidth, true );
m_SolderMaskMinWidthCurrValue->SetLabel( msg );
// Set units and value for HPGL pen size (this param in in mils).
AddUnitSymbol( *m_textPenSize, g_UserUnit );
......@@ -103,10 +109,6 @@ void DIALOG_PLOT::Init_Dialog()
m_plotOpts.GetHPGLPenDiameter() * IU_PER_MILS );
m_HPGLPenSizeOpt->AppendText( msg );
// Units are *always* cm/s for HPGL pen speed, from 1 to 99.
msg = ReturnStringFromValue( UNSCALED_UNITS, m_plotOpts.GetHPGLPenSpeed() );
m_HPGLPenSpeedOpt->AppendText( msg );
// Set units and value for HPGL pen overlay (this param in in mils).
AddUnitSymbol( *m_textPenOvr, g_UserUnit );
msg = ReturnStringFromValue( g_UserUnit,
......@@ -308,7 +310,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_useAuxOriginCheckBox->SetValue( false );
m_linesWidth->Enable( true );
m_HPGLPenSizeOpt->Enable( false );
m_HPGLPenSpeedOpt->Enable( false );
m_HPGLPenOverlayOpt->Enable( false );
m_excludeEdgeLayerOpt->Enable( true );
m_subtractMaskFromSilk->Enable( false );
......@@ -337,7 +338,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_useAuxOriginCheckBox->SetValue( false );
m_linesWidth->Enable( true );
m_HPGLPenSizeOpt->Enable( false );
m_HPGLPenSpeedOpt->Enable( false );
m_HPGLPenOverlayOpt->Enable( false );
m_excludeEdgeLayerOpt->Enable( true );
m_subtractMaskFromSilk->Enable( false );
......@@ -366,7 +366,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_useAuxOriginCheckBox->Enable( true );
m_linesWidth->Enable( true );
m_HPGLPenSizeOpt->Enable( false );
m_HPGLPenSpeedOpt->Enable( false );
m_HPGLPenOverlayOpt->Enable( false );
m_excludeEdgeLayerOpt->Enable( true );
m_subtractMaskFromSilk->Enable( true );
......@@ -394,7 +393,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_useAuxOriginCheckBox->SetValue( false );
m_linesWidth->Enable( false );
m_HPGLPenSizeOpt->Enable( true );
m_HPGLPenSpeedOpt->Enable( true );
m_HPGLPenOverlayOpt->Enable( true );
m_excludeEdgeLayerOpt->Enable( true );
m_subtractMaskFromSilk->Enable( false );
......@@ -422,7 +420,6 @@ void DIALOG_PLOT::SetPlotFormat( wxCommandEvent& event )
m_useAuxOriginCheckBox->Enable( true );
m_linesWidth->Enable( false );
m_HPGLPenSizeOpt->Enable( false );
m_HPGLPenSpeedOpt->Enable( false );
m_HPGLPenOverlayOpt->Enable( false );
m_excludeEdgeLayerOpt->Enable( true );
m_subtractMaskFromSilk->Enable( false );
......@@ -529,18 +526,6 @@ void DIALOG_PLOT::applyPlotSettings()
m_messagesBox->AppendText( msg );
}
// read HPGL pen speed (this param is stored in cm/s)
msg = m_HPGLPenSpeedOpt->GetValue();
tmp = ReturnValueFromString( UNSCALED_UNITS, msg );
if( !tempOptions.SetHPGLPenSpeed( tmp ) )
{
msg = ReturnStringFromValue( UNSCALED_UNITS, tempOptions.GetHPGLPenSpeed() );
m_HPGLPenSpeedOpt->SetValue( msg );
msg.Printf( _( "HPGL pen speed constrained!\n" ) );
m_messagesBox->AppendText( msg );
}
// Read HPGL pen overlay (this param is stored in mils)
msg = m_HPGLPenOverlayOpt->GetValue();
tmp = ReturnValueFromString( g_UserUnit, msg ) / IU_PER_MILS;
......
......@@ -41,6 +41,7 @@ public:
private:
PCB_EDIT_FRAME* m_parent;
BOARD* m_board;
BOARD_DESIGN_SETTINGS m_brdSettings;
wxConfig* m_config;
std::vector<int> layerList; // List to hold CheckListBox layer numbers
double m_XScaleAdjust; // X scale factor adjust to compensate
......
......@@ -163,7 +163,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_plotModeOpt->SetSelection( 0 );
bSizer14->Add( m_plotModeOpt, 0, wxEXPAND|wxLEFT, 5 );
m_textDefaultPenSize = new wxStaticText( this, wxID_ANY, _("Default linewidth"), wxDefaultPosition, wxDefaultSize, 0 );
m_textDefaultPenSize = new wxStaticText( this, wxID_ANY, _("Default line width"), wxDefaultPosition, wxDefaultSize, 0 );
m_textDefaultPenSize->Wrap( -1 );
m_textDefaultPenSize->SetToolTip( _("Pen size used to draw items that have no pen size specified.\nUsed mainly to draw items in sketch mode.") );
......@@ -183,6 +183,40 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_PlotOptionsSizer->Add( sbOptionsSizer, 0, wxALL|wxEXPAND, 3 );
wxStaticBoxSizer* sbSizerSoldMaskLayerOpt;
sbSizerSoldMaskLayerOpt = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Solder mask current settings:") ), wxVERTICAL );
wxFlexGridSizer* fgSizerSoldMaskOpts;
fgSizerSoldMaskOpts = new wxFlexGridSizer( 2, 2, 0, 0 );
fgSizerSoldMaskOpts->SetFlexibleDirection( wxBOTH );
fgSizerSoldMaskOpts->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_SolderMaskMarginLabel = new wxStaticText( this, wxID_ANY, _("Solder mask clearance:"), wxDefaultPosition, wxDefaultSize, 0 );
m_SolderMaskMarginLabel->Wrap( -1 );
m_SolderMaskMarginLabel->SetToolTip( _("Margin between pads and solder mask") );
fgSizerSoldMaskOpts->Add( m_SolderMaskMarginLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
m_SolderMaskMarginCurrValue = new wxStaticText( this, wxID_ANY, _("val"), wxDefaultPosition, wxDefaultSize, 0 );
m_SolderMaskMarginCurrValue->Wrap( -1 );
fgSizerSoldMaskOpts->Add( m_SolderMaskMarginCurrValue, 0, wxALL, 5 );
m_solderMaskMinWidthLabel = new wxStaticText( this, wxID_ANY, _("Solder mask min width:"), wxDefaultPosition, wxDefaultSize, 0 );
m_solderMaskMinWidthLabel->Wrap( -1 );
m_solderMaskMinWidthLabel->SetToolTip( _("Min dist between 2 pad areas.\nTwo pad areas nearer than this value will be merged during plotting") );
fgSizerSoldMaskOpts->Add( m_solderMaskMinWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_SolderMaskMinWidthCurrValue = new wxStaticText( this, wxID_ANY, _("val"), wxDefaultPosition, wxDefaultSize, 0 );
m_SolderMaskMinWidthCurrValue->Wrap( -1 );
fgSizerSoldMaskOpts->Add( m_SolderMaskMinWidthCurrValue, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbSizerSoldMaskLayerOpt->Add( fgSizerSoldMaskOpts, 1, wxEXPAND, 5 );
m_PlotOptionsSizer->Add( sbSizerSoldMaskLayerOpt, 1, wxEXPAND, 5 );
m_GerberOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Gerber Options") ), wxVERTICAL );
m_useGerberExtensions = new wxCheckBox( this, wxID_ANY, _("Use proper filename extensions"), wxDefaultPosition, wxDefaultSize, 0 );
......@@ -213,34 +247,25 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_textPenSize = new wxStaticText( this, wxID_ANY, _("Pen size"), wxDefaultPosition, wxDefaultSize, 0 );
m_textPenSize->Wrap( -1 );
bSizer20->Add( m_textPenSize, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
bSizer20->Add( m_textPenSize, 0, wxRIGHT|wxLEFT, 5 );
m_HPGLPenSizeOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizer20->Add( m_HPGLPenSizeOpt, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_textPenOvr = new wxStaticText( this, wxID_ANY, _("Pen overlay"), wxDefaultPosition, wxDefaultSize, 0 );
m_textPenOvr->Wrap( -1 );
bSizer20->Add( m_textPenOvr, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_HPGLPenOverlayOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_HPGLPenOverlayOpt->SetToolTip( _("Set plot overlay for filling") );
bSizer20->Add( m_HPGLPenOverlayOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bSizer22->Add( bSizer20, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer21;
bSizer21 = new wxBoxSizer( wxVERTICAL );
m_textPenSpeed = new wxStaticText( this, wxID_ANY, _("Pen speed (cm/s):"), wxDefaultPosition, wxDefaultSize, 0 );
m_textPenSpeed->Wrap( -1 );
bSizer21->Add( m_textPenSpeed, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_textPenOvr = new wxStaticText( this, wxID_ANY, _("Pen overlay"), wxDefaultPosition, wxDefaultSize, 0 );
m_textPenOvr->Wrap( -1 );
bSizer21->Add( m_textPenOvr, 0, wxRIGHT|wxLEFT, 5 );
m_HPGLPenSpeedOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_HPGLPenSpeedOpt->SetToolTip( _("Set pen speed in cm/s") );
m_HPGLPenOverlayOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_HPGLPenOverlayOpt->SetToolTip( _("Set plot overlay for filling") );
bSizer21->Add( m_HPGLPenSpeedOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bSizer21->Add( m_HPGLPenOverlayOpt, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
bSizer22->Add( bSizer21, 1, wxEXPAND, 5 );
......@@ -261,7 +286,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_staticText7 = new wxStaticText( this, wxID_ANY, _("X scale:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText7->Wrap( -1 );
bSizer18->Add( m_staticText7, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bSizer18->Add( m_staticText7, 0, wxRIGHT|wxLEFT, 5 );
m_fineAdjustXscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fineAdjustXscaleOpt->SetToolTip( _("Set global X scale adjust for exact scale postscript output.") );
......@@ -276,7 +301,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_staticText8 = new wxStaticText( this, wxID_ANY, _("Y scale:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText8->Wrap( -1 );
bSizer19->Add( m_staticText8, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
bSizer19->Add( m_staticText8, 0, wxRIGHT|wxLEFT, 5 );
m_fineAdjustYscaleOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fineAdjustYscaleOpt->SetToolTip( _("Set global Y scale adjust for exact scale postscript output.") );
......@@ -291,7 +316,7 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_textPSFineAdjustWidth = new wxStaticText( this, wxID_ANY, _("Width correction"), wxDefaultPosition, wxDefaultSize, 0 );
m_textPSFineAdjustWidth->Wrap( -1 );
bSizer191->Add( m_textPSFineAdjustWidth, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
bSizer191->Add( m_textPSFineAdjustWidth, 0, wxRIGHT|wxLEFT, 5 );
m_PSFineAdjustWidthOpt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_PSFineAdjustWidthOpt->SetToolTip( _("Set global width correction for exact width postscript output.\nThese width correction is intended to compensate tracks width and also pads and vias size errors.\nThe reasonable width correction value must be in a range of [-(MinTrackWidth-1), +(MinClearanceValue-1)] in decimils.") );
......
This diff is collapsed.
......@@ -72,6 +72,10 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
wxChoice* m_plotModeOpt;
wxStaticText* m_textDefaultPenSize;
wxTextCtrl* m_linesWidth;
wxStaticText* m_SolderMaskMarginLabel;
wxStaticText* m_SolderMaskMarginCurrValue;
wxStaticText* m_solderMaskMinWidthLabel;
wxStaticText* m_SolderMaskMinWidthCurrValue;
wxStaticBoxSizer* m_GerberOptionsSizer;
wxCheckBox* m_useGerberExtensions;
wxCheckBox* m_subtractMaskFromSilk;
......@@ -81,8 +85,6 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
wxTextCtrl* m_HPGLPenSizeOpt;
wxStaticText* m_textPenOvr;
wxTextCtrl* m_HPGLPenOverlayOpt;
wxStaticText* m_textPenSpeed;
wxTextCtrl* m_HPGLPenSpeedOpt;
wxStaticBoxSizer* m_PSOptionsSizer;
wxStaticText* m_staticText7;
wxTextCtrl* m_fineAdjustXscaleOpt;
......
......@@ -14,6 +14,7 @@
#include <class_track.h>
#include <class_edge_mod.h>
#include <class_pcb_text.h>
#include <convert_from_iu.h>
#include <vector>
#include <cmath>
......@@ -1272,7 +1273,7 @@ bool PCB_EDIT_FRAME::ExportVRML_File( const wxString & aFullFileName,
/* scaling factor to convert internal units (decimils) to inches
*/
double board_scaling_factor = 0.0001;
double board_scaling_factor = 0.001*MILS_PER_IU;
/* auxiliary scale to export to a different scale.
*/
......
......@@ -549,6 +549,10 @@ void PCB_IO::format( BOARD* aBoard, int aNestLevel ) const
m_out->Print( aNestLevel+1, "(pad_to_mask_clearance %s)\n",
FMTIU( aBoard->GetDesignSettings().m_SolderMaskMargin ).c_str() );
if( aBoard->GetDesignSettings().m_SolderMaskMinWidth )
m_out->Print( aNestLevel+1, "(solder_mask_min_width %s)\n",
FMTIU( aBoard->GetDesignSettings().m_SolderMaskMinWidth ).c_str() );
if( aBoard->GetDesignSettings().m_SolderPasteMargin != 0 )
m_out->Print( aNestLevel+1, "(pad_to_paste_clearance %s)\n",
FMTIU( aBoard->GetDesignSettings().m_SolderPasteMargin ).c_str() );
......
......@@ -836,6 +836,12 @@ void LEGACY_PLUGIN::loadSETUP()
bds.m_SolderMaskMargin = tmp;
}
else if( TESTLINE( "SolderMaskMinWidth" ) )
{
BIU tmp = biuParse( line + SZ( "SolderMaskMinWidth" ) );
bds.m_SolderMaskMinWidth = tmp;
}
else if( TESTLINE( "Pad2PasteClearance" ) )
{
BIU tmp = biuParse( line + SZ( "Pad2PasteClearance" ) );
......@@ -3022,6 +3028,7 @@ void LEGACY_PLUGIN::saveSETUP( const BOARD* aBoard ) const
fprintf( m_fp, "PadDrill %s\n", fmtBIU( bds.m_Pad_Master.GetDrillSize().x ).c_str() );
fprintf( m_fp, "Pad2MaskClearance %s\n", fmtBIU( bds.m_SolderMaskMargin ).c_str() );
fprintf( m_fp, "SolderMaskMinWidth %s\n", fmtBIU( bds.m_SolderMaskMinWidth ).c_str() );
if( bds.m_SolderPasteMargin != 0 )
fprintf( m_fp, "Pad2PasteClearance %s\n", fmtBIU( bds.m_SolderPasteMargin ).c_str() );
......
......@@ -182,20 +182,13 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// Pad settings
AddMenuItem( dimensions_Submenu, ID_MODEDIT_PAD_SETTINGS,
_( "&Pad Settings" ), _( "Edit the settings for new pads" ),
KiBitmap( options_pad_xpm ) );
KiBitmap( pad_dimensions_xpm ) );
// User grid size
AddMenuItem( dimensions_Submenu, ID_PCB_USER_GRID_SETUP,
_( "&User Grid Size" ), _( "Adjust user grid" ),
KiBitmap( grid_xpm ) );
// Append dimensions_Submenu to editMenu
AddMenuItem( editMenu,
dimensions_Submenu, -1,
_( "Di&mensions" ),
_( "Edit dimensions preferences" ),
KiBitmap( add_dimension_xpm ) );
// View menu
wxMenu* viewMenu = new wxMenu;
......@@ -294,6 +287,8 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
// Append menus to the menubar
menuBar->Append( fileMenu, _( "&File" ) );
menuBar->Append( editMenu, _( "&Edit" ) );
menuBar->Append( dimensions_Submenu, _( "Di&mensions" ) );
menuBar->Append( viewMenu, _( "&View" ) );
menuBar->Append( placeMenu, _( "&Place" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
......
......@@ -96,8 +96,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
_( "&Append Board" ),
_( "Append another Pcbnew board to the current loaded board" ),
KiBitmap( import_xpm ) );
// Separator
filesMenu->AppendSeparator();
// Save
......@@ -248,7 +246,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
_( "Archive or add footprints in a library file" ),
KiBitmap( library_xpm ) );
/* Quit */
// Quit
filesMenu->AppendSeparator();
AddMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ), _( "Quit Pcbnew" ),
KiBitmap( exit_xpm ) );
......@@ -450,7 +448,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
_( "Select how items (pads, tracks texts ... ) are displayed" ),
KiBitmap( display_options_xpm ) );
// Create Dimensions submenu
// Create sizes and dimensions submenu
wxMenu* dimensionsMenu = new wxMenu;
// Grid
......@@ -467,7 +465,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// Pads
AddMenuItem( dimensionsMenu, ID_PCB_PAD_SETUP,
_( "&Pads" ), _( "Adjust default pad characteristics" ),
KiBitmap( pad_xpm ) );
KiBitmap( pad_dimensions_xpm ) );
// Pads Mask Clearance
AddMenuItem( dimensionsMenu, ID_PCB_MASK_CLEARANCE,
......@@ -481,11 +479,6 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
_( "&Save" ), _( "Save dimension preferences" ),
KiBitmap( save_xpm ) );
// Append dimension menu to config menu
AddMenuItem( configmenu, dimensionsMenu,
-1, _( "Di&mensions" ),
_( "Global dimensions preferences" ),
KiBitmap( add_dimension_xpm ) );
// Language submenu
wxGetApp().AddMenuLanguageList( configmenu );
......@@ -609,6 +602,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
menuBar->Append( viewMenu, _( "&View" ) );
menuBar->Append( placeMenu, _( "&Place" ) );
menuBar->Append( configmenu, _( "P&references" ) );
menuBar->Append( dimensionsMenu, _( "D&imensions" ) );
menuBar->Append( toolsMenu, _( "&Tools" ) );
menuBar->Append( designRulesMenu, _( "&Design Rules" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
......
......@@ -926,7 +926,12 @@ void PCB_PARSER::parseSetup() throw( IO_ERROR, PARSE_ERROR )
break;
case T_pad_to_mask_clearance:
designSettings.m_SolderMaskMargin = parseBoardUnits( T_pad_to_mask_clearance );
designSettings.m_SolderMaskMargin = parseBoardUnits( T_pad_to_mask_clearance );
NeedRIGHT();
break;
case T_solder_mask_min_width:
designSettings.m_SolderMaskMinWidth = parseBoardUnits( T_solder_mask_min_width );
NeedRIGHT();
break;
......
......@@ -185,7 +185,8 @@ void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter,
}
void PCB_PLOT_PARAMS::Parse( PCB_PLOT_PARAMS_PARSER* aParser ) throw( IO_ERROR, PARSE_ERROR )
void PCB_PLOT_PARAMS::Parse( PCB_PLOT_PARAMS_PARSER* aParser )
throw( IO_ERROR, PARSE_ERROR )
{
aParser->Parse( this );
}
......@@ -302,13 +303,14 @@ PCB_PLOT_PARAMS_PARSER::PCB_PLOT_PARAMS_PARSER( LINE_READER* aReader ) :
}
PCB_PLOT_PARAMS_PARSER::PCB_PLOT_PARAMS_PARSER( char* aLine, wxString aSource ) :
PCB_PLOT_PARAMS_PARSER::PCB_PLOT_PARAMS_PARSER( char* aLine, const wxString& aSource ) :
PCB_PLOT_PARAMS_LEXER( aLine, aSource )
{
}
void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( IO_ERROR, PARSE_ERROR )
void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams )
throw( IO_ERROR, PARSE_ERROR )
{
T token;
while( ( token = NextTok() ) != T_RIGHT )
......@@ -422,7 +424,7 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( IO_
}
bool PCB_PLOT_PARAMS_PARSER::ParseBool() throw( IO_ERROR )
bool PCB_PLOT_PARAMS_PARSER::ParseBool()
{
T token = NeedSYMBOL();
......@@ -433,7 +435,7 @@ bool PCB_PLOT_PARAMS_PARSER::ParseBool() throw( IO_ERROR )
}
int PCB_PLOT_PARAMS_PARSER::ParseInt( int aMin, int aMax ) throw( IO_ERROR )
int PCB_PLOT_PARAMS_PARSER::ParseInt( int aMin, int aMax )
{
T token = NextTok();
......
......@@ -28,10 +28,33 @@
#include <eda_text.h> // EDA_DRAW_MODE_T
#include <plot_common.h>
class PCB_PLOT_PARAMS_PARSER;
class PCB_PLOT_PARAMS;
class LINE_READER;
/**
* Class PCB_PLOT_PARAMS_PARSER
* is the parser class for PCB_PLOT_PARAMS.
*/
class PCB_PLOT_PARAMS_PARSER : public PCB_PLOT_PARAMS_LEXER
{
public:
PCB_PLOT_PARAMS_PARSER( LINE_READER* aReader );
PCB_PLOT_PARAMS_PARSER( char* aLine, const wxString& aSource );
LINE_READER* GetReader() { return reader; };
void Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( IO_ERROR, PARSE_ERROR );
bool ParseBool();
/**
* Function ParseInt
* parses an integer and constrains it between two values.
* @param aMin is the smallest return value.
* @param aMax is the largest return value.
* @return int - the parsed integer.
*/
int ParseInt( int aMin, int aMax );
};
/**
* Class PCB_PLOT_PARAMS
* handles plot parameters and options when plotting/printing a board.
......@@ -259,30 +282,6 @@ public:
};
/**
* Class PCB_PLOT_PARAMS_PARSER
* is the parser class for PCB_PLOT_PARAMS.
*/
class PCB_PLOT_PARAMS_PARSER : public PCB_PLOT_PARAMS_LEXER
{
public:
PCB_PLOT_PARAMS_PARSER( LINE_READER* aReader );
PCB_PLOT_PARAMS_PARSER( char* aLine, wxString aSource );
LINE_READER* GetReader() { return reader; };
void Parse( PCB_PLOT_PARAMS* aPcbPlotParams ) throw( IO_ERROR, PARSE_ERROR );
bool ParseBool() throw( IO_ERROR );
/**
* Function ParseInt
* parses an integer and constrains it between two values.
* @param aMin is the smallest return value.
* @param aMax is the largest return value.
* @return int - the parsed integer.
*/
int ParseInt( int aMin, int aMax ) throw( IO_ERROR );
};
/**
* Default line thickness in PCnew units used to draw or plot items having a
* default thickness line value (Frame references) (i.e. = 0 ).
......
......@@ -51,6 +51,18 @@
#include <pcbnew.h>
#include <pcbplot.h>
// Imported function
extern void AddPolygonCornersToKiPolygonList( std::vector <CPolyPt>& aCornersBuffer,
KI_POLYGON_SET& aKiPolyList );
// Local
/* Plot a solder mask layer.
* Solder mask layers have a minimum thickness value and cannot be drawn like standard layers,
* unless the minimum thickness is 0.
*/
static void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter,
long aLayerMask, const PCB_PLOT_PARAMS& aPlotOpt,
int aMinThickness );
/* Creates the plot for silkscreen layers
* Silkscreen layers have specific requirement for pads (not filled) and texts
* (with option to remove them from some copper areas (pads...)
......@@ -134,6 +146,8 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, int aLayer,
const PCB_PLOT_PARAMS& aPlotOpt )
{
PCB_PLOT_PARAMS plotOpt = aPlotOpt;
int soldermask_min_thickness = aBoard->GetDesignSettings().m_SolderMaskMinWidth;
// Set a default color and the text mode for this layer
aPlotter->SetColor( aPlotOpt.GetColor() );
aPlotter->SetTextMode( aPlotOpt.GetTextMode() );
......@@ -175,7 +189,14 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, int aLayer,
plotOpt.SetSkipPlotNPTH_Pads( false );
// Disable plot pad holes
plotOpt.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE );
PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
// Plot solder mask:
if( soldermask_min_thickness == 0 )
PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
else
PlotSolderMaskLayer( aBoard, aPlotter, layer_mask, plotOpt,
soldermask_min_thickness );
break;
case SOLDERPASTE_N_BACK:
......@@ -425,6 +446,152 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
itemplotter.PlotDrillMarks();
}
/* Plot a solder mask layer.
* Solder mask layers have a minimum thickness value and cannot be drawn like standard layers,
* unless the minimum thickness is 0.
*/
void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter,
long aLayerMask, const PCB_PLOT_PARAMS& aPlotOpt,
int aMinThickness )
{
int layer = ( aLayerMask & SOLDERMASK_LAYER_BACK ) ?
SOLDERMASK_N_BACK : SOLDERMASK_N_FRONT;
int inflate = aMinThickness/2;
BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
itemplotter.SetLayerMask( aLayerMask );
// EDA_DRAW_MODE_T plotMode = aPlotOpt.GetMode();
// EDA_COLOR_T color = BLACK;
// Plot edge layer and graphic items
itemplotter.PlotBoardGraphicItems();
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
{
for( BOARD_ITEM* item = module->m_Drawings; item; item = item->Next() )
{
if( aLayerMask != item->GetLayer() )
continue;
switch( item->Type() )
{
case PCB_MODULE_EDGE_T:
itemplotter.Plot_1_EdgeModule( (EDGE_MODULE*) item );
break;
default:
break;
}
}
}
// Build polygons for each pad shape.
// the size of the shape on solder mask should be:
// size of pad + clearance around the pad.
// clearance = solder mask clearance + extra margin
// extra margin is half the min width for solder mask
// This extra margin is used to merge too close shapes
// (distance < aMinThickness), and will be removed when creating
// the actual shapes
std::vector <CPolyPt> bufferPolys; // Contains shapes to plot
/* calculates the coeff to compensate radius reduction of holes clearance
* due to the segment approx ( 1 /cos( PI/circleToSegmentsCount )
*/
int circleToSegmentsCount = 32;
double correction = 1.0 / cos( M_PI / circleToSegmentsCount );
// Plot pads
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
{
for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
{
if( (pad->GetLayerMask() & aLayerMask) == 0 )
continue;
int margin = pad->GetSolderMaskMargin() + inflate;
pad->TransformShapeWithClearanceToPolygon( bufferPolys, margin,
circleToSegmentsCount,
correction );
}
}
// Plot vias on solder masks, if aPlotOpt.GetPlotViaOnMaskLayer() is true,
if( aPlotOpt.GetPlotViaOnMaskLayer() )
{
for( TRACK* track = aBoard->m_Track; track; track = track->Next() )
{
if( track->Type() != PCB_VIA_T )
continue;
SEGVIA* via = (SEGVIA*) track;
// vias are plotted only if they are on the corresponding
// external copper layer
int via_mask_layer = via->ReturnMaskLayer();
if( via_mask_layer & LAYER_BACK )
via_mask_layer |= SOLDERMASK_LAYER_BACK;
if( via_mask_layer & LAYER_FRONT )
via_mask_layer |= SOLDERMASK_LAYER_FRONT;
if( ( via_mask_layer & aLayerMask ) == 0 )
continue;
// The current layer is a solder mask,
// use the global mask clearance for vias
int via_margin = aBoard->GetDesignSettings().m_SolderMaskMargin + inflate;
via->TransformShapeWithClearanceToPolygon( bufferPolys, via_margin,
circleToSegmentsCount,
correction );
}
}
// Add filled zone areas
for( int ii = 0; ii < aBoard->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* zone = aBoard->GetArea( ii );
if( zone->GetLayer() != layer )
continue;
zone->TransformShapeWithClearanceToPolygon( bufferPolys,
inflate, circleToSegmentsCount,
correction, true );
}
// Now:
// 1 - merge areas which are intersecting, i.e. remove gaps
// having a thickness < aMinThickness
// 2 - deflate resulting areas by aMinThickness/2
KI_POLYGON_SET areasToMerge;
AddPolygonCornersToKiPolygonList( bufferPolys, areasToMerge );
// Merge polygons: because each shape was created with an extra margin
// = aMinThickness/2, shapes too close ( dist < aMinThickness )
// will be merged, because they are overlapping
KI_POLYGON_SET areas;
areas |= areasToMerge;
// Deflate: remove the extra margin, to create the actual shapes
areas -= inflate;
// To avoid a lot of code, use a ZONE_CONTAINER
// to plot polygons, because they are exactly like
// filled areas in zones
ZONE_CONTAINER zone( aBoard );
zone.SetArcSegCount( 32 );
zone.SetMinThickness( 0 ); // trace polygons only
zone.SetLayer ( layer );
zone.CopyPolygonsFromKiPolygonListToFilledPolysList( areas );
itemplotter.PlotFilledAreas( &zone );
}
/** Set up most plot options for plotting a board (especially the viewport)
* Important thing:
......
......@@ -79,8 +79,10 @@ extern void CreateThermalReliefPadPolygon( std::vector<CPolyPt>& aCornerBuffer,
int aCircleToSegmentsCount,
double aCorrectionFactor,
int aThermalRot );
static void AddPolygonCornersToKiPolygonList( std::vector <CPolyPt>& aCornersBuffer,
KI_POLYGON_SET& aKiPolyList );
// Exported function
void AddPolygonCornersToKiPolygonList( std::vector <CPolyPt>& aCornersBuffer,
KI_POLYGON_SET& aKiPolyList );
// Local Variables:
static int s_thermalRot = 450; // angle of stubs in thermal reliefs for round pads
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment