Pcbnew, plot function: add missing plot for bezier curves in footprints.
It was existing for pcb graphics, but not for footprint graphics.
This commit is contained in:
parent
c34a584289
commit
bb9b226744
|
@ -446,17 +446,12 @@ void BRDITEMS_PLOTTER::Plot_Edges_Modules()
|
||||||
//* Plot a graphic item (outline) relative to a footprint
|
//* Plot a graphic item (outline) relative to a footprint
|
||||||
void BRDITEMS_PLOTTER::Plot_1_EdgeModule( EDGE_MODULE* aEdge )
|
void BRDITEMS_PLOTTER::Plot_1_EdgeModule( EDGE_MODULE* aEdge )
|
||||||
{
|
{
|
||||||
int type_trace; // Type of item to plot.
|
|
||||||
int thickness; // Segment thickness.
|
|
||||||
int radius; // Circle radius.
|
|
||||||
|
|
||||||
if( aEdge->Type() != PCB_MODULE_EDGE_T )
|
if( aEdge->Type() != PCB_MODULE_EDGE_T )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_plotter->SetColor( getColor( aEdge->GetLayer() ) );
|
m_plotter->SetColor( getColor( aEdge->GetLayer() ) );
|
||||||
|
|
||||||
type_trace = aEdge->GetShape();
|
int thickness = aEdge->GetWidth();
|
||||||
thickness = aEdge->GetWidth();
|
|
||||||
|
|
||||||
wxPoint pos( aEdge->GetStart() );
|
wxPoint pos( aEdge->GetStart() );
|
||||||
wxPoint end( aEdge->GetEnd() );
|
wxPoint end( aEdge->GetEnd() );
|
||||||
|
@ -478,7 +473,9 @@ void BRDITEMS_PLOTTER::Plot_1_EdgeModule( EDGE_MODULE* aEdge )
|
||||||
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_EDGECUT );
|
gbr_metadata.SetApertureAttrib( GBR_APERTURE_METADATA::GBR_APERTURE_ATTRIB_EDGECUT );
|
||||||
}
|
}
|
||||||
|
|
||||||
switch( type_trace )
|
int radius; // Circle/arc radius.
|
||||||
|
|
||||||
|
switch( aEdge->Type() )
|
||||||
{
|
{
|
||||||
case S_SEGMENT:
|
case S_SEGMENT:
|
||||||
m_plotter->ThickSegment( pos, end, thickness, GetPlotMode(), &gbr_metadata );
|
m_plotter->ThickSegment( pos, end, thickness, GetPlotMode(), &gbr_metadata );
|
||||||
|
@ -501,7 +498,7 @@ void BRDITEMS_PLOTTER::Plot_1_EdgeModule( EDGE_MODULE* aEdge )
|
||||||
else
|
else
|
||||||
m_plotter->ThickArc( pos, -endAngle, -startAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
|
m_plotter->ThickArc( pos, -endAngle, -startAngle, radius, thickness, GetPlotMode(), &gbr_metadata );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case S_POLYGON:
|
case S_POLYGON:
|
||||||
if( aEdge->IsPolyShapeValid() )
|
if( aEdge->IsPolyShapeValid() )
|
||||||
|
@ -558,7 +555,26 @@ void BRDITEMS_PLOTTER::Plot_1_EdgeModule( EDGE_MODULE* aEdge )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case S_CURVE:
|
||||||
|
{
|
||||||
|
m_plotter->SetCurrentLineWidth( thickness, &gbr_metadata );
|
||||||
|
int minSegLen = aEdge->GetWidth(); // The segment min length to approximate a bezier curve
|
||||||
|
aEdge->RebuildBezierToSegmentsPointsList( minSegLen );
|
||||||
|
const std::vector<wxPoint>& bezierPoints = aEdge->GetBezierPoints();
|
||||||
|
|
||||||
|
for( unsigned i = 1; i < bezierPoints.size(); i++ )
|
||||||
|
{
|
||||||
|
m_plotter->ThickSegment( bezierPoints[i - 1], bezierPoints[i],
|
||||||
|
thickness, GetPlotMode(), &gbr_metadata );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
wxASSERT_MSG( false, "Unhandled EDGE_MODULE type" );
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue