DXF plot: fix incorrect plotting of oval holes

Due to missing DXF_PLOTTER::ThickSegment code to plot a thick segment in SKETCH mode (outline mode)
This commit is contained in:
jean-pierre charras 2018-01-27 17:32:59 +01:00
parent 45386ccbf3
commit 17739859b3
1 changed files with 22 additions and 2 deletions

View File

@ -586,8 +586,28 @@ void DXF_PLOTTER::SetDash( int dashed )
void DXF_PLOTTER::ThickSegment( const wxPoint& aStart, const wxPoint& aEnd, int aWidth,
EDA_DRAW_MODE_T aPlotMode, void* aData )
{
MoveTo( aStart );
FinishTo( aEnd );
if( aPlotMode == SKETCH )
{
std::vector<wxPoint> cornerList;
SHAPE_POLY_SET outlineBuffer;
TransformOvalClearanceToPolygon( outlineBuffer,
aStart, aEnd, aWidth, 32 , 1.0 );
const SHAPE_LINE_CHAIN& path = outlineBuffer.COutline(0 );
for( int jj = 0; jj < path.PointCount(); jj++ )
cornerList.push_back( wxPoint( path.CPoint( jj ).x , path.CPoint( jj ).y ) );
// Ensure the polygon is closed
if( cornerList[0] != cornerList[cornerList.size() - 1] )
cornerList.push_back( cornerList[0] );
PlotPoly( cornerList, NO_FILL );
}
else
{
MoveTo( aStart );
FinishTo( aEnd );
}
}
/* Plot an arc in DXF format