Step exporter: avoid crash when the board to export has not closed outlines.

This commit is contained in:
jean-pierre charras 2020-10-06 16:03:08 +02:00
parent 30c2ca67d9
commit 63471d861d
2 changed files with 15 additions and 3 deletions

View File

@ -387,7 +387,14 @@ int PANEL_KICAD2STEP::RunConverter()
{
ReportMessage( "Build STEP data\n" );
pcb.ComposePCB( m_params.m_includeVirtual );
res = pcb.ComposePCB( m_params.m_includeVirtual );
if( !res )
{
ReportMessage( "\n**Error building STEP board model. Abort export **\n" );
return -1;
}
ReportMessage( "Write STEP file\n" );
#ifdef SUPPORTS_IGES
@ -399,7 +406,7 @@ int PANEL_KICAD2STEP::RunConverter()
if( !res )
{
wxMessageBox( "Error Write STEP file" );
ReportMessage( "\nError Write STEP file\n" );
return -1;
}
}
@ -437,7 +444,7 @@ int PANEL_KICAD2STEP::RunConverter()
{
if( !success )
msg = "Unable to create STEP file.\n"
"Check that the board has a valid outline and models.";
"Check that the board has a valid outline and models.";
else
{
msg = "STEP file has been created, but there are warnings.";

View File

@ -762,6 +762,11 @@ bool PCBMODEL::CreatePCB()
}
}
}
else
{
ReportMessage( "* could not create closed board outlines *\n" );
return false;
}
// subtract cutouts (if any)
if( m_cutouts.size() )