Step exporter: better values for min distance between 2 points to merge them.

- The default value is 0.01 mm (according to comments and similar to the 3D viewer
 settings that uses 0.02 mm)
- The export dialog  has now 3 values 1 micron, 0.01mm (default) and 0.1 mm

From Master branch, commits a9feb1c and 5db7580
This commit is contained in:
jean-pierre charras 2021-01-03 14:52:42 +01:00
parent 267e510071
commit 07568f87c3
6 changed files with 26 additions and 11 deletions

View File

@ -315,11 +315,25 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
break; break;
} }
if( m_tolerance->GetSelection() != 1 ) double tolerance = 0.01; // default 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; LOCALE_IO dummy;
double tolerance = 0.001 * std::pow<double>( 10.0, m_tolerance->GetSelection() - 1 ); cmdK2S.Append( wxString::Format( " --min-distance=\"%.3f mm\"", tolerance ) );
cmdK2S.Append( wxString::Format( " --min-distance=\"%.4f mm\"", tolerance ) );
} }
cmdK2S.Append( " -f -o " ); cmdK2S.Append( " -f -o " );

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jan 17 2019) // C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -163,11 +163,11 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
m_staticText8->Wrap( -1 ); m_staticText8->Wrap( -1 );
fgSizer4->Add( m_staticText8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizer4->Add( m_staticText8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 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 ); int m_toleranceNChoices = sizeof( m_toleranceChoices ) / sizeof( wxString );
m_tolerance = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_toleranceNChoices, m_toleranceChoices, 0 ); m_tolerance = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_toleranceNChoices, m_toleranceChoices, 0 );
m_tolerance->SetSelection( 1 ); 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.") );
fgSizer4->Add( m_tolerance, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizer4->Add( m_tolerance, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );

View File

@ -1353,7 +1353,7 @@
<property name="caption"></property> <property name="caption"></property>
<property name="caption_visible">1</property> <property name="caption_visible">1</property>
<property name="center_pane">0</property> <property name="center_pane">0</property>
<property name="choices">&quot;Tight&quot; &quot;Standard&quot; &quot;Loose&quot; &quot;Very loose&quot;</property> <property name="choices">&quot;Tight (0.001 mm)&quot; &quot;Standard (0.01 mm)&quot; &quot;Loose (0.1 mm)&quot;</property>
<property name="close_button">1</property> <property name="close_button">1</property>
<property name="context_help"></property> <property name="context_help"></property>
<property name="context_menu">1</property> <property name="context_menu">1</property>
@ -1389,7 +1389,7 @@
<property name="style"></property> <property name="style"></property>
<property name="subclass">; ; forward_declare</property> <property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property> <property name="toolbar_pane">0</property>
<property name="tooltip">Tolerance sets the distance between two points that are considered joined. Standard is 0.001mm.</property> <property name="tooltip">Tolerance sets the distance between two points that are considered joined.</property>
<property name="validator_data_type"></property> <property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property> <property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property> <property name="validator_type">wxDefaultValidator</property>

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jan 17 2019) // C++ code generated with wxFormBuilder (version Oct 26 2018)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!

View File

@ -30,8 +30,8 @@
#ifndef KICADBASE_H #ifndef KICADBASE_H
#define KICADBASE_H #define KICADBASE_H
///> Minimum distance between points to treat them as separate ones (mm) ///> Default minimum distance between points to treat them as separate ones (mm)
static constexpr double MIN_DISTANCE = 0.001; static constexpr double MIN_DISTANCE = 0.01;
namespace SEXPR namespace SEXPR
{ {

View File

@ -131,6 +131,7 @@ public:
// aThickness > THICKNESS_MIN == use aThickness // aThickness > THICKNESS_MIN == use aThickness
void SetPCBThickness( double aThickness ); void SetPCBThickness( double aThickness );
// Set the minimum distance (in mm) to consider 2 points have the same coordinates
void SetMinDistance( double aDistance ); void SetMinDistance( double aDistance );
// create the PCB model using the current outlines and drill holes // create the PCB model using the current outlines and drill holes