pcad2kicadpcb_plugin: import circles

This commit is contained in:
Eldar Khayrullin 2017-12-10 21:18:21 +03:00 committed by Maciej Suminski
parent 08b71cd252
commit c9852d7c81
2 changed files with 11 additions and 2 deletions

View File

@ -160,7 +160,7 @@ void PCB_ARC::AddToModule( MODULE* aModule )
{
if( IsNonCopperLayer( m_KiCadLayer ) )
{
EDGE_MODULE* arc = new EDGE_MODULE( aModule, S_ARC );
EDGE_MODULE* arc = new EDGE_MODULE( aModule, ( IsCircle() ? S_CIRCLE : S_ARC ) );
aModule->GraphicalItemsList().PushBack( arc );
arc->SetAngle( -m_angle );
@ -181,7 +181,7 @@ void PCB_ARC::AddToBoard()
m_board->Add( dseg, ADD_APPEND );
dseg->SetShape( S_ARC );
dseg->SetShape( IsCircle() ? S_CIRCLE : S_ARC );
dseg->SetTimeStamp( m_timestamp );
dseg->SetLayer( m_KiCadLayer );
dseg->SetStart( wxPoint( m_positionX, m_positionY ) );
@ -190,4 +190,10 @@ void PCB_ARC::AddToBoard()
dseg->SetWidth( m_width );
}
bool PCB_ARC::IsCircle()
{
return ( m_angle == 3600 );
}
} // namespace PCAD2KICAD

View File

@ -54,6 +54,9 @@ public:
virtual void Flip() override;
void AddToModule( MODULE* aModule ) override;
void AddToBoard() override;
private:
bool IsCircle();
};
} // namespace PCAD2KICAD