Fix arc formatting in Fabmaster import.

This commit is contained in:
Jeff Young 2021-10-26 17:52:10 +01:00
parent 341b0a5652
commit 5b9519da6c
1 changed files with 13 additions and 21 deletions

View File

@ -2117,27 +2117,19 @@ bool FABMASTER::loadFootprints( BOARD* aBoard )
FP_SHAPE* arc = new FP_SHAPE( fp, SHAPE_T::ARC );
if( src->mirror )
{
arc->SetLayer( FlipLayer( layer ) );
arc->SetCenter( wxPoint( lsrc->center_x, 2 * src->y - lsrc->center_y ) );
arc->SetStart( wxPoint( lsrc->end_x, 2 * src->y - lsrc->end_y ) );
arc->SetArcAngleAndEnd0( lsrc->result.GetCentralAngle() * 10.0 );
}
else
{
arc->SetLayer( layer );
arc->SetCenter( wxPoint( lsrc->center_x, lsrc->center_y ) );
arc->SetStart( wxPoint( lsrc->end_x, lsrc->end_y ) );
arc->SetArcAngleAndEnd0( -lsrc->result.GetCentralAngle() * 10.0 );
}
arc->SetLayer( layer );
arc->SetArcGeometry( (wxPoint) lsrc->result.GetP0(),
(wxPoint) lsrc->result.GetArcMid(),
(wxPoint) lsrc->result.GetP1() );
arc->SetWidth( lsrc->width );
arc->SetLocalCoord();
if( lsrc->width == 0 )
arc->SetWidth( ds.GetLineThickness( arc->GetLayer() ) );
if( src->mirror )
arc->Flip( arc->GetCenter(), false );
fp->Add( arc, ADD_MODE::APPEND );
break;
}
@ -2773,9 +2765,9 @@ bool FABMASTER::loadOutline( BOARD* aBoard, const std::unique_ptr<FABMASTER::TRA
PCB_SHAPE* arc = new PCB_SHAPE( aBoard, SHAPE_T::ARC );
arc->SetLayer( layer );
arc->SetCenter( wxPoint( src->center_x, src->center_y ) );
arc->SetStart( wxPoint( src->start_x, src->start_y ) );
arc->SetArcAngleAndEnd( src->result.GetCentralAngle() * 10.0 );
arc->SetArcGeometry( (wxPoint) src->result.GetP0(),
(wxPoint) src->result.GetArcMid(),
(wxPoint) src->result.GetP1() );
arc->SetWidth( src->width );
if( arc->GetWidth() == 0 )
@ -2888,9 +2880,9 @@ bool FABMASTER::loadGraphics( BOARD* aBoard )
PCB_SHAPE* arc = new PCB_SHAPE( aBoard, SHAPE_T::ARC );
arc->SetLayer( layer );
arc->SetCenter( wxPoint( src->center_x, src->center_y ) );
arc->SetStart( wxPoint( src->start_x, src->start_y ) );
arc->SetArcAngleAndEnd( src->result.GetCentralAngle() * 10.0 );
arc->SetArcGeometry( (wxPoint) src->result.GetP0(),
(wxPoint) src->result.GetArcMid(),
(wxPoint) src->result.GetP1() );
arc->SetWidth( src->width );
aBoard->Add( arc, ADD_MODE::APPEND );