use custom pad shape in a microwave footprint

This commit is contained in:
jean-pierre charras 2017-09-19 15:51:12 +02:00
parent e504746fa3
commit dddaa7e69c
1 changed files with 6 additions and 11 deletions

View File

@ -25,7 +25,7 @@
*/
/**
* @file muonde.cpp
* @file microwave.cpp
* @brief Microwave pcb layout code.
*/
@ -338,18 +338,13 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type )
case 2: // Arc Stub created by a polygonal approach:
{
EDGE_MODULE* edge = new EDGE_MODULE( module );
module->GraphicalItemsList().PushFront( edge );
edge->SetShape( S_POLYGON );
edge->SetLayer( F_Cu );
pad->SetShape( PAD_SHAPE_CUSTOM );
pad->SetAnchorPadShape( PAD_SHAPE_RECT );
int numPoints = (angle / 50) + 3; // Note: angles are in 0.1 degrees
std::vector<wxPoint>& polyPoints = edge->GetPolyPoints();
std::vector<wxPoint> polyPoints;
polyPoints.reserve( numPoints );
edge->m_Start0.y = -pad->GetSize().y / 2;
polyPoints.push_back( wxPoint( 0, 0 ) );
int theta = -angle / 2;
@ -357,9 +352,7 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type )
for( int ii = 1; ii<numPoints - 1; ii++ )
{
wxPoint pt( 0, -gap_size );
RotatePoint( &pt.x, &pt.y, theta );
polyPoints.push_back( pt );
theta += 50;
@ -370,6 +363,8 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type )
// Close the polygon:
polyPoints.push_back( polyPoints[0] );
pad->AddBasicShape( polyPoints, 0 ); // add a polygonal basic shape
}
break;