From 418c8592aa26400e2e6bffc150f04d11c59cb891 Mon Sep 17 00:00:00 2001
From: Alex Shvartzkop <dudesuchamazing@gmail.com>
Date: Fri, 20 Dec 2024 23:28:36 +0300
Subject: [PATCH] Allow to control via hole cutting in board body/copper.

- "Fill all vias" option disables the cut in copper layers which is
  important to speed up EM simulations.
- "Cut vias in board body" enables cutting even if copper layer export
  is disabled, which is useful if you're using vias as mounting holes.

Related: https://gitlab.com/kicad/code/kicad/-/issues/18735
---
 common/jobs/job_export_pcb_3d.cpp          |   4 +
 common/jobs/job_export_pcb_3d.h            |   4 +
 kicad/cli/command_pcb_export_3d.cpp        |  13 +
 pcbnew/dialogs/dialog_export_step.cpp      |  18 +
 pcbnew/dialogs/dialog_export_step.h        |   2 +
 pcbnew/dialogs/dialog_export_step_base.cpp |  36 +-
 pcbnew/dialogs/dialog_export_step_base.fbp | 386 ++++++++++++++-------
 pcbnew/dialogs/dialog_export_step_base.h   |   6 +-
 pcbnew/exporters/step/exporter_step.cpp    |  49 +--
 pcbnew/exporters/step/step_pcb_model.cpp   |  36 +-
 pcbnew/exporters/step/step_pcb_model.h     |   4 +-
 11 files changed, 378 insertions(+), 180 deletions(-)

diff --git a/common/jobs/job_export_pcb_3d.cpp b/common/jobs/job_export_pcb_3d.cpp
index 1efc57fd54..149c9c9b3d 100644
--- a/common/jobs/job_export_pcb_3d.cpp
+++ b/common/jobs/job_export_pcb_3d.cpp
@@ -107,6 +107,8 @@ JOB_EXPORT_PCB_3D::JOB_EXPORT_PCB_3D() :
     m_params.emplace_back( new JOB_PARAM<double>( "board_outlines_chaining_epsilon",
                                                   &m_3dparams.m_BoardOutlinesChainingEpsilon,
                                                   m_3dparams.m_BoardOutlinesChainingEpsilon ) );
+    m_params.emplace_back( new JOB_PARAM<bool>( "cut_vias_in_body", &m_3dparams.m_CutViasInBody,
+                                                m_3dparams.m_CutViasInBody ) );
     m_params.emplace_back( new JOB_PARAM<bool>( "export_board_body", &m_3dparams.m_ExportBoardBody,
                                                 m_3dparams.m_ExportBoardBody ) );
     m_params.emplace_back( new JOB_PARAM<bool>( "export_components", &m_3dparams.m_ExportComponents,
@@ -126,6 +128,8 @@ JOB_EXPORT_PCB_3D::JOB_EXPORT_PCB_3D() :
                                                 m_3dparams.m_ExportSoldermask ) );
     m_params.emplace_back( new JOB_PARAM<bool>( "fuse_shapes", &m_3dparams.m_FuseShapes,
                                                 m_3dparams.m_FuseShapes ) );
+    m_params.emplace_back( new JOB_PARAM<bool>( "fill_all_vias", &m_3dparams.m_FillAllVias,
+                                                m_3dparams.m_FillAllVias ) );
     m_params.emplace_back( new JOB_PARAM<wxString>( "vrml_model_dir", &m_vrmlModelDir, m_vrmlModelDir ) );
     m_params.emplace_back( new JOB_PARAM<bool>( "vrml_relative_paths", &m_vrmlRelativePaths,
                                                 m_vrmlRelativePaths ) );
diff --git a/common/jobs/job_export_pcb_3d.h b/common/jobs/job_export_pcb_3d.h
index 29196eafd9..35d06b2299 100644
--- a/common/jobs/job_export_pcb_3d.h
+++ b/common/jobs/job_export_pcb_3d.h
@@ -43,6 +43,7 @@ public:
             m_SubstModels( true ),
             m_BoardOutlinesChainingEpsilon( BOARD_DEFAULT_CHAINING_EPSILON ),
             m_BoardOnly( false ),
+            m_CutViasInBody( false ),
             m_ExportBoardBody( true ),
             m_ExportComponents( true ),
             m_ExportTracksVias( false ),
@@ -52,6 +53,7 @@ public:
             m_ExportSilkscreen( false ),
             m_ExportSoldermask( false ),
             m_FuseShapes( false ),
+            m_FillAllVias( false ),
             m_OptimizeStep( true ),
             m_Format( FORMAT::STEP ),
             m_OutputFile()
@@ -80,6 +82,7 @@ public:
     bool     m_SubstModels;
     double   m_BoardOutlinesChainingEpsilon;
     bool     m_BoardOnly;
+    bool     m_CutViasInBody;
     bool     m_ExportBoardBody;
     bool     m_ExportComponents;
     bool     m_ExportTracksVias;
@@ -89,6 +92,7 @@ public:
     bool     m_ExportSilkscreen;
     bool     m_ExportSoldermask;
     bool     m_FuseShapes;
+    bool     m_FillAllVias;
     bool     m_OptimizeStep;
     FORMAT   m_Format;
     wxString m_OutputFile;
diff --git a/kicad/cli/command_pcb_export_3d.cpp b/kicad/cli/command_pcb_export_3d.cpp
index 529a62fbb4..7493b623c2 100644
--- a/kicad/cli/command_pcb_export_3d.cpp
+++ b/kicad/cli/command_pcb_export_3d.cpp
@@ -38,6 +38,7 @@
 #define ARG_MIN_DISTANCE "--min-distance"
 #define ARG_USER_ORIGIN "--user-origin"
 #define ARG_BOARD_ONLY "--board-only"
+#define ARG_CUT_VIAS_IN_BODY "--cut-vias-in-body"
 #define ARG_NO_BOARD_BODY "--no-board-body"
 #define ARG_NO_COMPONENTS "--no-components"
 #define ARG_INCLUDE_TRACKS "--include-tracks"
@@ -47,6 +48,7 @@
 #define ARG_INCLUDE_SILKSCREEN "--include-silkscreen"
 #define ARG_INCLUDE_SOLDERMASK "--include-soldermask"
 #define ARG_FUSE_SHAPES "--fuse-shapes"
