diff --git a/pcbnew/dialogs/dialog_export_step.cpp b/pcbnew/dialogs/dialog_export_step.cpp index fc5e9db087..d967eb0caf 100644 --- a/pcbnew/dialogs/dialog_export_step.cpp +++ b/pcbnew/dialogs/dialog_export_step.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2016 Cirilo Bernardo - * Copyright (C) 2016-2019 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2016-2020 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -255,7 +255,7 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent ) if( fn.FileExists() && !GetOverwriteFile() ) { msg.Printf( _( "File '%s' already exists. Do you want overwrite this file?" ), - fn.GetFullPath().GetData() ); + fn.GetFullPath() ); if( wxMessageBox( msg, _( "STEP Export" ), wxYES_NO | wxICON_QUESTION, this ) == wxNO ) return; @@ -331,9 +331,24 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent ) if( m_tolerance->GetSelection() != 1 ) { + double tolerance = 0.01; // defautl value in mm + + switch( m_tolerance->GetSelection() ) + { + case 0: // small + tolerance = 0.001; + break; + + default: + case 1: break; // Normal + + case 2: // large + tolerance = 0.1; + break; + } + LOCALE_IO dummy; - double tolerance = 0.001 * std::pow( 10.0, m_tolerance->GetSelection() - 1 ); - cmdK2S.Append( wxString::Format( " --min-distance=\"%.4f mm\"", tolerance ) ); + cmdK2S.Append( wxString::Format( " --min-distance=\"%.3f mm\"", tolerance ) ); } cmdK2S.Append( " -f -o " ); diff --git a/pcbnew/dialogs/dialog_export_step_base.cpp b/pcbnew/dialogs/dialog_export_step_base.cpp index 18f75495b8..9cc744eabb 100644 --- a/pcbnew/dialogs/dialog_export_step_base.cpp +++ b/pcbnew/dialogs/dialog_export_step_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Jun 18 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -153,11 +153,11 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i m_staticTextTolerance->Wrap( -1 ); bSizerTolerance->Add( m_staticTextTolerance, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - wxString m_toleranceChoices[] = { _("Tight"), _("Standard"), _("Loose"), _("Very loose") }; + wxString m_toleranceChoices[] = { _("Tight (0.001 mm)"), _("Standard (0.01 mm)"), _("Loose (0.1 mm)") }; int m_toleranceNChoices = sizeof( m_toleranceChoices ) / sizeof( wxString ); m_tolerance = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_toleranceNChoices, m_toleranceChoices, 0 ); m_tolerance->SetSelection( 1 ); - m_tolerance->SetToolTip( _("Tolerance sets the distance between two points that are considered joined. Standard is 0.001mm.") ); + m_tolerance->SetToolTip( _("Tolerance sets the distance between two points that are considered joined.") ); bSizerTolerance->Add( m_tolerance, 1, wxALL, 5 ); diff --git a/pcbnew/dialogs/dialog_export_step_base.fbp b/pcbnew/dialogs/dialog_export_step_base.fbp index be7085f514..6d9758b25e 100644 --- a/pcbnew/dialogs/dialog_export_step_base.fbp +++ b/pcbnew/dialogs/dialog_export_step_base.fbp @@ -14,7 +14,6 @@ dialog_export_step_base 1000 none - 1 dialog_export_step_base @@ -26,7 +25,6 @@ 1 1 UI - 0 1 0 @@ -1484,7 +1482,7 @@ 1 0 - "Tight" "Standard" "Loose" "Very loose" + "Tight (0.001 mm)" "Standard (0.01 mm)" "Loose (0.1 mm)" 1 1 @@ -1520,7 +1518,7 @@ ; ; forward_declare 0 - Tolerance sets the distance between two points that are considered joined. Standard is 0.001mm. + Tolerance sets the distance between two points that are considered joined. wxFILTER_NONE wxDefaultValidator diff --git a/pcbnew/dialogs/dialog_export_step_base.h b/pcbnew/dialogs/dialog_export_step_base.h index 0d7d1e7239..ca0eb5ca12 100644 --- a/pcbnew/dialogs/dialog_export_step_base.h +++ b/pcbnew/dialogs/dialog_export_step_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 3.9.0 Jun 18 2020) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! diff --git a/utils/kicad2step/pcb/base.h b/utils/kicad2step/pcb/base.h index 4530f5ea89..32c617cf15 100644 --- a/utils/kicad2step/pcb/base.h +++ b/utils/kicad2step/pcb/base.h @@ -34,8 +34,8 @@ #include -///> Minimum distance between points to treat them as separate ones (mm) -static constexpr double MIN_DISTANCE = 0.001; +///> Default minimum distance between points to treat them as separate ones (mm) +static constexpr double MIN_DISTANCE = 0.01; namespace SEXPR { diff --git a/utils/kicad2step/pcb/oce_utils.h b/utils/kicad2step/pcb/oce_utils.h index 875557d3ce..966b8fd4b5 100644 --- a/utils/kicad2step/pcb/oce_utils.h +++ b/utils/kicad2step/pcb/oce_utils.h @@ -131,6 +131,7 @@ public: // aThickness > THICKNESS_MIN == use aThickness void SetPCBThickness( double aThickness ); + // Set the minimum distance (in mm) to consider 2 points have the same coordinates void SetMinDistance( double aDistance ); // create the PCB model using the current outlines and drill holes