From 33dcc080eae2e0e11f58dfd2200c7fc5e0c12a53 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 19 Mar 2018 17:34:11 +0100 Subject: [PATCH] STEP exporter: check board outline continuity --- pcbnew/dialogs/dialog_export_step.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pcbnew/dialogs/dialog_export_step.cpp b/pcbnew/dialogs/dialog_export_step.cpp index 8bda59b4d1..9397b9a988 100644 --- a/pcbnew/dialogs/dialog_export_step.cpp +++ b/pcbnew/dialogs/dialog_export_step.cpp @@ -220,11 +220,21 @@ void DIALOG_EXPORT_STEP::onUpdateYPos( wxUpdateUIEvent& aEvent ) void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent ) { + SHAPE_POLY_SET outline; + wxString msg; + + // Check if the board outline is continuous + // TODO the check below is more forgiving than kicad2step, needs to be more strict + if( !m_parent->GetBoard()->GetBoardPolygonOutlines( outline, &msg ) ) + { + DisplayErrorMessage( this, _( "Cannot determine the board outline." ), msg ); + return; + } + wxFileName fn = m_filePickerSTEP->GetFileName(); if( fn.FileExists() ) { - wxString msg; msg.Printf( _( "File '%s' already exists. Do you want overwrite this file?" ), fn.GetFullPath().GetData() );