From bba742b8041c923fcc1e89b95c3b9db2a35158ee Mon Sep 17 00:00:00 2001 From: Tomasz Wlostowski Date: Mon, 25 Oct 2021 17:39:09 +0200 Subject: [PATCH] pcbnew: support vertex line start/end width to correctly import certain DXF files --- pcbnew/import_gfx/dxf_import_plugin.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pcbnew/import_gfx/dxf_import_plugin.cpp b/pcbnew/import_gfx/dxf_import_plugin.cpp index 110625318f..ef19a9de0e 100644 --- a/pcbnew/import_gfx/dxf_import_plugin.cpp +++ b/pcbnew/import_gfx/dxf_import_plugin.cpp @@ -379,7 +379,13 @@ void DXF_IMPORT_PLUGIN::addVertex( const DL_VertexData& aData ) return; // Error DXF_IMPORT_LAYER* layer = getImportLayer( attributes.getLayer() ); - double lineWidth = lineWeightToWidth( attributes.getWidth(), layer ); + double lineWidth = lineWeightToWidth( attributes.getWidth(), layer ); + + /* support for per-vertex-encoded linewidth (Cadence uses it) */ + if( aData.startWidth > 0.0 ) + lineWidth = aData.startWidth; + else if ( aData.endWidth > 0.0 ) + lineWidth = aData.endWidth; const DL_VertexData* vertex = &aData;