From 919d2d56fa04dedef9d0a89bf9cdab2796cf3fbc Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 29 Jul 2017 19:05:52 +0200 Subject: [PATCH] Ported oasis-fix to GDS2 reader too (reduction of zero-distance axes in AREF's) --- src/db/dbGDS2ReaderBase.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/db/dbGDS2ReaderBase.cc b/src/db/dbGDS2ReaderBase.cc index 3447cafe2..b877e6f28 100644 --- a/src/db/dbGDS2ReaderBase.cc +++ b/src/db/dbGDS2ReaderBase.cc @@ -1022,6 +1022,9 @@ GDS2ReaderBase::read_ref (db::Layout &layout, db::Cell & /*cell*/, bool array, t int cols = get_ushort (); int rows = get_ushort (); + cols = std::max (1, cols); + rows = std::max (1, rows); + // Array reference if (get_record () != sXY) { error (tl::to_string (QObject::tr ("XY record expected"))); @@ -1041,6 +1044,15 @@ GDS2ReaderBase::read_ref (db::Layout &layout, db::Cell & /*cell*/, bool array, t db::Vector c = v_conv (xy_data [1]) - xy; db::Vector r = v_conv (xy_data [2]) - xy; + // Reduce axes with no displacement to dimension 1 - such + // axes only produce overlapping instances. + if (c == db::Vector ()) { + cols = 1; + } + if (r == db::Vector ()) { + rows = 1; + } + std::pair pp = finish_element (layout.properties_repository ()); bool split_cols = false, split_rows = false; @@ -1056,9 +1068,6 @@ GDS2ReaderBase::read_ref (db::Layout &layout, db::Cell & /*cell*/, bool array, t if (split_cols || split_rows) { - cols = std::max (1, cols); - rows = std::max (1, rows); - db::DVector cd (db::DVector (c) * (1.0 / double (cols))); db::DVector rd (db::DVector (r) * (1.0 / double (rows)));