diff --git a/pcbnew/exporters/step/exporter_step.cpp b/pcbnew/exporters/step/exporter_step.cpp index 6d3482fbd6..45753530ae 100644 --- a/pcbnew/exporters/step/exporter_step.cpp +++ b/pcbnew/exporters/step/exporter_step.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -530,8 +531,39 @@ bool EXPORTER_STEP::buildGraphic3DShape( BOARD_ITEM* aItem, VECTOR2D aOrigin ) return true; } - graphic->TransformShapeToPolySet( m_poly_shapes[pcblayer], pcblayer, 0, maxError, - ERROR_INSIDE ); + LINE_STYLE lineStyle = graphic->GetLineStyle(); + + if( lineStyle == LINE_STYLE::SOLID ) + { + graphic->TransformShapeToPolySet( m_poly_shapes[pcblayer], pcblayer, 0, maxError, + ERROR_INSIDE ); + } + else + { + std::vector shapes = graphic->MakeEffectiveShapes( true ); + const PCB_PLOT_PARAMS& plotParams = m_board->GetPlotOptions(); + KIGFX::PCB_RENDER_SETTINGS renderSettings; + + renderSettings.SetDashLengthRatio( plotParams.GetDashedLineDashRatio() ); + renderSettings.SetGapLengthRatio( plotParams.GetDashedLineGapRatio() ); + + for( SHAPE* shape : shapes ) + { + STROKE_PARAMS::Stroke( shape, lineStyle, graphic->GetWidth(), &renderSettings, + [&]( const VECTOR2I& a, const VECTOR2I& b ) + { + SHAPE_SEGMENT seg( a, b, graphic->GetWidth() ); + seg.TransformToPolygon( m_poly_shapes[pcblayer], + maxError, ERROR_INSIDE ); + } ); + } + + for( SHAPE* shape : shapes ) + delete shape; + } + + if( graphic->IsHatchedFill() ) + m_poly_shapes[pcblayer].Append( graphic->GetHatching() ); break; }