From 5def0c2eeaf2da4e024c32a0e6e95a4d188d7f57 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Tue, 19 Jun 2012 21:25:41 +0200 Subject: [PATCH] Pcbnew: fix incorrect arc export in SVG file export. Very minor other fixes. --- bitmaps_png/sources/module_ratsnest.svg | 215 +++- pcbnew/dialogs/dialog_find_base.cpp | 143 +-- pcbnew/dialogs/dialog_find_base.fbp | 1326 +++++++++++------------ pcbnew/dialogs/dialog_find_base.h | 120 +- pcbnew/export_vrml.cpp | 177 +-- pcbnew/find.pjd | 842 -------------- pcbnew/legacy_plugin.cpp | 8 +- 7 files changed, 1064 insertions(+), 1767 deletions(-) delete mode 100644 pcbnew/find.pjd diff --git a/bitmaps_png/sources/module_ratsnest.svg b/bitmaps_png/sources/module_ratsnest.svg index c84a817c39..9f37b94232 100644 --- a/bitmaps_png/sources/module_ratsnest.svg +++ b/bitmaps_png/sources/module_ratsnest.svg @@ -1,36 +1,181 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_find_base.cpp b/pcbnew/dialogs/dialog_find_base.cpp index ce3209a7ea..eb7ff2c278 100644 --- a/pcbnew/dialogs/dialog_find_base.cpp +++ b/pcbnew/dialogs/dialog_find_base.cpp @@ -1,70 +1,73 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 24 2011) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_find_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_FIND_BASE::DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bSizerMain; - bSizerMain = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer3; - bSizer3 = new wxBoxSizer( wxVERTICAL ); - - m_staticText1 = new wxStaticText( this, wxID_ANY, _("Search for:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1->Wrap( -1 ); - bSizer3->Add( m_staticText1, 0, wxALL, 5 ); - - m_SearchTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 200,-1 ), 0 ); - bSizer3->Add( m_SearchTextCtrl, 0, wxALL|wxEXPAND, 5 ); - - m_NoMouseWarpCheckBox = new wxCheckBox( this, wxID_ANY, _("Do not warp mouse pointer"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer3->Add( m_NoMouseWarpCheckBox, 0, wxALL, 5 ); - - bSizerMain->Add( bSizer3, 1, 0, 5 ); - - wxBoxSizer* bSizer4; - bSizer4 = new wxBoxSizer( wxVERTICAL ); - - m_button1 = new wxButton( this, wxID_ANY, _("Find Item"), wxDefaultPosition, wxDefaultSize, 0 ); - m_button1->SetDefault(); - bSizer4->Add( m_button1, 0, wxALL, 5 ); - - m_button2 = new wxButton( this, wxID_ANY, _("Find Marker"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer4->Add( m_button2, 0, wxALL, 5 ); - - m_button3 = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer4->Add( m_button3, 0, wxALL, 5 ); - - bSizerMain->Add( bSizer4, 0, 0, 5 ); - - this->SetSizer( bSizerMain ); - this->Layout(); - bSizerMain->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_FIND_BASE::onClose ) ); - m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindItemClick ), NULL, this ); - m_button2->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindMarkerClick ), NULL, this ); - m_button3->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonCloseClick ), NULL, this ); -} - -DIALOG_FIND_BASE::~DIALOG_FIND_BASE() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_FIND_BASE::onClose ) ); - m_button1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindItemClick ), NULL, this ); - m_button2->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindMarkerClick ), NULL, this ); - m_button3->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonCloseClick ), NULL, this ); - -} +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 10 2012) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_find_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_FIND_BASE::DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizerMain; + bSizerMain = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer3; + bSizer3 = new wxBoxSizer( wxVERTICAL ); + + m_staticText1 = new wxStaticText( this, wxID_ANY, _("Search for:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1->Wrap( -1 ); + bSizer3->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_SearchTextCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 200,-1 ), 0 ); + bSizer3->Add( m_SearchTextCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_NoMouseWarpCheckBox = new wxCheckBox( this, wxID_ANY, _("Do not warp mouse pointer"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer3->Add( m_NoMouseWarpCheckBox, 1, wxALL|wxEXPAND, 5 ); + + + bSizerMain->Add( bSizer3, 1, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + wxBoxSizer* bSizer4; + bSizer4 = new wxBoxSizer( wxVERTICAL ); + + m_button1 = new wxButton( this, wxID_ANY, _("Find Item"), wxDefaultPosition, wxDefaultSize, 0 ); + m_button1->SetDefault(); + bSizer4->Add( m_button1, 1, wxALL|wxEXPAND, 5 ); + + m_button2 = new wxButton( this, wxID_ANY, _("Find Marker"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer4->Add( m_button2, 1, wxALL|wxEXPAND, 5 ); + + m_button3 = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer4->Add( m_button3, 1, wxALL|wxEXPAND, 5 ); + + + bSizerMain->Add( bSizer4, 0, wxALL, 5 ); + + + this->SetSizer( bSizerMain ); + this->Layout(); + bSizerMain->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_FIND_BASE::onClose ) ); + m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindItemClick ), NULL, this ); + m_button2->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindMarkerClick ), NULL, this ); + m_button3->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonCloseClick ), NULL, this ); +} + +DIALOG_FIND_BASE::~DIALOG_FIND_BASE() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_FIND_BASE::onClose ) ); + m_button1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindItemClick ), NULL, this ); + m_button2->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonFindMarkerClick ), NULL, this ); + m_button3->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_FIND_BASE::onButtonCloseClick ), NULL, this ); + +} diff --git a/pcbnew/dialogs/dialog_find_base.fbp b/pcbnew/dialogs/dialog_find_base.fbp index 76ebf5b651..e324765420 100644 --- a/pcbnew/dialogs/dialog_find_base.fbp +++ b/pcbnew/dialogs/dialog_find_base.fbp @@ -1,681 +1,645 @@ - - - - - - C++ - 1 - source_name - 0 - res - UTF-8 - connect - dialog_find_base - 1000 - none - 1 - dialog_find - - . - - 1 - 1 - 0 - 0 - - 1 - 1 - 1 - 1 - 0 - - - - - 1 - wxBOTH - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - impl_virtual - - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - - 0 - - 1 - DIALOG_FIND_BASE - 1 - - - 1 - - - Resizable - - 1 - -1,-1 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER - DIALOG_SHIM; dialog_shim.h - Find - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - onClose - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bSizerMain - wxHORIZONTAL - none - - 5 - - 1 - - - bSizer3 - wxVERTICAL - none - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Search for: - - - 0 - - - 0 - - 1 - m_staticText1 - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - - 0 - - 0 - - 0 - - 1 - m_SearchTextCtrl - 1 - - - protected - 1 - - - Resizable - - 1 - 200,-1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Do not warp mouse pointer - - - 0 - - - 0 - - 1 - m_NoMouseWarpCheckBox - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - 0 - - - bSizer4 - wxVERTICAL - none - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Find Item - - - 0 - - - 0 - - 1 - m_button1 - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - onButtonFindItemClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Find Marker - - - 0 - - - 0 - - 1 - m_button2 - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - onButtonFindMarkerClick - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - 1 - 0 - 1 - - 1 - 0 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_CANCEL - Close - - - 0 - - - 0 - - 1 - m_button3 - 1 - - - protected - 1 - - - Resizable - - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - onButtonCloseClick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + C++ + 1 + source_name + 0 + 0 + res + UTF-8 + connect + dialog_find_base + 1000 + none + 1 + dialog_find + + . + + 1 + 1 + 1 + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 1 + impl_virtual + + + + 0 + wxID_ANY + + + DIALOG_FIND_BASE + + -1,-1 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER + DIALOG_SHIM; dialog_shim.h + Find + + + + + + + + + + + + + + onClose + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bSizerMain + wxHORIZONTAL + none + + 5 + wxEXPAND|wxTOP|wxBOTTOM + 1 + + + bSizer3 + wxVERTICAL + none + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Search for: + + 0 + + + 0 + + 1 + m_staticText1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 0 + + 1 + m_SearchTextCtrl + 1 + + + protected + 1 + + Resizable + 1 + 200,-1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Do not warp mouse pointer + + 0 + + + 0 + + 1 + m_NoMouseWarpCheckBox + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL + 0 + + + bSizer4 + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Find Item + + 0 + + + 0 + + 1 + m_button1 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onButtonFindItemClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Find Marker + + 0 + + + 0 + + 1 + m_button2 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onButtonFindMarkerClick + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_CANCEL + Close + + 0 + + + 0 + + 1 + m_button3 + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + onButtonCloseClick + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_find_base.h b/pcbnew/dialogs/dialog_find_base.h index 63ba7a9e6b..48a35e53cf 100644 --- a/pcbnew/dialogs/dialog_find_base.h +++ b/pcbnew/dialogs/dialog_find_base.h @@ -1,61 +1,59 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Aug 24 2011) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __DIALOG_FIND_BASE_H__ -#define __DIALOG_FIND_BASE_H__ - -#include -#include -#include -class DIALOG_SHIM; - -#include "dialog_shim.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_FIND_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_FIND_BASE : public DIALOG_SHIM -{ - private: - - protected: - wxStaticText* m_staticText1; - wxTextCtrl* m_SearchTextCtrl; - wxCheckBox* m_NoMouseWarpCheckBox; - wxButton* m_button1; - wxButton* m_button2; - wxButton* m_button3; - - // Virtual event handlers, overide them in your derived class - virtual void onClose( wxCloseEvent& event ) { event.Skip(); } - virtual void onButtonFindItemClick( wxCommandEvent& event ) { event.Skip(); } - virtual void onButtonFindMarkerClick( wxCommandEvent& event ) { event.Skip(); } - virtual void onButtonCloseClick( wxCommandEvent& event ) { event.Skip(); } - - - public: - - DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Find"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DIALOG_FIND_BASE(); - -}; - -#endif //__DIALOG_FIND_BASE_H__ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 10 2012) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __DIALOG_FIND_BASE_H__ +#define __DIALOG_FIND_BASE_H__ + +#include +#include +#include +#include "dialog_shim.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_FIND_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_FIND_BASE : public DIALOG_SHIM +{ + private: + + protected: + wxStaticText* m_staticText1; + wxTextCtrl* m_SearchTextCtrl; + wxCheckBox* m_NoMouseWarpCheckBox; + wxButton* m_button1; + wxButton* m_button2; + wxButton* m_button3; + + // Virtual event handlers, overide them in your derived class + virtual void onClose( wxCloseEvent& event ) { event.Skip(); } + virtual void onButtonFindItemClick( wxCommandEvent& event ) { event.Skip(); } + virtual void onButtonFindMarkerClick( wxCommandEvent& event ) { event.Skip(); } + virtual void onButtonCloseClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DIALOG_FIND_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Find"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DIALOG_FIND_BASE(); + +}; + +#endif //__DIALOG_FIND_BASE_H__ diff --git a/pcbnew/export_vrml.cpp b/pcbnew/export_vrml.cpp index 3ef710c4a2..093070d2a8 100644 --- a/pcbnew/export_vrml.cpp +++ b/pcbnew/export_vrml.cpp @@ -1,7 +1,5 @@ #include -#include #include -#include #include #include #include @@ -21,6 +19,8 @@ #include +#define SEGM_COUNT_PER_360 32 // Number of segments to approximate a circle per segments + /* helper function: * some characters cannot be used in names, * this function change them to "_" @@ -43,8 +43,9 @@ private: wxConfig* m_config; int m_unitsOpt; // to remember last option int m_3DFilesOpt; // to remember last option - virtual void OnCancelClick( wxCommandEvent& event ){ EndModal( wxID_CANCEL ); } - virtual void OnOkClick( wxCommandEvent& event ){ EndModal( wxID_OK ); } + + void OnCancelClick( wxCommandEvent& event ){ EndModal( wxID_CANCEL ); } + void OnOkClick( wxCommandEvent& event ){ EndModal( wxID_OK ); } public: DIALOG_EXPORT_3DFILE( PCB_EDIT_FRAME* parent ) : @@ -104,8 +105,9 @@ struct VRMLPt }; struct FlatPt { - FlatPt( double _x = 0, double _y = 0 ) : x( _x ), y( _y ) { } - double x, y; + FlatPt( double _x = 0, double _y = 0 ) : x( _x ), y( _y ) + { } + double x, y; }; struct Triangle { @@ -277,7 +279,7 @@ static void write_triangle_bag( FILE* output_file, int color_index, //{{{ " }\n", " }\n", " geometry IndexedFaceSet {\n", - " solid true\n", + " solid TRUE\n", " coord Coordinate {\n", " point [\n", 0, // Coordinates marker @@ -383,7 +385,7 @@ static void compute_layer_Zs( BOARD* pcb ) //{{{ /* To avoid rounding interference, we apply an epsilon to each * successive layer */ - const double epsilon_z = 10; // That's 1 mils, about 1/50 mm + const double epsilon_z = 1 * IU_PER_MILS; // That's 1 mils, about 1/50 mm layer_z[SOLDERPASTE_N_BACK] = -half_thickness - epsilon_z * 4; layer_z[ADHESIVE_N_BACK] = -half_thickness - epsilon_z * 3; layer_z[SILKSCREEN_N_BACK] = -half_thickness - epsilon_z * 2; @@ -429,8 +431,8 @@ static void export_vrml_line( int layer, double startx, double starty, //{{{ } -static void export_vrml_circle( int layer, double startx, double starty, //{{{ - double endx, double endy, double width, int divisions ) +static void export_vrml_circle( int layer, double startx, double starty, + double endx, double endy, double width ) { double hole, radius; FlatRing ring; @@ -438,7 +440,7 @@ static void export_vrml_circle( int layer, double startx, double starty, //{{{ radius = hypot( startx - endx, starty - endy ) + ( width / 2); hole = radius - width; - for( double alpha = 0; alpha < M_PI * 2; alpha += M_PI * 2 / divisions ) + for( double alpha = 0; alpha < M_PI * 2; alpha += M_PI * 2 / SEGM_COUNT_PER_360 ) { ring.add_inner( startx + hole * cos( alpha ), starty + hole * sin( alpha ) ); ring.add_outer( startx + radius * cos( alpha ), starty + radius * sin( alpha ) ); @@ -450,10 +452,11 @@ static void export_vrml_circle( int layer, double startx, double starty, //{{{ static void export_vrml_slot( TriangleBag& triangles, //{{{ int top_layer, int bottom_layer, double xc, double yc, - double dx, double dy, int orient, int divisions ) + double dx, double dy, int orient ) { double capx, capy; // Cap center VLoop loop; + int divisions = SEGM_COUNT_PER_360 / 2; loop.z_top = layer_z[top_layer]; loop.z_bottom = layer_z[bottom_layer]; @@ -491,45 +494,23 @@ static void export_vrml_slot( TriangleBag& triangles, //{{{ } -static void export_vrml_hole( TriangleBag& triangles, //{{{ - int top_layer, int bottom_layer, double xc, double yc, double hole, - int divisions ) +static void export_vrml_hole( TriangleBag& triangles, int top_layer, int bottom_layer, + double xc, double yc, double hole ) { VLoop loop; loop.z_top = layer_z[top_layer]; loop.z_bottom = layer_z[bottom_layer]; - for( double alpha = 0; alpha < M_PI * 2; alpha += M_PI * 2 / divisions ) + for( double alpha = 0; alpha < M_PI * 2; alpha += M_PI * 2 / SEGM_COUNT_PER_360 ) loop.add( xc + cos( alpha ) * hole, yc + sin( alpha ) * hole ); loop.bag( triangles ); } -static void export_vrml_varc( TriangleBag& triangles, //{{{ - int top_layer, int bottom_layer, double startx, double starty, - double endx, double endy, int divisions ) -{ - VLoop loop; - - loop.z_top = layer_z[top_layer]; - loop.z_bottom = layer_z[bottom_layer]; - double angle = atan2( endx - startx, endy - starty ); - double radius = hypot( startx - endx, starty - endy ); - - for( double alpha = angle; alpha < angle + PI2; alpha += PI2 / divisions ) - { - loop.add( startx + cos( alpha ) * radius, starty + sin( alpha ) * radius ); - } - - loop.bag( triangles ); -} - - -static void export_vrml_oval_pad( int layer, //{{{ - double xc, double yc, - double dx, double dy, int orient, int divisions ) +static void export_vrml_oval_pad( int layer, double xc, double yc, + double dx, double dy, int orient ) { double capx, capy; // Cap center FlatFan fan; @@ -537,6 +518,7 @@ static void export_vrml_oval_pad( int layer, //{{{ fan.c.x = xc; fan.c.y = yc; double angle = orient / 1800.0 * M_PI; + int divisions = SEGM_COUNT_PER_360 / 2; if( dy > dx ) { @@ -570,25 +552,68 @@ static void export_vrml_oval_pad( int layer, //{{{ } -static void export_vrml_arc( int layer, double startx, double starty, //{{{ - double endx, double endy, double width, int divisions ) +static void export_vrml_arc( int layer, double centerx, double centery, + double arc_startx, double arc_starty, + double width, double arc_angle ) { FlatRing ring; - double hole, radius; - double angle = atan2( endx - startx, endy - starty ); + double start_angle = atan2( arc_starty - centery, arc_startx - centerx ); - radius = hypot( startx - endx, starty - endy ) + ( width / 2); - hole = radius - width; + int count = KiROUND( arc_angle / 360.0 * SEGM_COUNT_PER_360 ); + if( count < 0 ) + count = -count; + if( count == 0 ) + count = 1; + double divisions = arc_angle*M_PI/180.0 / count; - for( double alpha = angle; alpha < angle + PI2; alpha += PI2 / divisions ) + double outer_radius = hypot( arc_starty - centery, arc_startx - centerx ) + + ( width / 2); + double inner_radius = outer_radius - width; + + double alpha = 0; + for( int ii = 0; ii <= count; alpha += divisions, ii++ ) { - ring.add_inner( startx + cos( alpha ) * hole, starty + sin( alpha ) * hole ); - ring.add_outer( startx + cos( alpha ) * radius, starty + sin( alpha ) * radius ); + double angle_rot = start_angle + alpha; + ring.add_inner( centerx + cos( angle_rot ) * inner_radius, + centery + sin( angle_rot ) * inner_radius ); + ring.add_outer( centerx + cos( angle_rot ) * outer_radius, + centery + sin( angle_rot ) * outer_radius ); } ring.bag( layer, false ); } +static void export_vrml_varc( TriangleBag& triangles, + int top_layer, int bottom_layer, + double centerx, double centery, + double arc_startx, double arc_starty, + double arc_angle ) +{ + VLoop loop; + + loop.z_top = layer_z[top_layer]; + loop.z_bottom = layer_z[bottom_layer]; + + double start_angle = atan2( arc_starty - centery, arc_startx - centerx ); + double radius = hypot( arc_starty - centery, arc_startx - centerx ); + + int count = KiROUND( arc_angle / 360.0 * SEGM_COUNT_PER_360 ); + if( count < 0 ) + count = -count; + if( count == 0 ) + count = 1; + double divisions = arc_angle*M_PI/180.0 / count; + + double alpha = 0; + for( int ii = 0; ii <= count; alpha += divisions, ii++ ) + { + double angle_rot = start_angle + alpha; + loop.add( centerx + cos( angle_rot ) * radius, centery + sin( angle_rot ) * radius ); + } + + loop.bag( triangles ); +} + static void export_vrml_drawsegment( DRAWSEGMENT* drawseg ) //{{{ { @@ -608,14 +633,14 @@ static void export_vrml_drawsegment( DRAWSEGMENT* drawseg ) //{{{ case S_ARC: export_vrml_varc( layer_triangles[layer], FIRST_COPPER_LAYER, LAST_COPPER_LAYER, - x, y, xf, yf, 4 ); + x, y, xf, yf, drawseg->GetAngle()/10 ); break; // Circles on edge are usually important holes case S_CIRCLE: export_vrml_hole( layer_triangles[layer], FIRST_COPPER_LAYER, LAST_COPPER_LAYER, x, y, - hypot( xf - x, yf - y ) / 2, 12 ); + hypot( xf - x, yf - y ) / 2 ); break; default: @@ -633,11 +658,16 @@ static void export_vrml_drawsegment( DRAWSEGMENT* drawseg ) //{{{ switch( drawseg->GetShape() ) { case S_ARC: - export_vrml_arc( layer, x, y, xf, yf, w, 3 ); + export_vrml_arc( layer, + (double) drawseg->GetCenter().x, + (double) drawseg->GetCenter().y, + (double) drawseg->GetArcStart().x, + (double) drawseg->GetArcStart().y, + w, drawseg->GetAngle()/10 ); break; case S_CIRCLE: - export_vrml_circle( layer, x, y, xf, yf, w, 12 ); + export_vrml_circle( layer, x, y, xf, yf, w ); break; default: @@ -727,7 +757,7 @@ static void export_vrml_drawings( BOARD* pcb ) //{{{ static void export_round_padstack( BOARD* pcb, double x, double y, double r, //{{{ - int bottom_layer, int top_layer, int divisions ) + int bottom_layer, int top_layer ) { int copper_layers = pcb->GetCopperLayerCount( ); @@ -738,7 +768,7 @@ static void export_round_padstack( BOARD* pcb, double x, double y, double r, //{ layer = LAST_COPPER_LAYER; if( layer <= top_layer ) - export_vrml_circle( layer, x, y, x + r / 2, y, r, divisions ); + export_vrml_circle( layer, x, y, x + r / 2, y, r ); } } @@ -755,10 +785,10 @@ static void export_vrml_via( BOARD* pcb, SEGVIA* via ) //{{{ via->ReturnLayerPair( &top_layer, &bottom_layer ); // Export the via padstack - export_round_padstack( pcb, x, y, r, bottom_layer, top_layer, 8 ); + export_round_padstack( pcb, x, y, r, bottom_layer, top_layer ); - // Drill a rough hole - export_vrml_hole( via_triangles[via->m_Shape], top_layer, bottom_layer, x, y, hole, 8 ); + // Drill a hole + export_vrml_hole( via_triangles[via->m_Shape], top_layer, bottom_layer, x, y, hole ); } @@ -853,23 +883,23 @@ static void export_vrml_text_module( TEXTE_MODULE* module ) //{{{ } -static void export_vrml_edge_module( EDGE_MODULE* module ) //{{{ +static void export_vrml_edge_module( EDGE_MODULE* aOutline ) //{{{ { - int layer = module->GetLayer(); - double x = module->GetStart().x; - double y = module->GetStart().y; - double xf = module->GetEnd().x; - double yf = module->GetEnd().y; - double w = module->GetWidth(); + int layer = aOutline->GetLayer(); + double x = aOutline->GetStart().x; + double y = aOutline->GetStart().y; + double xf = aOutline->GetEnd().x; + double yf = aOutline->GetEnd().y; + double w = aOutline->GetWidth(); - switch( module->GetShape() ) + switch( aOutline->GetShape() ) { case S_ARC: - export_vrml_arc( layer, x, y, xf, yf, w, 3 ); + export_vrml_arc( layer, x, y, xf, yf, w, aOutline->GetAngle()/10 ); break; case S_CIRCLE: - export_vrml_circle( layer, x, y, xf, yf, w, 12 ); + export_vrml_circle( layer, x, y, xf, yf, w ); break; default: @@ -895,14 +925,14 @@ static void export_vrml_pad( BOARD* pcb, D_PAD* aPad ) //{{{ // Oblong hole (slot) export_vrml_slot( layer_triangles[EDGE_N], FIRST_COPPER_LAYER, LAST_COPPER_LAYER, - hole_x, hole_y, hole_drill_w, hole_drill_h, aPad->GetOrientation(), 6 ); + hole_x, hole_y, hole_drill_w, hole_drill_h, aPad->GetOrientation() ); } else { // Drill a round hole export_vrml_hole( layer_triangles[EDGE_N], FIRST_COPPER_LAYER, LAST_COPPER_LAYER, - hole_x, hole_y, hole_drill, 12 ); + hole_x, hole_y, hole_drill ); } } @@ -935,13 +965,12 @@ static void export_vrml_pad( BOARD* pcb, D_PAD* aPad ) //{{{ { case PAD_CIRCLE: export_vrml_circle( layer, pad_x, pad_y, - pad_x + pad_w / 2, pad_y, pad_w, 12 ); + pad_x + pad_w / 2, pad_y, pad_w ); break; case PAD_OVAL: - export_vrml_oval_pad( layer, - pad_x, pad_y, - pad_w * 2, pad_h * 2, aPad->GetOrientation(), 4 ); + export_vrml_oval_pad( layer, pad_x, pad_y, + pad_w * 2, pad_h * 2, aPad->GetOrientation() ); break; case PAD_RECT: @@ -1192,7 +1221,7 @@ wxBusyCursor dummy; if( ! ExportVRML_File( fullFilename, scale, export3DFiles, subDirFor3Dshapes ) ) { wxString msg = _( "Unable to create " ) + fullFilename; - DisplayError( this, msg ); + wxMessageBox( msg ); return; } } diff --git a/pcbnew/find.pjd b/pcbnew/find.pjd deleted file mode 100644 index f079ddc8ba..0000000000 --- a/pcbnew/find.pjd +++ /dev/null @@ -1,842 +0,0 @@ - - -
- 0 - "" - "" - "" - "" - "" - 0 - 0 - 0 - 1 - 1 - 1 - 1 - 0 - "jean-pierre Charras" - "License GNU" - "" - 0 - 0 - 0 - "<All platforms>" - "<Any>" - "///////////////////////////////////////////////////////////////////////////// -// Name: %HEADER-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SOURCE-FILENAME% -// Purpose: -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "///////////////////////////////////////////////////////////////////////////// -// Name: %SYMBOLS-FILENAME% -// Purpose: Symbols file -// Author: %AUTHOR% -// Modified by: -// Created: %DATE% -// RCS-ID: -// Copyright: %COPYRIGHT% -// Licence: -///////////////////////////////////////////////////////////////////////////// - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma interface "%HEADER-FILENAME%" -#endif - -" - "#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "%HEADER-FILENAME%" -#endif - -// For compilers that support precompilation, includes "wx/wx.h". -#include "wx/wxprec.h" - -#ifdef __BORLANDC__ -#pragma hdrstop -#endif - -#ifndef WX_PRECOMP -#include "wx/wx.h" -#endif - -" - " /// %BODY% -" - " -/*! - * %BODY% - */ - -" - "app_resources.h" - "app_resources.cpp" - "AppResources" - "app.h" - "app.cpp" - "Application" - 0 - "" - "<None>" - "<System>" - "utf-8" - "<System>" - "" - 0 - 0 - 4 - " " - "" - 0 - 0 - 1 - 0 - 1 - 1 - 0 - 1 - 0 - 0 -
- - - "" - "data-document" - "" - "" - 0 - 1 - 0 - 0 - - "Configurations" - "config-data-document" - "" - "" - 0 - 1 - 0 - 0 - "" - 1 - 0 - "" - "Debug" - "ANSI" - "Static" - "Modular" - "GUI" - "wxMSW" - "Dynamic" - "Yes" - "No" - "No" - "%WXVERSION%" - "%EXECUTABLE%" - "" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - "%AUTO%" - 0 - 1 - "" - - - - - - - "Projects" - "root-document" - "" - "project" - 1 - 1 - 0 - 1 - - "Windows" - "html-document" - "" - "dialogsfolder" - 1 - 1 - 0 - 1 - - "Find" - "dialog-document" - "" - "dialog" - 0 - 1 - 0 - 0 - "4/3/2006" - "wbDialogProxy" - 10000 - 0 - "" - 0 - "" - 0 - 0 - "ID_DIALOG" - 10000 - "WinEDA_PcbFindFrame" - "wxDialog" - "wxDialog" - "find.cpp" - "find.h" - "" - "Find" - 1 - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "Tiled" - 0 - 1 - 0 - 1 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - "MAYBE_RESIZE_BORDER" - 0 - 1 - -1 - -1 - 400 - 300 - 0 - "" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "wbBoxSizerProxy" - "Vertical" - "" - 0 - 0 - 0 - "<Any platform>" - - "wxStaticText: wxID_STATIC" - "dialog-control-document" - "" - "statictext" - 0 - 1 - 0 - 0 - "4/3/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "" - "Item to find:" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxTextCtrl: ID_TEXTCTRL" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "4/3/2006" - "wbTextCtrlProxy" - "ID_TEXTCTRL" - 10001 - "" - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_NewText" - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - 0 - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "4/3/2006" - "wbBoxSizerProxy" - "Horizontal" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "4/3/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxButton: ID_FIND_ITEM" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "4/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnFindItemClick" - "ID_FIND_ITEM" - 10002 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Find Item" - 1 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_FIND_NEXT_ITEM" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "4/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnFindNextItemClick" - "ID_FIND_NEXT_ITEM" - 10003 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Find Next Item" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "6F0000" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "4/3/2006" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxButton: ID_FIND_MARKER" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "4/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnFindMarkerClick" - "ID_FIND_MARKER" - 10004 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Find Marker" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_FIND_NEXT_MARKER" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "4/3/2006" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnFindNextMarkerClick" - "ID_FIND_NEXT_MARKER" - 10005 - "" - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Find Next Marker" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - - - - - - "Sources" - "html-document" - "" - "sourcesfolder" - 1 - 1 - 0 - 1 - - "find.rc" - "source-editor-document" - "find.rc" - "source-editor" - 0 - 0 - 1 - 0 - "4/3/2006" - "" - - - - "Images" - "html-document" - "" - "bitmapsfolder" - 1 - 1 - 0 - 1 - - - - -
diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp index 84a8009a0d..3f25ce71e3 100644 --- a/pcbnew/legacy_plugin.cpp +++ b/pcbnew/legacy_plugin.cpp @@ -354,12 +354,12 @@ void LEGACY_PLUGIN::loadGENERAL() if( !strcmp( data, "mm" ) ) { #if defined( USE_PCBNEW_NANOMETRES ) - diskToBiu = 1000000.0; + diskToBiu = IU_PER_MM; #elif defined(DEBUG) // mm to deci-mils: // advanced testing of round tripping only, not supported in non DEBUG build - diskToBiu = 10000/25.4; + diskToBiu = IU_PER_MM; #else THROW_IO_ERROR( _( "May not load millimeter *.brd file into 'Pcbnew compiled for deci-mils'" ) ); @@ -2718,8 +2718,8 @@ void LEGACY_PLUGIN::init( PROPERTIES* aProperties ) // then, during the file loading process, to start a conversion from // mm to nanometers. - diskToBiu = IU_PER_DECIMILS; // BIUs are nanometers if USE_PCBNEW_NANOMETRES - // or BIUs are deci-mils + diskToBiu = IU_PER_DECIMILS; // BIUs are nanometers if USE_PCBNEW_NANOMETRES + // or BIUs are deci-mils }