diff --git a/pcbnew/import_gfx/dxf_import_plugin.cpp b/pcbnew/import_gfx/dxf_import_plugin.cpp index 50d67c0956..feb5999fed 100644 --- a/pcbnew/import_gfx/dxf_import_plugin.cpp +++ b/pcbnew/import_gfx/dxf_import_plugin.cpp @@ -99,6 +99,8 @@ DXF_IMPORT_PLUGIN::DXF_IMPORT_PLUGIN() : DL_CreationAdapter() m_minX = m_minY = std::numeric_limits::max(); m_maxX = m_maxY = std::numeric_limits::min(); m_currentUnit = DXF_IMPORT_UNITS::DEFAULT; + m_importCoordinatePrecision = 4; // initial value per dxf spec + m_importAnglePrecision = 0; // initial value per dxf spec // placeholder layer so we can fallback to something later std::unique_ptr layer0 = @@ -943,6 +945,18 @@ void DXF_IMPORT_PLUGIN::setVariableInt( const std::string& key, int value, int c return; } + if( key == "$AUPREC" ) + { + m_importAnglePrecision = value; + return; + } + + if( key == "$LUPREC" ) + { + m_importCoordinatePrecision = value; + return; + } + if( key == "$INSUNITS" ) // Drawing units { switch( value ) diff --git a/pcbnew/import_gfx/dxf_import_plugin.h b/pcbnew/import_gfx/dxf_import_plugin.h index fcca4ae5df..a01cf088c4 100644 --- a/pcbnew/import_gfx/dxf_import_plugin.h +++ b/pcbnew/import_gfx/dxf_import_plugin.h @@ -558,7 +558,9 @@ private: double m_minX, m_maxX; // handles image size in mm double m_minY, m_maxY; // handles image size in mm - DXF_IMPORT_UNITS m_currentUnit; // current unit during import + DXF_IMPORT_UNITS m_currentUnit; // current unit during import + int m_importCoordinatePrecision; // current precision for linear units (points) + int m_importAnglePrecision; // current precision for angles GRAPHICS_IMPORTER_BUFFER m_internalImporter;