Update GenCAD export to handle arbitrary outline
Fixes https://gitlab.com/kicad/code/kicad/-/issues/15961
This commit is contained in:
parent
0345e0f75c
commit
8b3ac31646
|
@ -1085,20 +1085,15 @@ void GENCAD_EXPORTER::CreateBoardSection( )
|
||||||
fputs( "$BOARD\n", m_file );
|
fputs( "$BOARD\n", m_file );
|
||||||
|
|
||||||
// Extract the board edges
|
// Extract the board edges
|
||||||
for( BOARD_ITEM* drawing : m_board->Drawings() )
|
SHAPE_POLY_SET outline;
|
||||||
{
|
m_board->GetBoardPolygonOutlines( outline );
|
||||||
if( drawing->Type() == PCB_SHAPE_T )
|
|
||||||
{
|
|
||||||
PCB_SHAPE* drawseg = static_cast<PCB_SHAPE*>( drawing );
|
|
||||||
|
|
||||||
if( drawseg->GetLayer() == Edge_Cuts )
|
for( auto seg1 = outline.IterateSegmentsWithHoles(); seg1; seg1++ )
|
||||||
{
|
{
|
||||||
// XXX GenCAD supports arc boundaries but I've seen nothing that reads them
|
SEG seg = *seg1;
|
||||||
fprintf( m_file, "LINE %g %g %g %g\n",
|
fprintf( m_file, "LINE %g %g %g %g\n",
|
||||||
MapXTo( drawseg->GetStart().x ), MapYTo( drawseg->GetStart().y ),
|
MapXTo( seg.A.x ), MapYTo( seg.A.y ),
|
||||||
MapXTo( drawseg->GetEnd().x ), MapYTo( drawseg->GetEnd().y ) );
|
MapXTo( seg.B.x ), MapYTo( seg.B.y ) );
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fputs( "$ENDBOARD\n\n", m_file );
|
fputs( "$ENDBOARD\n\n", m_file );
|
||||||
|
|
Loading…
Reference in New Issue