From 63fc89cafd84e8794ed741cef29cd3c73e241070 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 9 Feb 2024 13:54:28 +0000 Subject: [PATCH] Import graphic items on copper layers. Fixes https://gitlab.com/kicad/code/kicad/-/issues/16916 --- pcbnew/pcb_io/fabmaster/import_fabmaster.cpp | 41 ++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp b/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp index ac8165fc2a..e32139ac87 100644 --- a/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp +++ b/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp @@ -2574,6 +2574,47 @@ bool FABMASTER::loadEtch( BOARD* aBoard, const std::unique_ptr aBoard->Add( trk, ADD_MODE::APPEND ); } + else if( seg->shape == GR_SHAPE_CIRCLE ) + { + const GRAPHIC_ARC* src = static_cast( seg.get() ); + + PCB_SHAPE* circle = new PCB_SHAPE( aBoard, SHAPE_T::CIRCLE ); + circle->SetLayer( layer ); + circle->SetCenter( VECTOR2I( src->center_x, src->center_y ) ); + circle->SetEnd( VECTOR2I( src->end_x, src->end_y ) ); + circle->SetWidth( src->width ); + + aBoard->Add( circle, ADD_MODE::APPEND ); + } + else if( seg->shape == GR_SHAPE_RECTANGLE ) + { + const GRAPHIC_RECTANGLE *src = + static_cast( seg.get() ); + + PCB_SHAPE* rect = new PCB_SHAPE( aBoard, SHAPE_T::RECTANGLE ); + rect->SetLayer( layer ); + rect->SetStart( VECTOR2I( src->start_x, src->start_y ) ); + rect->SetEnd( VECTOR2I( src->end_x, src->end_y ) ); + rect->SetStroke( STROKE_PARAMS( 0 ) ); + rect->SetFilled( true ); + aBoard->Add( rect, ADD_MODE::APPEND ); + } + else if( seg->shape == GR_SHAPE_TEXT ) + { + const GRAPHIC_TEXT *src = + static_cast( seg.get() ); + + PCB_TEXT* txt = new PCB_TEXT( aBoard ); + txt->SetLayer( layer ); + txt->SetTextPos( VECTOR2I( src->start_x, src->start_y - src->height / 2 ) ); + txt->SetText( src->text ); + txt->SetItalic( src->ital ); + txt->SetTextThickness( src->thickness ); + txt->SetTextHeight( src->height ); + txt->SetTextWidth( src->width ); + txt->SetHorizJustify( src->orient ); + aBoard->Add( txt, ADD_MODE::APPEND ); + } } else {