diff --git a/src/db/db/dbHierarchyBuilder.cc b/src/db/db/dbHierarchyBuilder.cc index 66fbc8a41..838e93243 100644 --- a/src/db/db/dbHierarchyBuilder.cc +++ b/src/db/db/dbHierarchyBuilder.cc @@ -534,9 +534,12 @@ ClippingHierarchyBuilderShapeReceiver::insert_clipped (const db::Box &box, const if (complex_region) { for (db::RecursiveShapeReceiver::box_tree_type::overlapping_iterator cr = complex_region->begin_overlapping (bb, db::box_convert ()); ! cr.at_end (); ++cr) { - mp_pipe->push (*cr & bb, trans, world, 0, target); + db::Box bc = *cr & bb; + if (! bc.empty ()) { + mp_pipe->push (bc, trans, world, 0, target); + } } - } else { + } else if (! bb.empty ()) { mp_pipe->push (bb, trans, world, 0, target); } } diff --git a/src/drc/drc/built-in-macros/_drc_engine.rb b/src/drc/drc/built-in-macros/_drc_engine.rb index 5b60a23e5..69bf9f69a 100644 --- a/src/drc/drc/built-in-macros/_drc_engine.rb +++ b/src/drc/drc/built-in-macros/_drc_engine.rb @@ -2536,8 +2536,12 @@ CODE end # clip if a box is specified - if box && clip && (cls == RBA::Region || cls == RBA::Edge) - r &= RBA::Region::new(box) + # TODO: the whole clip thing could be a part of the Region constructor + if cls == RBA::Region && clip && box + # HACK: deep regions will always clip in the constructor, so skip this + if ! @deep + r &= RBA::Region::new(box) + end end end diff --git a/testdata/drc/drcSimpleTests_au32d.gds b/testdata/drc/drcSimpleTests_au32d.gds index 414bb2ff4..c899c06e9 100644 Binary files a/testdata/drc/drcSimpleTests_au32d.gds and b/testdata/drc/drcSimpleTests_au32d.gds differ