Gerber plot: minor fixes in TO object attributes.

Gerbview: remove a outdated warning about RS274D format.
This commit is contained in:
jean-pierre charras 2019-11-05 14:24:08 +01:00
parent 26d0863921
commit e04d82e940
3 changed files with 8 additions and 27 deletions

View File

@ -754,31 +754,12 @@ void GERBER_PLOTTER::FlashPadOval( const wxPoint& pos, const wxSize& aSize, doub
// The pad is reduced to an segment with dy > dx // The pad is reduced to an segment with dy > dx
int delta = size.y - size.x; int delta = size.y - size.x;
int x0 = 0; wxPoint p0( 0, -delta / 2 );
int y0 = -delta / 2; wxPoint p1( 0, delta / 2 );
int x1 = 0; RotatePoint( &p0.x, &p0.y, orient );
int y1 = delta / 2; RotatePoint( &p1.x, &p1.y, orient );
RotatePoint( &x0, &y0, orient );
RotatePoint( &x1, &y1, orient );
GBR_METADATA metadata;
if( gbr_metadata ) ThickSegment( pos + p0, pos + p1, size.x, trace_mode, gbr_metadata );
{
metadata = *gbr_metadata;
// If the pad is drawn on a copper layer,
// set attribute to GBR_APERTURE_ATTRIB_CONDUCTOR
if( metadata.IsCopper() )
metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_CONDUCTOR );
// Clear .P attribute, only allowed for flashed items
wxString attrname( ".P" );
metadata.m_NetlistMetadata.ClearAttribute( &attrname );
}
ThickSegment( wxPoint( pos.x + x0, pos.y + y0 ),
wxPoint( pos.x + x1, pos.y + y1 ),
size.x, trace_mode, &metadata );
} }
else else
sketchOval( pos, size, orient, -1 ); sketchOval( pos, size, orient, -1 );

View File

@ -74,6 +74,7 @@ bool GERBVIEW_FRAME::Read_GERBER_File( const wxString& GERBER_FullFileName )
dlg.ShowModal(); dlg.ShowModal();
} }
#if 0 // Outdated warning
/* if the gerber file is only a RS274D file /* if the gerber file is only a RS274D file
* (i.e. without any aperture information, but with items), warn the user: * (i.e. without any aperture information, but with items), warn the user:
*/ */
@ -84,6 +85,7 @@ bool GERBVIEW_FRAME::Read_GERBER_File( const wxString& GERBER_FullFileName )
"Therefore the size of items is undefined"); "Therefore the size of items is undefined");
wxMessageBox( msg ); wxMessageBox( msg );
} }
#endif
auto canvas = GetGalCanvas(); auto canvas = GetGalCanvas();

View File

@ -739,9 +739,7 @@ void BRDITEMS_PLOTTER::PlotDrawSegment( DRAWSEGMENT* aSeg )
GBR_METADATA gbr_metadata; GBR_METADATA gbr_metadata;
bool isOnCopperLayer = ( m_layerMask & LSET::AllCuMask() ).any(); if( aSeg->GetLayer() == Edge_Cuts )
if( isOnCopperLayer && aSeg->GetLayer() == Edge_Cuts ) // can happens when plotting copper layers
{ {
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_EDGECUT ); gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_EDGECUT );
} }