Gerber and drl files (& drl filenames): fix issues due to layer renumbering.

This commit is contained in:
jean-pierre charras
2024-10-14 18:46:18 +02:00
parent b092675171
commit a4292ea516
2 changed files with 21 additions and 5 deletions
+7 -1
View File
@@ -83,6 +83,7 @@ const wxString GetGerberFileFunctionAttribute( const BOARD* aBoard, int aLayer )
{
wxString attrib;
switch( aLayer )
{
case F_Adhes:
@@ -160,7 +161,12 @@ const wxString GetGerberFileFunctionAttribute( const BOARD* aBoard, int aLayer )
default:
if( IsCopperLayer( aLayer ) )
attrib.Printf( wxT( "Copper,L%d,Inr" ), aLayer+1 );
{
// aLayer use even values, and the first internal layer
// is B_Cu + 2. And in gerber file, layer id is 2 (1 is F_Cu)
int ly_id = ( ( aLayer - B_Cu ) / 2 ) + 1;
attrib.Printf( wxT( "Copper,L%d,Inr" ), ly_id );
}
else
attrib.Printf( wxT( "Other,User" ), aLayer+1 );
break;