Enable technical layers when starting Pcbnew with no board.

Use format 4.6 (full resolution of Pcbnew) in Gerber files to avoid the creation of self-intersecting polygons.
This commit is contained in:
jean-pierre charras 2014-06-30 17:46:47 +02:00
parent e460b4a524
commit a543f99eb3
2 changed files with 13 additions and 8 deletions

View File

@ -29,10 +29,13 @@ void GERBER_PLOTTER::SetViewport( const wxPoint& aOffset, double aIusPerDecimil,
m_gerberUnitInch = false; // Currently fixed, but could be an option m_gerberUnitInch = false; // Currently fixed, but could be an option
// number of digits after the point (number of digits of the mantissa // number of digits after the point (number of digits of the mantissa
// Be carefull: the coordinates are stored in an integer // Be carefull: the Gerber coordinates are stored in an integer
// so 6 digits (inches) or 5 digits (mm) is the best value // so 6 digits (inches) or 5 digits (mm) is a good value
// to avoid truncations and overflow // To avoid overflow, 7 digits (inches) or 6 digits is a max.
m_gerberUnitFmt = m_gerberUnitInch ? 6 : 5; // with lower values than 6 digits (inches) or 5 digits (mm),
// Creating self-intersecting polygons from non-intersecting polygons
// happen easily.
m_gerberUnitFmt = m_gerberUnitInch ? 7 : 6;
m_IUsPerDecimil = aIusPerDecimil; m_IUsPerDecimil = aIusPerDecimil;
iuPerDeviceUnit = pow( 10.0, m_gerberUnitFmt ) / ( aIusPerDecimil * 10000.0 ); iuPerDeviceUnit = pow( 10.0, m_gerberUnitFmt ) / ( aIusPerDecimil * 10000.0 );

View File

@ -56,14 +56,14 @@ BOARD_DESIGN_SETTINGS::BOARD_DESIGN_SETTINGS() :
{ {
LSET all_set = LSET().set(); LSET all_set = LSET().set();
m_enabledLayers = all_set; // All layers enabled at first. m_enabledLayers = all_set; // All layers enabled at first.
// SetCopperLayerCount() will adjust this. // SetCopperLayerCount() will adjust this.
SetVisibleLayers( all_set ); SetVisibleLayers( all_set );
// set all but hidden text as visible. // set all but hidden text as visible.
m_visibleElements = ~( 1 << MOD_TEXT_INVISIBLE ); m_visibleElements = ~( 1 << MOD_TEXT_INVISIBLE );
SetCopperLayerCount( 2 ); // Default design is a double sided board SetCopperLayerCount( 2 ); // Default design is a double sided board
// via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA). // via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA).
m_CurrentViaType = VIA_THROUGH; m_CurrentViaType = VIA_THROUGH;
@ -350,7 +350,9 @@ void BOARD_DESIGN_SETTINGS::SetCopperLayerCount( int aNewLayerCount )
for( LAYER_NUM ii = LAYER_N_2; ii < aNewLayerCount - 1; ++ii ) for( LAYER_NUM ii = LAYER_N_2; ii < aNewLayerCount - 1; ++ii )
m_enabledLayers |= GetLayerSet( ii ); m_enabledLayers |= GetLayerSet( ii );
#else #else
m_enabledLayers = LSET::AllCuMask( aNewLayerCount ); // Update only enabled copper layers mask
m_enabledLayers &= ~LSET::AllCuMask();
m_enabledLayers |= LSET::AllCuMask( aNewLayerCount );
#endif #endif
} }