+#define ARG_FILL_ALL_VIAS "--fill-all-vias"
 #define ARG_NO_OPTIMIZE_STEP "--no-optimize-step"
 #define ARG_NET_FILTER "--net-filter"
 #define ARG_FORMAT "--format"
@@ -112,6 +114,11 @@ CLI::PCB_EXPORT_3D_COMMAND::PCB_EXPORT_3D_COMMAND( const std::string&        aNa
                 .help( UTF8STDSTR( _( "Only generate a board with no components" ) ) )
                 .flag();
 
+        m_argParser.add_argument( ARG_CUT_VIAS_IN_BODY )
+                .help( UTF8STDSTR( _( "Cut via holes in board body even if conductor layers are "
+                                      "not exported." ) ) )
+                .flag();
+
         m_argParser.add_argument( ARG_NO_BOARD_BODY )
                 .help( UTF8STDSTR( _( "Exclude board body" ) ) )
                 .flag();
@@ -154,6 +161,10 @@ CLI::PCB_EXPORT_3D_COMMAND::PCB_EXPORT_3D_COMMAND( const std::string&        aNa
                 .help( UTF8STDSTR( _( "Fuse overlapping geometry together" ) ) )
                 .flag();
 
+        m_argParser.add_argument( ARG_FILL_ALL_VIAS )
+                .help( UTF8STDSTR( _( "Don't cut via holes in copper layers." ) ) )
+                .flag();
+
         m_argParser.add_argument( ARG_MIN_DISTANCE )
                 .default_value( std::string( "0.01mm" ) )
                 .help( UTF8STDSTR(
@@ -210,6 +221,7 @@ int CLI::PCB_EXPORT_3D_COMMAND::doPerform( KIWAY& aKiway )
         params.m_UseDrillOrigin = m_argParser.get<bool>( ARG_DRILL_ORIGIN );
         params.m_UseGridOrigin = m_argParser.get<bool>( ARG_GRID_ORIGIN );
         params.m_SubstModels = m_argParser.get<bool>( ARG_SUBST_MODELS );
+        params.m_CutViasInBody = m_argParser.get<bool>( ARG_CUT_VIAS_IN_BODY );
         params.m_ExportBoardBody = !m_argParser.get<bool>( ARG_NO_BOARD_BODY );
         params.m_ExportComponents = !m_argParser.get<bool>( ARG_NO_COMPONENTS );
         params.m_ExportTracksVias = m_argParser.get<bool>( ARG_INCLUDE_TRACKS );
@@ -219,6 +231,7 @@ int CLI::PCB_EXPORT_3D_COMMAND::doPerform( KIWAY& aKiway )
         params.m_ExportSilkscreen = m_argParser.get<bool>( ARG_INCLUDE_SILKSCREEN );
         params.m_ExportSoldermask = m_argParser.get<bool>( ARG_INCLUDE_SOLDERMASK );
         params.m_FuseShapes = m_argParser.get<bool>( ARG_FUSE_SHAPES );
+        params.m_FillAllVias = m_argParser.get<bool>( ARG_FILL_ALL_VIAS );
         params.m_BoardOnly = m_argParser.get<bool>( ARG_BOARD_ONLY );
         params.m_NetFilter = From_UTF8( m_argParser.get<std::string>( ARG_NET_FILTER ).c_str() );
         params.m_ComponentFilter =
diff --git a/pcbnew/dialogs/dialog_export_step.cpp b/pcbnew/dialogs/dialog_export_step.cpp
index 1c5d787ac9..9b67f92039 100644
--- a/pcbnew/dialogs/dialog_export_step.cpp
+++ b/pcbnew/dialogs/dialog_export_step.cpp
@@ -83,6 +83,8 @@ bool DIALOG_EXPORT_STEP::m_exportInnerCopper = false;
 bool DIALOG_EXPORT_STEP::m_exportSilkscreen = false;
 bool DIALOG_EXPORT_STEP::m_exportSoldermask = false;
 bool DIALOG_EXPORT_STEP::m_fuseShapes = false;
+bool DIALOG_EXPORT_STEP::m_fillAllVias = false;
+bool DIALOG_EXPORT_STEP::m_cutViasInBody = false;
 DIALOG_EXPORT_STEP::COMPONENT_MODE DIALOG_EXPORT_STEP::m_componentMode = COMPONENT_MODE::EXPORT_ALL;
 wxString DIALOG_EXPORT_STEP::m_componentFilter;
 
@@ -164,6 +166,8 @@ DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP( PCB_EDIT_FRAME* aEditFrame, wxWindow* aP
         m_cbExportSilkscreen->SetValue( m_exportSilkscreen );
         m_cbExportSoldermask->SetValue( m_exportSoldermask );
         m_cbFuseShapes->SetValue( m_fuseShapes );
+        m_cbCutViasInBody->SetValue( m_cutViasInBody );
+        m_cbFillAllVias->SetValue( m_fillAllVias );
         m_cbRemoveUnspecified->SetValue( m_noUnspecified );
         m_cbRemoveDNP->SetValue( m_noDNP );
         m_cbSubstModels->SetValue( cfg->m_ExportStep.replace_models );
@@ -218,6 +222,8 @@ DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP( PCB_EDIT_FRAME* aEditFrame, wxWindow* aP
         m_cbExportSilkscreen->SetValue( m_job->m_3dparams.m_ExportSilkscreen );
         m_cbExportSoldermask->SetValue( m_job->m_3dparams.m_ExportSoldermask );
         m_cbFuseShapes->SetValue( m_job->m_3dparams.m_FuseShapes );
+        m_cbCutViasInBody->SetValue( m_job->m_3dparams.m_CutViasInBody );
+        m_cbFillAllVias->SetValue( m_job->m_3dparams.m_FillAllVias );
         m_cbRemoveUnspecified->SetValue( !m_job->m_3dparams.m_IncludeUnspecified );
         m_cbRemoveDNP->SetValue( !m_job->m_3dparams.m_IncludeDNP );
         m_cbSubstModels->SetValue( m_job->m_3dparams.m_SubstModels );
@@ -336,6 +342,8 @@ DIALOG_EXPORT_STEP::~DIALOG_EXPORT_STEP()
     m_exportSilkscreen = m_cbExportSilkscreen->GetValue();
     m_exportSoldermask = m_cbExportSoldermask->GetValue();
     m_fuseShapes = m_cbFuseShapes->GetValue();
+    m_cutViasInBody = m_cbCutViasInBody->GetValue();
+    m_fillAllVias = m_cbFillAllVias->GetValue();
     m_componentFilter = m_txtComponentFilter->GetValue();
 
     if( m_rbAllComponents->GetValue() )
@@ -546,6 +554,8 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
         m_exportSilkscreen = m_cbExportSilkscreen->GetValue();
         m_exportSoldermask = m_cbExportSoldermask->GetValue();
         m_fuseShapes = m_cbFuseShapes->GetValue();
+        m_cutViasInBody = m_cbCutViasInBody->GetValue();
+        m_fillAllVias = m_cbFillAllVias->GetValue();
 
         switch( m_choiceTolerance->GetSelection() )
         {
@@ -656,6 +666,12 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
         if( m_fuseShapes )
             cmdK2S.Append( wxT( " --fuse-shapes" ) );
 
+        if( m_cutViasInBody )
+            cmdK2S.Append( wxT( " --cut-vias-in-body" ) );
+
+        if( m_fillAllVias )
+            cmdK2S.Append( wxT( " --fill-all-vias" ) );
+
         // Note: for some reason, using \" to insert a quote in a format string, under MacOS
         // wxString::Format does not work. So use a %c format in string
         int quote = '\'';
@@ -773,6 +789,8 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
         m_job->m_3dparams.m_ExportSilkscreen = m_cbExportSilkscreen->GetValue();
         m_job->m_3dparams.m_ExportSoldermask = m_cbExportSoldermask->GetValue();
         m_job->m_3dparams.m_FuseShapes = m_cbFuseShapes->GetValue();
+        m_job->m_3dparams.m_CutViasInBody = m_cbCutViasInBody->GetValue();
+        m_job->m_3dparams.m_FillAllVias = m_cbFillAllVias->GetValue();
         m_job->m_3dparams.m_OptimizeStep = m_cbOptimizeStep->GetValue();
         m_job->m_3dparams.m_Format = static_cast<EXPORTER_STEP_PARAMS::FORMAT>( m_choiceFormat->GetSelection() );
         m_job->m_3dparams.m_Overwrite = m_cbOverwriteFile->GetValue();
diff --git a/pcbnew/dialogs/dialog_export_step.h b/pcbnew/dialogs/dialog_export_step.h
index 290414cc53..9620032aa8 100644
--- a/pcbnew/dialogs/dialog_export_step.h
+++ b/pcbnew/dialogs/dialog_export_step.h
@@ -116,6 +116,8 @@ private:
     static bool        m_exportSilkscreen;  // remember last preference to export silkscreen (stored only for the session)
     static bool        m_exportSoldermask;  // remember last preference to export soldermask (stored only for the session)
     static bool        m_fuseShapes;     // remember last preference to fuse shapes (stored only for the session)
+    static bool        m_fillAllVias;    // remember last preference to fill all vias (stored only for the session)
+    static bool        m_cutViasInBody;  // remember last preference to cut via holes in body (stored only for the session)
     wxString           m_netFilter;      // filter copper nets
     static wxString    m_componentFilter; // filter component reference designators
     static COMPONENT_MODE m_componentMode;
diff --git a/pcbnew/dialogs/dialog_export_step_base.cpp b/pcbnew/dialogs/dialog_export_step_base.cpp
index 5913a073d0..ab1b05ad5b 100644
--- a/pcbnew/dialogs/dialog_export_step_base.cpp
+++ b/pcbnew/dialogs/dialog_export_step_base.cpp
@@ -64,10 +64,15 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
 	m_cbExportBody = new wxCheckBox( sbBoardOptions->GetStaticBox(), wxID_ANY, _("Export board body"), wxDefaultPosition, wxDefaultSize, 0 );
 	sbBoardOptions->Add( m_cbExportBody, 0, wxALL, 5 );
 
+	m_cbCutViasInBody = new wxCheckBox( sbBoardOptions->GetStaticBox(), wxID_ANY, _("Cut vias in board body"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_cbCutViasInBody->SetToolTip( _("Cut via holes in board body even if conductor layers are not exported.") );
+
+	sbBoardOptions->Add( m_cbCutViasInBody, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
+
 	m_cbExportSilkscreen = new wxCheckBox( sbBoardOptions->GetStaticBox(), wxID_ANY, _("Export silkscreen"), wxDefaultPosition, wxDefaultSize, 0 );
 	m_cbExportSilkscreen->SetToolTip( _("Export silkscreen graphics as a set of flat faces.") );
 
-	sbBoardOptions->Add( m_cbExportSilkscreen, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
+	sbBoardOptions->Add( m_cbExportSilkscreen, 0, wxALL, 5 );
 
 	m_cbExportSoldermask = new wxCheckBox( sbBoardOptions->GetStaticBox(), wxID_ANY, _("Export solder mask"), wxDefaultPosition, wxDefaultSize, 0 );
 	m_cbExportSoldermask->SetToolTip( _("Export solder mask layers as a set of flat faces.") );
@@ -107,18 +112,6 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
 
 	sbBoardOptions->Add( bSizer51, 1, wxEXPAND|wxLEFT, 20 );
 
-	m_staticTextTolerance = new wxStaticText( sbBoardOptions->GetStaticBox(), wxID_ANY, _("Board outline chaining tolerance:"), wxDefaultPosition, wxDefaultSize, 0 );
-	m_staticTextTolerance->Wrap( -1 );
-	sbBoardOptions->Add( m_staticTextTolerance, 0, wxRIGHT|wxLEFT, 5 );
-
-	wxString m_choiceToleranceChoices[] = { _("Tight (0.001 mm)"), _("Standard (0.01 mm)"), _("Loose (0.1 mm)") };
-	int m_choiceToleranceNChoices = sizeof( m_choiceToleranceChoices ) / sizeof( wxString );
-	m_choiceTolerance = new wxChoice( sbBoardOptions->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceToleranceNChoices, m_choiceToleranceChoices, 0 );
-	m_choiceTolerance->SetSelection( 0 );
-	m_choiceTolerance->SetToolTip( _("Tolerance sets the distance between two points that are considered joined when building the board outlines.") );
-
-	sbBoardOptions->Add( m_choiceTolerance, 0, wxALL|wxEXPAND, 5 );
-
 
 	bSizer8->Add( sbBoardOptions, 0, wxEXPAND|wxALL, 5 );
 
@@ -146,6 +139,11 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
 
 	sbConductorOptions->Add( m_cbFuseShapes, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
 
+	m_cbFillAllVias = new wxCheckBox( sbConductorOptions->GetStaticBox(), wxID_ANY, _("Fill all vias"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_cbFillAllVias->SetToolTip( _("Don't cut via holes in copper layers.") );
+
+	sbConductorOptions->Add( m_cbFillAllVias, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
+
 	m_staticTextNetFilter = new wxStaticText( sbConductorOptions->GetStaticBox(), wxID_ANY, _("Net filter (supports wildcards):"), wxDefaultPosition, wxDefaultSize, 0 );
 	m_staticTextNetFilter->Wrap( -1 );
 	sbConductorOptions->Add( m_staticTextNetFilter, 0, wxLEFT|wxRIGHT|wxTOP, 5 );
@@ -262,6 +260,18 @@ DIALOG_EXPORT_STEP_BASE::DIALOG_EXPORT_STEP_BASE( wxWindow* parent, wxWindowID i
 
 	sbOtherOptions->Add( m_cbOptimizeStep, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
 
+	m_staticTextTolerance = new wxStaticText( sbOtherOptions->GetStaticBox(), wxID_ANY, _("Board outline chaining tolerance:"), wxDefaultPosition, wxDefaultSize, 0 );
+	m_staticTextTolerance->Wrap( -1 );
+	sbOtherOptions->Add( m_staticTextTolerance, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
+
+	wxString m_choiceToleranceChoices[] = { _("Tight (0.001 mm)"), _("Standard (0.01 mm)"), _("Loose (0.1 mm)") };
+	int m_choiceToleranceNChoices = sizeof( m_choiceToleranceChoices ) / sizeof( wxString );
+	m_choiceTolerance = new wxChoice( sbOtherOptions->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceToleranceNChoices, m_choiceToleranceChoices, 0 );
+	m_choiceTolerance->SetSelection( 0 );
+	m_choiceTolerance->SetToolTip( _("Tolerance sets the distance between two points that are considered joined when building the board outlines.") );
+
+	sbOtherOptions->Add( m_choiceTolerance, 0, wxALL|wxEXPAND, 5 );
+
 
 	bSizer5->Add( sbOtherOptions, 1, wxEXPAND|wxALL, 5 );
 
diff --git a/pcbnew/dialogs/dialog_export_step_base.fbp b/pcbnew/dialogs/dialog_export_step_base.fbp
index 6a88d35cad..bc3af9816c 100644
--- a/pcbnew/dialogs/dialog_export_step_base.fbp
+++ b/pcbnew/dialogs/dialog_export_step_base.fbp
@@ -565,10 +565,75 @@
                         <property name="window_style"></property>
                       </object>
                     </object>
-                    <object class="sizeritem" expanded="false">
+                    <object class="sizeritem" expanded="true">
                       <property name="border">5</property>
                       <property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
                       <property name="proportion">0</property>
+                      <object class="wxCheckBox" expanded="true">
+                        <property name="BottomDockable">1</property>
+                        <property name="LeftDockable">1</property>
+                        <property name="RightDockable">1</property>
+                        <property name="TopDockable">1</property>
+                        <property name="aui_layer">0</property>
+                        <property name="aui_name"></property>
+                        <property name="aui_position">0</property>
+                        <property name="aui_row">0</property>
+                        <property name="best_size"></property>
+                        <property name="bg"></property>
+                        <property name="caption"></property>
+                        <property name="caption_visible">1</property>
+                        <property name="center_pane">0</property>
+                        <property name="checked">0</property>
+                        <property name="close_button">1</property>
+                        <property name="context_help"></property>
+                        <property name="context_menu">1</property>
+                        <property name="default_pane">0</property>
+                        <property name="dock">Dock</property>
+                        <property name="dock_fixed">0</property>
+                        <property name="docking">Left</property>
+                        <property name="drag_accept_files">0</property>
+                        <property name="enabled">1</property>
+                        <property name="fg"></property>
+                        <property name="floatable">1</property>
+                        <property name="font"></property>
+                        <property name="gripper">0</property>
+                        <property name="hidden">0</property>
+                        <property name="id">wxID_ANY</property>
+                        <property name="label">Cut vias in board body</property>
+                        <property name="max_size"></property>
+                        <property name="maximize_button">0</property>
+                        <property name="maximum_size"></property>
+                        <property name="min_size"></property>
+                        <property name="minimize_button">0</property>
+                        <property name="minimum_size"></property>
+                        <property name="moveable">1</property>
+                        <property name="name">m_cbCutViasInBody</property>
+                        <property name="pane_border">1</property>
+                        <property name="pane_position"></property>
+                        <property name="pane_size"></property>
+                        <property name="permission">protected</property>
+                        <property name="pin_button">1</property>
+                        <property name="pos"></property>
+                        <property name="resize">Resizable</property>
+                        <property name="show">1</property>
+                        <property name="size"></property>
+                        <property name="style"></property>
+                        <property name="subclass">; ; forward_declare</property>
+                        <property name="toolbar_pane">0</property>
+                        <property name="tooltip">Cut via holes in board body even if conductor layers are not exported.</property>
+                        <property name="validator_data_type"></property>
+                        <property name="validator_style">wxFILTER_NONE</property>
+                        <property name="validator_type">wxDefaultValidator</property>
+                        <property name="validator_variable"></property>
+                        <property name="window_extra_style"></property>
+                        <property name="window_name"></property>
+                        <property name="window_style"></property>
+                      </object>
+                    </object>
+                    <object class="sizeritem" expanded="false">
+                      <property name="border">5</property>
+                      <property name="flag">wxALL</property>
+                      <property name="proportion">0</property>
                       <object class="wxCheckBox" expanded="false">
                         <property name="BottomDockable">1</property>
                         <property name="LeftDockable">1</property>
@@ -1100,133 +1165,6 @@
                         </object>
                       </object>
                     </object>
-                    <object class="sizeritem" expanded="false">
-                      <property name="border">5</property>
-                      <property name="flag">wxRIGHT|wxLEFT</property>
-                      <property name="proportion">0</property>
-                      <object class="wxStaticText" expanded="false">
-                        <property name="BottomDockable">1</property>
-                        <property name="LeftDockable">1</property>
-                        <property name="RightDockable">1</property>
-                        <property name="TopDockable">1</property>
-                        <property name="aui_layer">0</property>
-                        <property name="aui_name"></property>
-                        <property name="aui_position">0</property>
-                        <property name="aui_row">0</property>
-                        <property name="best_size"></property>
-                        <property name="bg"></property>
-                        <property name="caption"></property>
-                        <property name="caption_visible">1</property>
-                        <property name="center_pane">0</property>
-                        <property name="close_button">1</property>
-                        <property name="context_help"></property>
-                        <property name="context_menu">1</property>
-                        <property name="default_pane">0</property>
-                        <property name="dock">Dock</property>
-                        <property name="dock_fixed">0</property>
-                        <property name="docking">Left</property>
-                        <property name="drag_accept_files">0</property>
-                        <property name="enabled">1</property>
-                        <property name="fg"></property>
-                        <property name="floatable">1</property>
-                        <property name="font"></property>
-                        <property name="gripper">0</property>
-                        <property name="hidden">0</property>
-                        <property name="id">wxID_ANY</property>
-                        <property name="label">Board outline chaining tolerance:</property>
-                        <property name="markup">0</property>
-                        <property name="max_size"></property>
-                        <property name="maximize_button">0</property>
-                        <property name="maximum_size"></property>
-                        <property name="min_size"></property>
-                        <property name="minimize_button">0</property>
-                        <property name="minimum_size"></property>
-                        <property name="moveable">1</property>
-                        <property name="name">m_staticTextTolerance</property>
-                        <property name="pane_border">1</property>
-                        <property name="pane_position"></property>
-                        <property name="pane_size"></property>
-                        <property name="permission">protected</property>
-                        <property name="pin_button">1</property>
-                        <property name="pos"></property>
-                        <property name="resize">Resizable</property>
-                        <property name="show">1</property>
-                        <property name="size"></property>
-                        <property name="style"></property>
-                        <property name="subclass">; ; forward_declare</property>
-                        <property name="toolbar_pane">0</property>
-                        <property name="tooltip"></property>
-                        <property name="window_extra_style"></property>
-                        <property name="window_name"></property>
-                        <property name="window_style"></property>
-                        <property name="wrap">-1</property>
-                      </object>
-                    </object>
-                    <object class="sizeritem" expanded="false">
-                      <property name="border">5</property>
-                      <property name="flag">wxALL|wxEXPAND</property>
-                      <property name="proportion">0</property>
-                      <object class="wxChoice" expanded="false">
-                        <property name="BottomDockable">1</property>
-                        <property name="LeftDockable">1</property>
-                        <property name="RightDockable">1</property>
-                        <property name="TopDockable">1</property>
-                        <property name="aui_layer">0</property>
-                        <property name="aui_name"></property>
-                        <property name="aui_position">0</property>
-                        <property name="aui_row">0</property>
-                        <property name="best_size"></property>
-                        <property name="bg"></property>
-                        <property name="caption"></property>
-                        <property name="caption_visible">1</property>
-                        <property name="center_pane">0</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="context_help"></property>
-                        <property name="context_menu">1</property>
-                        <property name="default_pane">0</property>
-                        <property name="dock">Dock</property>
-                        <property name="dock_fixed">0</property>
-                        <property name="docking">Left</property>
-                        <property name="drag_accept_files">0</property>
-                        <property name="enabled">1</property>
-                        <property name="fg"></property>
-                        <property name="floatable">1</property>
-                        <property name="font"></property>
-                        <property name="gripper">0</property>
-                        <property name="hidden">0</property>
-                        <property name="id">wxID_ANY</property>
-                        <property name="max_size"></property>
-                        <property name="maximize_button">0</property>
-                        <property name="maximum_size"></property>
-                        <property name="min_size"></property>
-                        <property name="minimize_button">0</property>
-                        <property name="minimum_size"></property>
-                        <property name="moveable">1</property>
-                        <property name="name">m_choiceTolerance</property>
-                        <property name="pane_border">1</property>
-                        <property name="pane_position"></property>
-                        <property name="pane_size"></property>
-                        <property name="permission">protected</property>
-                        <property name="pin_button">1</property>
-                        <property name="pos"></property>
-                        <property name="resize">Resizable</property>
-                        <property name="selection">0</property>
-                        <property name="show">1</property>
-                        <property name="size"></property>
-                        <property name="style"></property>
-                        <property name="subclass">; ; forward_declare</property>
-                        <property name="toolbar_pane">0</property>
-                        <property name="tooltip">Tolerance sets the distance between two points that are considered joined when building the board outlines.</property>
-                        <property name="validator_data_type"></property>
-                        <property name="validator_style">wxFILTER_NONE</property>
-                        <property name="validator_type">wxDefaultValidator</property>
-                        <property name="validator_variable"></property>
-                        <property name="window_extra_style"></property>
-                        <property name="window_name"></property>
-                        <property name="window_style"></property>
-                      </object>
-                    </object>
                   </object>
                 </object>
                 <object class="sizeritem" expanded="true">
@@ -1566,6 +1504,71 @@
                         <property name="window_style"></property>
                       </object>
                     </object>
+                    <object class="sizeritem" expanded="true">
+                      <property name="border">5</property>
+                      <property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
+                      <property name="proportion">0</property>
+                      <object class="wxCheckBox" expanded="true">
+                        <property name="BottomDockable">1</property>
+                        <property name="LeftDockable">1</property>
+                        <property name="RightDockable">1</property>
+                        <property name="TopDockable">1</property>
+                        <property name="aui_layer">0</property>
+                        <property name="aui_name"></property>
+                        <property name="aui_position">0</property>
+                        <property name="aui_row">0</property>
+                        <property name="best_size"></property>
+                        <property name="bg"></property>
+                        <property name="caption"></property>
+                        <property name="caption_visible">1</property>
+                        <property name="center_pane">0</property>
+                        <property name="checked">0</property>
+                        <property name="close_button">1</property>
+                        <property name="context_help"></property>
+                        <property name="context_menu">1</property>
+                        <property name="default_pane">0</property>
+                        <property name="dock">Dock</property>
+                        <property name="dock_fixed">0</property>
+                        <property name="docking">Left</property>
+                        <property name="drag_accept_files">0</property>
+                        <property name="enabled">1</property>
+                        <property name="fg"></property>
+                        <property name="floatable">1</property>
+                        <property name="font"></property>
+                        <property name="gripper">0</property>
+                        <property name="hidden">0</property>
+                        <property name="id">wxID_ANY</property>
+                        <property name="label">Fill all vias</property>
+                        <property name="max_size"></property>
+                        <property name="maximize_button">0</property>
+                        <property name="maximum_size"></property>
+                        <property name="min_size"></property>
+                        <property name="minimize_button">0</property>
+                        <property name="minimum_size"></property>
+                        <property name="moveable">1</property>
+                        <property name="name">m_cbFillAllVias</property>
+                        <property name="pane_border">1</property>
+                        <property name="pane_position"></property>
+                        <property name="pane_size"></property>
+                        <property name="permission">protected</property>
+                        <property name="pin_button">1</property>
+                        <property name="pos"></property>
+                        <property name="resize">Resizable</property>
+                        <property name="show">1</property>
+                        <property name="size"></property>
+                        <property name="style"></property>
+                        <property name="subclass"></property>
+                        <property name="toolbar_pane">0</property>
+                        <property name="tooltip">Don&apos;t cut via holes in copper layers.</property>
+                        <property name="validator_data_type"></property>
+                        <property name="validator_style">wxFILTER_NONE</property>
+                        <property name="validator_type">wxDefaultValidator</property>
+                        <property name="validator_variable"></property>
+                        <property name="window_extra_style"></property>
+                        <property name="window_name"></property>
+                        <property name="window_style"></property>
+                      </object>
+                    </object>
                     <object class="sizeritem" expanded="false">
                       <property name="border">5</property>
                       <property name="flag">wxLEFT|wxRIGHT|wxTOP</property>
@@ -2733,6 +2736,133 @@
                         <property name="window_style"></property>
                       </object>
                     </object>
+                    <object class="sizeritem" expanded="false">
+                      <property name="border">5</property>
+                      <property name="flag">wxTOP|wxRIGHT|wxLEFT</property>
+                      <property name="proportion">0</property>
+                      <object class="wxStaticText" expanded="false">
+                        <property name="BottomDockable">1</property>
+                        <property name="LeftDockable">1</property>
+                        <property name="RightDockable">1</property>
+                        <property name="TopDockable">1</property>
+                        <property name="aui_layer">0</property>
+                        <property name="aui_name"></property>
+                        <property name="aui_position">0</property>
+                        <property name="aui_row">0</property>
+                        <property name="best_size"></property>
+                        <property name="bg"></property>
+                        <property name="caption"></property>
+                        <property name="caption_visible">1</property>
+                        <property name="center_pane">0</property>
+                        <property name="close_button">1</property>
+                        <property name="context_help"></property>
+                        <property name="context_menu">1</property>
+                        <property name="default_pane">0</property>
+                        <property name="dock">Dock</property>
+                        <property name="dock_fixed">0</property>
+                        <property name="docking">Left</property>
+                        <property name="drag_accept_files">0</property>
+                        <property name="enabled">1</property>
+                        <property name="fg"></property>
+                        <property name="floatable">1</property>
+                        <property name="font"></property>
+                        <property name="gripper">0</property>
+                        <property name="hidden">0</property>
+                        <property name="id">wxID_ANY</property>
+                        <property name="label">Board outline chaining tolerance:</property>
+                        <property name="markup">0</property>
+                        <property name="max_size"></property>
+                        <property name="maximize_button">0</property>
+                        <property name="maximum_size"></property>
+                        <property name="min_size"></property>
+                        <property name="minimize_button">0</property>
+                        <property name="minimum_size"></property>
+                        <property name="moveable">1</property>
+                        <property name="name">m_staticTextTolerance</property>
+                        <property name="pane_border">1</property>
+                        <property name="pane_position"></property>
+                        <property name="pane_size"></property>
+                        <property name="permission">protected</property>
+                        <property name="pin_button">1</property>
+                        <property name="pos"></property>
+                        <property name="resize">Resizable</property>
+                        <property name="show">1</property>
+                        <property name="size"></property>
+                        <property name="style"></property>
+                        <property name="subclass">; ; forward_declare</property>
+                        <property name="toolbar_pane">0</property>
+                        <property name="tooltip"></property>
+                        <property name="window_extra_style"></property>
+                        <property name="window_name"></property>
+                        <property name="window_style"></property>
+                        <property name="wrap">-1</property>
+                      </object>
+                    </object>
+                    <object class="sizeritem" expanded="false">
+                      <property name="border">5</property>
+                      <property name="flag">wxALL|wxEXPAND</property>
+                      <property name="proportion">0</property>
+                      <object class="wxChoice" expanded="false">
+                        <property name="BottomDockable">1</property>
+                        <property name="LeftDockable">1</property>
+                        <property name="RightDockable">1</property>
+                        <property name="TopDockable">1</property>
+                        <property name="aui_layer">0</property>
+                        <property name="aui_name"></property>
+                        <property name="aui_position">0</property>
+                        <property name="aui_row">0</property>
+                        <property name="best_size"></property>
+                        <property name="bg"></property>
+                        <property name="caption"></property>
+                        <property name="caption_visible">1</property>
+                        <property name="center_pane">0</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="context_help"></property>
+                        <property name="context_menu">1</property>
+                        <property name="default_pane">0</property>
+                        <property name="dock">Dock</property>
+                        <property name="dock_fixed">0</property>
+                        <property name="docking">Left</property>
+                        <property name="drag_accept_files">0</property>
+                        <property name="enabled">1</property>
+                        <property name="fg"></property>
+                        <property name="floatable">1</property>
+                        <property name="font"></property>
+                        <property name="gripper">0</property>
+                        <property name="hidden">0</property>
+                        <property name="id">wxID_ANY</property>
+                        <property name="max_size"></property>
+                        <property name="maximize_button">0</property>
+                        <property name="maximum_size"></property>
+                        <property name="min_size"></property>
+                        <property name="minimize_button">0</property>
+                        <property name="minimum_size"></property>
+                        <property name="moveable">1</property>
+                        <property name="name">m_choiceTolerance</property>
+                        <property name="pane_border">1</property>
+                        <property name="pane_position"></property>
+                        <property name="pane_size"></property>
+                        <property name="permission">protected</property>
+                        <property name="pin_button">1</property>
+                        <property name="pos"></property>
+                        <property name="resize">Resizable</property>
+                        <property name="selection">0</property>
+                        <property name="show">1</property>
+                        <property name="size"></property>
+                        <property name="style"></property>
+                        <property name="subclass">; ; forward_declare</property>
+                        <property name="toolbar_pane">0</property>
+                        <property name="tooltip">Tolerance sets the distance between two points that are considered joined when building the board outlines.</property>
+                        <property name="validator_data_type"></property>
+                        <property name="validator_style">wxFILTER_NONE</property>
+                        <property name="validator_type">wxDefaultValidator</property>
+                        <property name="validator_variable"></property>
+                        <property name="window_extra_style"></property>
+                        <property name="window_name"></property>
+                        <property name="window_style"></property>
+                      </object>
+                    </object>
                   </object>
                 </object>
               </object>
diff --git a/pcbnew/dialogs/dialog_export_step_base.h b/pcbnew/dialogs/dialog_export_step_base.h
index 303ce8c46c..8df8a8c92a 100644
--- a/pcbnew/dialogs/dialog_export_step_base.h
+++ b/pcbnew/dialogs/dialog_export_step_base.h
@@ -53,6 +53,7 @@ class DIALOG_EXPORT_STEP_BASE : public DIALOG_SHIM
 		STD_BITMAP_BUTTON* m_browseButton;
 		wxCheckBox* m_cbExportCompound_hidden;
 		wxCheckBox* m_cbExportBody;
+		wxCheckBox* m_cbCutViasInBody;
 		wxCheckBox* m_cbExportSilkscreen;
 		wxCheckBox* m_cbExportSoldermask;
 		wxCheckBox* m_cbExportSolderpaste_hidden;
@@ -61,13 +62,12 @@ class DIALOG_EXPORT_STEP_BASE : public DIALOG_SHIM
 		wxRadioButton* m_rbOnlySelected;
 		wxRadioButton* m_rbFilteredComponents;
 		wxTextCtrl* m_txtComponentFilter;
-		wxStaticText* m_staticTextTolerance;
-		wxChoice* m_choiceTolerance;
 		wxCheckBox* m_cbExportTracks;
 		wxCheckBox* m_cbExportPads;
 		wxCheckBox* m_cbExportZones;
 		wxCheckBox* m_cbExportInnerCopper;
 		wxCheckBox* m_cbFuseShapes;
+		wxCheckBox* m_cbFillAllVias;
 		wxStaticText* m_staticTextNetFilter;
 		wxTextCtrl* m_txtNetFilter;
 		wxRadioButton* m_rbDrillAndPlotOrigin;
@@ -85,6 +85,8 @@ class DIALOG_EXPORT_STEP_BASE : public DIALOG_SHIM
 		wxCheckBox* m_cbSubstModels;
 		wxCheckBox* m_cbOverwriteFile;
 		wxCheckBox* m_cbOptimizeStep;
+		wxStaticText* m_staticTextTolerance;
+		wxChoice* m_choiceTolerance;
 		wxStdDialogButtonSizer* m_sdbSizer;
 		wxButton* m_sdbSizerOK;
 		wxButton* m_sdbSizerCancel;
diff --git a/pcbnew/exporters/step/exporter_step.cpp b/pcbnew/exporters/step/exporter_step.cpp
index b2fbf97067..fdb518fa50 100644
--- a/pcbnew/exporters/step/exporter_step.cpp
+++ b/pcbnew/exporters/step/exporter_step.cpp
@@ -179,8 +179,11 @@ bool EXPORTER_STEP::buildFootprint3DShapes( FOOTPRINT* aFootprint, VECTOR2D aOri
         {
             int platingThickness = pad->GetAttribute() == PAD_ATTRIB::PTH ? m_platingThickness : 0;
 
-            if( m_pcbModel->AddHole( *holeShape, platingThickness, F_Cu, B_Cu, false, aOrigin ) )
+            if( m_pcbModel->AddHole( *holeShape, platingThickness, F_Cu, B_Cu, false, aOrigin, true,
+                                     true ) )
+            {
                 hasdata = true;
+            }
 
             //// Cut holes in silkscreen (buggy: insufficient polyset self-intersection checking)
             //if( m_layersToExport.Contains( F_SilkS ) || m_layersToExport.Contains( B_SilkS ) )
@@ -383,8 +386,9 @@ bool EXPORTER_STEP::buildFootprint3DShapes( FOOTPRINT* aFootprint, VECTOR2D aOri
 
 bool EXPORTER_STEP::buildTrack3DShape( PCB_TRACK* aTrack, VECTOR2D aOrigin )
 {
-    if( !m_params.m_NetFilter.IsEmpty() && !aTrack->GetNetname().Matches( m_params.m_NetFilter ) )
-        return true;
+    bool skipCopper = !m_params.m_ExportTracksVias
+                      || ( !m_params.m_NetFilter.IsEmpty()
+                           && !aTrack->GetNetname().Matches( m_params.m_NetFilter ) );
 
     int maxError = m_board->GetDesignSettings().m_MaxError;
 
@@ -398,14 +402,22 @@ bool EXPORTER_STEP::buildTrack3DShape( PCB_TRACK* aTrack, VECTOR2D aOrigin )
 
         LSET layers( via->GetLayerSet() & m_layersToExport );
 
-        for( PCB_LAYER_ID pcblayer : layers.Seq() )
-        {
-            const std::shared_ptr<SHAPE>& shape = via->GetEffectiveShape( pcblayer );
+        PCB_LAYER_ID top_layer, bot_layer;
+        via->LayerPair( &top_layer, &bot_layer );
 
-            SHAPE_POLY_SET poly;
-            shape->TransformToPolygon( poly, maxError, ERROR_INSIDE );
-            m_poly_shapes[pcblayer].Append( poly );
-            m_poly_holes[pcblayer].Append( holePoly );
+        if( !skipCopper )
+        {
+            for( PCB_LAYER_ID pcblayer : layers.Seq() )
+            {
+                const std::shared_ptr<SHAPE>& shape = via->GetEffectiveShape( pcblayer );
+
+                SHAPE_POLY_SET poly;
+                shape->TransformToPolygon( poly, maxError, ERROR_INSIDE );
+                m_poly_shapes[pcblayer].Append( poly );
+                m_poly_holes[pcblayer].Append( holePoly );
+            }
+
+            m_pcbModel->AddBarrel( *holeShape, top_layer, bot_layer, true, aOrigin );
         }
 
         //// Cut holes in silkscreen (buggy: insufficient polyset self-intersection checking)
@@ -415,15 +427,15 @@ bool EXPORTER_STEP::buildTrack3DShape( PCB_TRACK* aTrack, VECTOR2D aOrigin )
         //    m_poly_holes[B_SilkS].Append( holePoly );
         //}
 
-        PCB_LAYER_ID top_layer, bot_layer;
-        via->LayerPair( &top_layer, &bot_layer );
-
-        m_pcbModel->AddHole( *holeShape, m_platingThickness, top_layer, bot_layer, true, aOrigin );
-        m_pcbModel->AddBarrel( *holeShape, top_layer, bot_layer, true, aOrigin );
+        m_pcbModel->AddHole( *holeShape, m_platingThickness, top_layer, bot_layer, true, aOrigin,
+                             !m_params.m_FillAllVias, m_params.m_CutViasInBody );
 
         return true;
     }
 
+    if( skipCopper )
+        return true;
+
     PCB_LAYER_ID pcblayer = aTrack->GetLayer();
 
     if( !m_layersToExport.Contains( pcblayer ) )
@@ -611,11 +623,8 @@ bool EXPORTER_STEP::buildBoard3DShapes()
     for( FOOTPRINT* fp : m_board->Footprints() )
         buildFootprint3DShapes( fp, origin );
 
-    if( m_params.m_ExportTracksVias )
-    {
-        for( PCB_TRACK* track : m_board->Tracks() )
-            buildTrack3DShape( track, origin );
-    }
+    for( PCB_TRACK* track : m_board->Tracks() )
+        buildTrack3DShape( track, origin );
 
     for( BOARD_ITEM* item : m_board->Drawings() )
         buildGraphic3DShape( item, origin );
diff --git a/pcbnew/exporters/step/step_pcb_model.cpp b/pcbnew/exporters/step/step_pcb_model.cpp
index 37ddb0cae1..1ca5fee1cd 100644
--- a/pcbnew/exporters/step/step_pcb_model.cpp
+++ b/pcbnew/exporters/step/step_pcb_model.cpp
@@ -904,7 +904,7 @@ bool STEP_PCB_MODEL::AddPadShape( const PAD* aPad, const VECTOR2D& aOrigin, bool
 
 bool STEP_PCB_MODEL::AddHole( const SHAPE_SEGMENT& aShape, int aPlatingThickness,
                               PCB_LAYER_ID aLayerTop, PCB_LAYER_ID aLayerBot, bool aVia,
-                              const VECTOR2D& aOrigin )
+                              const VECTOR2D& aOrigin, bool aCutCopper, bool aCutBody )
 {
     double margin = 0.001; // a small margin on the Z axix to be sure the hole
                            // is bigger than the board with copper
@@ -928,24 +928,30 @@ bool STEP_PCB_MODEL::AddHole( const SHAPE_SEGMENT& aShape, int aPlatingThickness
 
     TopoDS_Shape copperHole, boardHole;
 
-    if( MakeShapeAsThickSegment( copperHole, aShape.GetSeg().A, aShape.GetSeg().B, copperDrill,
-                                 holeZsize, bottom - margin, aOrigin ) )
+    if( aCutCopper )
     {
-        m_copperCutouts.push_back( copperHole );
-    }
-    else
-    {
-        return false;
+        if( MakeShapeAsThickSegment( copperHole, aShape.GetSeg().A, aShape.GetSeg().B, copperDrill,
+                                     holeZsize, bottom - margin, aOrigin ) )
+        {
+            m_copperCutouts.push_back( copperHole );
+        }
+        else
+        {
+            return false;
+        }
     }
 
-    if( MakeShapeAsThickSegment( boardHole, aShape.GetSeg().A, aShape.GetSeg().B, boardDrill,
-                                 holeZsize, bottom - margin, aOrigin ) )
+    if( aCutBody )
     {
-        m_boardCutouts.push_back( boardHole );
-    }
-    else
-    {
-        return false;
+        if( MakeShapeAsThickSegment( boardHole, aShape.GetSeg().A, aShape.GetSeg().B, boardDrill,
+                                     holeZsize, bottom - margin, aOrigin ) )
+        {
+            m_boardCutouts.push_back( boardHole );
+        }
+        else
+        {
+            return false;
+        }
     }
 
     return true;
diff --git a/pcbnew/exporters/step/step_pcb_model.h b/pcbnew/exporters/step/step_pcb_model.h
index 8c548ef325..5f726f4fb5 100644
--- a/pcbnew/exporters/step/step_pcb_model.h
+++ b/pcbnew/exporters/step/step_pcb_model.h
@@ -101,7 +101,8 @@ public:
 
     // add a pad hole or slot (must be in final position)
     bool AddHole( const SHAPE_SEGMENT& aShape, int aPlatingThickness, PCB_LAYER_ID aLayerTop,
-                  PCB_LAYER_ID aLayerBot, bool aVia, const VECTOR2D& aOrigin );
+                  PCB_LAYER_ID aLayerBot, bool aVia, const VECTOR2D& aOrigin, bool aCutCopper,
+                  bool aCutBody );
 
     // add a plated hole shape (without the hole)
     bool AddBarrel( const SHAPE_SEGMENT& aShape, PCB_LAYER_ID aLayerTop, PCB_LAYER_ID aLayerBot,
@@ -122,7 +123,6 @@ public:
     void SetEnabledLayers( const LSET& aLayers );
     void SetFuseShapes( bool aValue );
     void SetSimplifyShapes( bool aValue );
-    void SetAddVisMaterials( bool aValue );
     void SetStackup( const BOARD_STACKUP& aStackup );
     void SetNetFilter( const wxString& aFilter );