diff --git a/3d-viewer/3d_aux.cpp b/3d-viewer/3d_aux.cpp
index 591e36b5d9..0878053869 100644
--- a/3d-viewer/3d_aux.cpp
+++ b/3d-viewer/3d_aux.cpp
@@ -60,7 +60,7 @@ void S3D_MASTER::Set_Object_Coords( std::vector< S3D_VERTEX >& aVertices )
aVertices[ii].y *= m_MatScale.y;
aVertices[ii].z *= m_MatScale.z;
- // adjust rotation
+ // adjust rotation
if( m_MatRotation.x )
RotatePoint( &aVertices[ii].y, &aVertices[ii].z, m_MatRotation.x * 10 );
@@ -176,64 +176,39 @@ GLuint EDA_3D_CANVAS::DisplayCubeforTest()
return gllist;
}
-VERTEX_VALUE_CTRL::VERTEX_VALUE_CTRL( wxWindow* parent, const wxString& title,
- wxBoxSizer* BoxSizer )
+VERTEX_VALUE_CTRL::VERTEX_VALUE_CTRL( wxWindow* aParent, wxBoxSizer* aBoxSizer )
{
- wxString text;
- wxStaticText* msgtitle;
+ wxString text;
- if( title.IsEmpty() )
- text = _( "Vertex " );
- else
- text = title;
+ wxFlexGridSizer* gridSizer = new wxFlexGridSizer( 0, 2, 0, 0 );
+ gridSizer->AddGrowableCol( 1 );
+ gridSizer->SetFlexibleDirection( wxHORIZONTAL );
+ gridSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
- msgtitle = new wxStaticText( parent, -1, text, wxDefaultPosition, wxSize( -1, -1 ), 0 );
+ aBoxSizer->Add( gridSizer, 0, wxEXPAND, 5 );
- BoxSizer->Add( msgtitle, wxGROW | wxLEFT | wxRIGHT | wxTOP | wxBOTTOM );
+ wxStaticText* msgtitle = new wxStaticText( aParent, wxID_ANY, wxT( "X:" ) );
+ gridSizer->Add( msgtitle, 0, wxALL , 5 );
- wxFlexGridSizer* GridSizer = new wxFlexGridSizer( 3, 2, 0, 0 );
+ m_XValueCtrl = new wxTextCtrl( aParent, wxID_ANY, wxEmptyString,
+ wxDefaultPosition,wxDefaultSize, 0 );
+ gridSizer->Add( m_XValueCtrl, 0, wxALL|wxEXPAND, 5 );
- BoxSizer->Add( GridSizer, 0, wxGROW | wxALL, 5 );
+ msgtitle = new wxStaticText( aParent, wxID_ANY, wxT( "Y:" ), wxDefaultPosition,
+ wxDefaultSize, 0 );
+ gridSizer->Add( msgtitle, 0, wxALL, 5 );
- msgtitle = new wxStaticText( parent, -1, wxT( "X:" ) );
+ m_YValueCtrl = new wxTextCtrl( aParent, wxID_ANY, wxEmptyString,
+ wxDefaultPosition, wxDefaultSize, 0 );
+ gridSizer->Add( m_YValueCtrl, 0, wxALL|wxEXPAND, 5 );
- GridSizer->Add( msgtitle, 0,
- wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL |
- wxLEFT | wxRIGHT , 5 );
- m_XValueCtrl = new wxTextCtrl( parent, -1, wxEmptyString,
- wxDefaultPosition, wxSize( -1, -1 ), 0 );
+ msgtitle = new wxStaticText( aParent, wxID_ANY, wxT( "Z:" ), wxDefaultPosition,
+ wxDefaultSize, 0 );
+ gridSizer->Add( msgtitle, 0, wxALL, 5 );
- GridSizer->Add( m_XValueCtrl,
- 0,
- wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL |
- wxLEFT | wxRIGHT, 5 );
-
- msgtitle = new wxStaticText( parent, -1, wxT( "Y:" ), wxDefaultPosition,
- wxSize( -1, -1 ), 0 );
-
- GridSizer->Add( msgtitle,
- 0,
- wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL |
- wxLEFT | wxRIGHT, 5 );
- m_YValueCtrl = new wxTextCtrl( parent, -1, wxEmptyString,
- wxDefaultPosition, wxSize( -1, -1 ), 0 );
-
- GridSizer->Add( m_YValueCtrl, 0,
- wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL |
- wxLEFT | wxRIGHT, 5 );
-
- msgtitle = new wxStaticText( parent, -1, wxT( "Z:" ), wxDefaultPosition,
- wxSize( -1, -1 ), 0 );
-
- GridSizer->Add( msgtitle, 0,
- wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL |
- wxLEFT | wxRIGHT, 5 );
- m_ZValueCtrl = new wxTextCtrl( parent, -1, wxEmptyString,
- wxDefaultPosition, wxSize( -1, -1 ), 0 );
-
- GridSizer->Add( m_ZValueCtrl, 0,
- wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL |
- wxLEFT | wxRIGHT, 5 );
+ m_ZValueCtrl = new wxTextCtrl( aParent, wxID_ANY, wxEmptyString,
+ wxDefaultPosition, wxDefaultSize, 0 );
+ gridSizer->Add( m_ZValueCtrl, 0, wxALL|wxEXPAND, 5 );
}
diff --git a/3d-viewer/3d_struct.h b/3d-viewer/3d_struct.h
index 4c1d2be577..d73077a266 100644
--- a/3d-viewer/3d_struct.h
+++ b/3d-viewer/3d_struct.h
@@ -155,10 +155,9 @@ class VERTEX_VALUE_CTRL
{
private:
wxTextCtrl* m_XValueCtrl, * m_YValueCtrl, * m_ZValueCtrl;
- wxStaticText* m_Text;
public:
- VERTEX_VALUE_CTRL( wxWindow* parent, const wxString& title, wxBoxSizer* BoxSizer );
+ VERTEX_VALUE_CTRL( wxWindow* parent, wxBoxSizer* BoxSizer );
~VERTEX_VALUE_CTRL();
diff --git a/pagelayout_editor/pl_editor_doc.icns b/pagelayout_editor/pl_editor_doc.icns
new file mode 100644
index 0000000000..6760a09bb4
Binary files /dev/null and b/pagelayout_editor/pl_editor_doc.icns differ
diff --git a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp
index 5e0dbc7c13..0c38c9d0ac 100644
--- a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp
+++ b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor.cpp
@@ -308,19 +308,9 @@ void DIALOG_MODULE_BOARD_EDITOR::InitModeditProperties()
m_CostRot180Ctrl->SetValue( m_CurrentModule->GetPlacementCost180() );
// Initialize 3D parameters
-
- wxBoxSizer* BoxSizer = new wxBoxSizer( wxVERTICAL );
- m_3D_Scale = new VERTEX_VALUE_CTRL( m_Panel3D, _( "Shape Scale:" ), BoxSizer );
- m_Sizer3DValues->Add( BoxSizer, 0, wxGROW | wxALL, 5 );
-
- BoxSizer = new wxBoxSizer( wxVERTICAL );
- m_3D_Offset = new VERTEX_VALUE_CTRL( m_Panel3D, _( "Shape Offset (inch):" ), BoxSizer );
- m_Sizer3DValues->Add( BoxSizer, 0, wxGROW | wxALL, 5 );
-
- BoxSizer = new wxBoxSizer( wxVERTICAL );
- m_3D_Rotation = new VERTEX_VALUE_CTRL( m_Panel3D,
- _( "Shape Rotation (degrees):" ), BoxSizer );
- m_Sizer3DValues->Add( BoxSizer, 0, wxGROW | wxALL, 5 );
+ m_3D_Scale = new VERTEX_VALUE_CTRL( m_Panel3D, m_bSizerShapeScale );
+ m_3D_Offset = new VERTEX_VALUE_CTRL( m_Panel3D, m_bSizerShapeOffset );
+ m_3D_Rotation = new VERTEX_VALUE_CTRL( m_Panel3D, m_bSizerShapeRotation );
// if m_3D_ShapeNameListBox is not empty, preselect first 3D shape
if( m_3D_ShapeNameListBox->GetCount() > 0 )
diff --git a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.cpp b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.cpp
index 6505496345..c8b532004d 100644
--- a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.cpp
+++ b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.cpp
@@ -307,6 +307,33 @@ DIALOG_MODULE_BOARD_EDITOR_BASE::DIALOG_MODULE_BOARD_EDITOR_BASE( wxWindow* pare
m_Sizer3DValues = new wxStaticBoxSizer( new wxStaticBox( m_Panel3D, wxID_ANY, _("3D Scale and Position") ), wxVERTICAL );
+ m_bSizerShapeScale = new wxBoxSizer( wxVERTICAL );
+
+ m_staticTextShapeScale = new wxStaticText( m_Panel3D, wxID_ANY, _("Shape Scale:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextShapeScale->Wrap( -1 );
+ m_bSizerShapeScale->Add( m_staticTextShapeScale, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
+
+
+ m_Sizer3DValues->Add( m_bSizerShapeScale, 0, wxEXPAND, 5 );
+
+ m_bSizerShapeOffset = new wxBoxSizer( wxVERTICAL );
+
+ m_staticTextShapeOffset = new wxStaticText( m_Panel3D, wxID_ANY, _("Shape Offset (inch):"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextShapeOffset->Wrap( -1 );
+ m_bSizerShapeOffset->Add( m_staticTextShapeOffset, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
+
+
+ m_Sizer3DValues->Add( m_bSizerShapeOffset, 0, wxEXPAND, 5 );
+
+ m_bSizerShapeRotation = new wxBoxSizer( wxVERTICAL );
+
+ m_staticTextShapeRotation = new wxStaticText( m_Panel3D, wxID_ANY, _("Shape Rotation (degrees):"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextShapeRotation->Wrap( -1 );
+ m_bSizerShapeRotation->Add( m_staticTextShapeRotation, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
+
+
+ m_Sizer3DValues->Add( m_bSizerShapeRotation, 0, wxEXPAND, 5 );
+
bLowerSizer3D->Add( m_Sizer3DValues, 1, wxALL|wxEXPAND, 5 );
diff --git a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.fbp b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.fbp
index 0a57dcca75..9d1de2b965 100644
--- a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.fbp
+++ b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.fbp
@@ -4435,6 +4435,288 @@
wxVERTICAL
public
+
+
+ 5
+ wxEXPAND
+ 0
+
+
+ m_bSizerShapeOffset
+ wxVERTICAL
+ protected
+
+ 5
+ wxTOP|wxRIGHT|wxLEFT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Shape Offset (inch):
+
+ 0
+
+
+ 0
+
+ 1
+ m_staticTextShapeOffset
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxEXPAND
+ 0
+
+
+ m_bSizerShapeRotation
+ wxVERTICAL
+ protected
+
+ 5
+ wxTOP|wxRIGHT|wxLEFT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Shape Rotation (degrees):
+
+ 0
+
+
+ 0
+
+ 1
+ m_staticTextShapeRotation
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.h b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.h
index cb655d156a..79806831cc 100644
--- a/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.h
+++ b/pcbnew/dialogs/dialog_edit_module_for_BoardEditor_base.h
@@ -104,6 +104,12 @@ class DIALOG_MODULE_BOARD_EDITOR_BASE : public DIALOG_SHIM
wxPanel* m_Panel3D;
wxStaticText* m_staticText3Dname;
wxListBox* m_3D_ShapeNameListBox;
+ wxBoxSizer* m_bSizerShapeScale;
+ wxStaticText* m_staticTextShapeScale;
+ wxBoxSizer* m_bSizerShapeOffset;
+ wxStaticText* m_staticTextShapeOffset;
+ wxBoxSizer* m_bSizerShapeRotation;
+ wxStaticText* m_staticTextShapeRotation;
wxButton* m_buttonBrowse;
wxButton* m_buttonAdd;
wxButton* m_buttonRemove;
diff --git a/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp b/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp
index 1268a15f04..f69176f329 100644
--- a/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp
+++ b/pcbnew/dialogs/dialog_edit_module_for_Modedit.cpp
@@ -151,18 +151,9 @@ void DIALOG_MODULE_MODULE_EDITOR::initModeditProperties()
m_CostRot180Ctrl->SetValue( m_currentModule->GetPlacementCost180() );
// Initialize 3D parameters
-
- wxBoxSizer* BoxSizer = new wxBoxSizer( wxVERTICAL );
- m_3D_Scale = new VERTEX_VALUE_CTRL( m_Panel3D, _( "Shape Scale:" ), BoxSizer );
- m_Sizer3DValues->Add( BoxSizer, 0, wxGROW | wxALL, 5 );
-
- BoxSizer = new wxBoxSizer( wxVERTICAL );
- m_3D_Offset = new VERTEX_VALUE_CTRL( m_Panel3D, _( "Shape Offset (inch):" ), BoxSizer );
- m_Sizer3DValues->Add( BoxSizer, 0, wxGROW | wxALL, 5 );
-
- BoxSizer = new wxBoxSizer( wxVERTICAL );
- m_3D_Rotation = new VERTEX_VALUE_CTRL( m_Panel3D, _( "Shape Rotation (degrees):" ), BoxSizer );
- m_Sizer3DValues->Add( BoxSizer, 0, wxGROW | wxALL, 5 );
+ m_3D_Scale = new VERTEX_VALUE_CTRL( m_Panel3D, m_bSizerShapeScale );
+ m_3D_Offset = new VERTEX_VALUE_CTRL( m_Panel3D, m_bSizerShapeOffset );
+ m_3D_Rotation = new VERTEX_VALUE_CTRL( m_Panel3D, m_bSizerShapeRotation );
// Initialize dialog relative to masks clearances
m_NetClearanceUnits->SetLabel( GetAbbreviatedUnitsLabel( g_UserUnit ) );
diff --git a/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.cpp b/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.cpp
index 1cf349199e..fd62e5b8da 100644
--- a/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.cpp
+++ b/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.cpp
@@ -250,6 +250,33 @@ DIALOG_MODULE_MODULE_EDITOR_BASE::DIALOG_MODULE_MODULE_EDITOR_BASE( wxWindow* pa
m_Sizer3DValues = new wxStaticBoxSizer( new wxStaticBox( m_Panel3D, wxID_ANY, _("3D Scale and Position") ), wxVERTICAL );
+ m_bSizerShapeScale = new wxBoxSizer( wxVERTICAL );
+
+ m_staticTextShapeScale = new wxStaticText( m_Panel3D, wxID_ANY, _("Shape Scale:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextShapeScale->Wrap( -1 );
+ m_bSizerShapeScale->Add( m_staticTextShapeScale, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
+
+
+ m_Sizer3DValues->Add( m_bSizerShapeScale, 0, wxEXPAND, 5 );
+
+ m_bSizerShapeOffset = new wxBoxSizer( wxVERTICAL );
+
+ m_staticTextShapeOffset = new wxStaticText( m_Panel3D, wxID_ANY, _("Shape Offset (inch):"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextShapeOffset->Wrap( -1 );
+ m_bSizerShapeOffset->Add( m_staticTextShapeOffset, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
+
+
+ m_Sizer3DValues->Add( m_bSizerShapeOffset, 0, wxEXPAND, 5 );
+
+ m_bSizerShapeRotation = new wxBoxSizer( wxVERTICAL );
+
+ m_staticTextShapeRotation = new wxStaticText( m_Panel3D, wxID_ANY, _("Shape Rotation (degrees):"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextShapeRotation->Wrap( -1 );
+ m_bSizerShapeRotation->Add( m_staticTextShapeRotation, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
+
+
+ m_Sizer3DValues->Add( m_bSizerShapeRotation, 0, wxEXPAND, 5 );
+
bLowerSizer3D->Add( m_Sizer3DValues, 1, wxEXPAND, 5 );
diff --git a/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.fbp b/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.fbp
index db0759a5fd..aa3c448b54 100644
--- a/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.fbp
+++ b/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.fbp
@@ -3640,8 +3640,290 @@
m_Sizer3DValues
wxVERTICAL
- public
+ protected
+
+ 5
+ wxEXPAND
+ 0
+
+
+ m_bSizerShapeScale
+ wxVERTICAL
+ protected
+
+ 5
+ wxTOP|wxRIGHT|wxLEFT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Shape Scale:
+
+ 0
+
+
+ 0
+
+ 1
+ m_staticTextShapeScale
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxEXPAND
+ 0
+
+
+ m_bSizerShapeOffset
+ wxVERTICAL
+ protected
+
+ 5
+ wxTOP|wxRIGHT|wxLEFT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Shape Offset (inch):
+
+ 0
+
+
+ 0
+
+ 1
+ m_staticTextShapeOffset
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+ wxEXPAND
+ 0
+
+
+ m_bSizerShapeRotation
+ wxVERTICAL
+ protected
+
+ 5
+ wxTOP|wxRIGHT|wxLEFT
+ 0
+
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
+ 1
+ 0
+ 1
+
+ 1
+ 0
+ Dock
+ 0
+ Left
+ 1
+
+ 1
+
+ 0
+ 0
+ wxID_ANY
+ Shape Rotation (degrees):
+
+ 0
+
+
+ 0
+
+ 1
+ m_staticTextShapeRotation
+ 1
+
+
+ protected
+ 1
+
+ Resizable
+ 1
+
+
+
+ 0
+
+
+
+
+ -1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.h b/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.h
index 02ed724b28..9491f0b965 100644
--- a/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.h
+++ b/pcbnew/dialogs/dialog_edit_module_for_Modedit_base.h
@@ -90,6 +90,13 @@ class DIALOG_MODULE_MODULE_EDITOR_BASE : public DIALOG_SHIM
wxPanel* m_Panel3D;
wxStaticText* m_staticText3Dname;
wxListBox* m_3D_ShapeNameListBox;
+ wxStaticBoxSizer* m_Sizer3DValues;
+ wxBoxSizer* m_bSizerShapeScale;
+ wxStaticText* m_staticTextShapeScale;
+ wxBoxSizer* m_bSizerShapeOffset;
+ wxStaticText* m_staticTextShapeOffset;
+ wxBoxSizer* m_bSizerShapeRotation;
+ wxStaticText* m_staticTextShapeRotation;
wxButton* m_buttonBrowse;
wxButton* m_buttonRemove;
wxStdDialogButtonSizer* m_sdbSizerStdButtons;
@@ -107,7 +114,6 @@ class DIALOG_MODULE_MODULE_EDITOR_BASE : public DIALOG_SHIM
public:
- wxStaticBoxSizer* m_Sizer3DValues;
DIALOG_MODULE_MODULE_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Module Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 486,462 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_MODULE_MODULE_EDITOR_BASE();
diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp
index 2897af7bb3..eab18aa97f 100644
--- a/pcbnew/plot_board_layers.cpp
+++ b/pcbnew/plot_board_layers.cpp
@@ -591,8 +591,11 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter,
// Deflate: remove the extra margin, to create the actual shapes
// Here I am using polygon:resize, because this function creates better shapes
// than deflate algo.
- // Use here deflate with arc creation and 16 segments per circle to create arcs
- areas = resize( areas, -inflate , true, 16 );
+ // Use here deflate with arc creation and 18 segments per circle to create arcs
+ // In boost polygon (at least v 1.54 and previous) in very rare cases resize crashes
+ // with 16 segments (perhaps related to 45 degrees pads). So using 18 segments
+ // is a workaround to try to avoid these crashes
+ areas = resize( areas, -inflate , true, 18 );
// Resize slightly changes shapes. So *ensure* initial shapes are kept
areas |= initialAreas;