diff --git a/src/db/db/dbBoxScanner.h b/src/db/db/dbBoxScanner.h index fe7cbbff0..6a59239dc 100644 --- a/src/db/db/dbBoxScanner.h +++ b/src/db/db/dbBoxScanner.h @@ -297,10 +297,10 @@ public: * @brief Get the interactions between the stored objects * * Two objects interact if the boxes of the objects enlarged by the given value overlap. - * The enlargement is specified in units of width and height, i.e. half of the enlargement - * is applied to one side before the overlap check. * - * An enlargement of 1 means that boxes have to touch only in order to get an interaction. + * An enlargement of 1 means that boxes have to touch in order to get an interaction. + * An enlargement of 0 means that boxes have to overlap in order to get an interaction. + * To capture interactions between object precisely spaced d, use d+1 for the enlargement. * * The box scanner will report all interactions to the receiver object. See box_scanner_receiver * for details about the methods that this object must provide. diff --git a/src/db/db/dbLocalOperation.h b/src/db/db/dbLocalOperation.h index 8f8651865..28ef522c9 100644 --- a/src/db/db/dbLocalOperation.h +++ b/src/db/db/dbLocalOperation.h @@ -114,7 +114,8 @@ public: /** * @brief Gets the interaction distance - * A distance of means the shapes must overlap in order to interact. + * A distance of zero means the shapes must overlap in order to interact. + * A distance of 1 means the shapes need to touch in order to interact. */ virtual db::Coord dist () const { return 0; } diff --git a/src/db/db/dbRegionLocalOperations.cc b/src/db/db/dbRegionLocalOperations.cc index 82c17c80e..1a2df425c 100644 --- a/src/db/db/dbRegionLocalOperations.cc +++ b/src/db/db/dbRegionLocalOperations.cc @@ -888,10 +888,10 @@ std::map check_local_operation::override_distance () const { // makes sure, the "foreign"-type pseudo-intruder used for merging only - // does not use the full search range, but only "touching". + // does not use the full search range, but only "touching" (distance 1). std::map od; if (check_local_operation_base::m_has_other) { - od.insert (std::make_pair (1, 0)); + od.insert (std::make_pair (1, 1)); } return od; } diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index a4a2b489f..69a5c1d8b 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -2154,3 +2154,14 @@ TEST(152d_sep_with_props) { run_test (_this, "152", true); } + +// issue #2423 +TEST(153_issue_2423) +{ + run_test (_this, "153", false); +} + +TEST(153d_issue_2423) +{ + run_test (_this, "153", true); +} diff --git a/src/edt/edt/edtPartialService.cc b/src/edt/edt/edtPartialService.cc index a4bcf58b2..4751c0523 100644 --- a/src/edt/edt/edtPartialService.cc +++ b/src/edt/edt/edtPartialService.cc @@ -1962,7 +1962,7 @@ PartialService::mouse_press_event (const db::DPoint &p, unsigned int buttons, bo m_p1 = p; m_p2 = p; mp_box = new lay::RubberBox (ui (), m_color, p, p); - mp_box->set_stipple (6); // coarse hatched + mp_box->set_line_style (3); // long dashed dotted ui ()->grab_mouse (this, true); diff --git a/src/laybasic/laybasic/layRubberBox.cc b/src/laybasic/laybasic/layRubberBox.cc index f2f6ae748..dd1e7b2d0 100644 --- a/src/laybasic/laybasic/layRubberBox.cc +++ b/src/laybasic/laybasic/layRubberBox.cc @@ -34,7 +34,7 @@ namespace lay RubberBox::RubberBox (lay::ViewObjectUI *widget, unsigned int color, const db::DPoint &p1, const db::DPoint &p2) : lay::ViewObject (widget, false /*not static*/), - m_p1 (p1), m_p2 (p2), m_color (color), m_stipple (0) + m_p1 (p1), m_p2 (p2), m_color (color), m_line_style (0) { } void @@ -47,10 +47,10 @@ RubberBox::set_color (unsigned int color) } void -RubberBox::set_stipple (unsigned int s) +RubberBox::set_line_style (unsigned int s) { - if (m_stipple != s) { - m_stipple = s; + if (m_line_style != s) { + m_line_style = s; redraw (); } } @@ -60,7 +60,7 @@ RubberBox::render (const Viewport &vp, ViewObjectCanvas &canvas) { lay::Renderer &r = canvas.renderer (); int lw = int (0.5 + 1.0 / r.resolution ()); - lay::CanvasPlane *plane = canvas.plane (lay::ViewOp (m_color, lay::ViewOp::Copy, 0, m_stipple, 0, lay::ViewOp::Rect, lw)); + lay::CanvasPlane *plane = canvas.plane (lay::ViewOp (m_color, lay::ViewOp::Copy, m_line_style, 0, 0, lay::ViewOp::Rect, lw)); if (plane) { r.draw (vp.trans () * db::DBox (m_p1, m_p2), 0, plane, 0, 0); } diff --git a/src/laybasic/laybasic/layRubberBox.h b/src/laybasic/laybasic/layRubberBox.h index ed831238e..79f4c24fe 100644 --- a/src/laybasic/laybasic/layRubberBox.h +++ b/src/laybasic/laybasic/layRubberBox.h @@ -37,7 +37,7 @@ public: RubberBox (lay::ViewObjectUI *canvas, unsigned int color, const db::DPoint &p1, const db::DPoint &p2); void set_color (unsigned int color); - void set_stipple (unsigned int s); + void set_line_style (unsigned int s); void set_points (const db::DPoint &begin, const db::DPoint &end); private: @@ -45,7 +45,7 @@ private: db::DPoint m_p1, m_p2; unsigned int m_color; - unsigned int m_stipple; + unsigned int m_line_style; }; } diff --git a/src/laybasic/laybasic/laySelector.cc b/src/laybasic/laybasic/laySelector.cc index 287dab404..9e376476a 100644 --- a/src/laybasic/laybasic/laySelector.cc +++ b/src/laybasic/laybasic/laySelector.cc @@ -311,7 +311,7 @@ SelectionService::begin (const db::DPoint &pos) m_p1 = pos; m_p2 = pos; mp_box = new lay::RubberBox (ui (), m_color, pos, pos); - mp_box->set_stipple (6); // coarse hatched + mp_box->set_line_style (4); // short dashed ui ()->grab_mouse (this, true); } diff --git a/testdata/drc/drcSimpleTests_151.drc b/testdata/drc/drcSimpleTests_151.drc index 154464951..52f90704c 100644 --- a/testdata/drc/drcSimpleTests_151.drc +++ b/testdata/drc/drcSimpleTests_151.drc @@ -5,8 +5,6 @@ if $drc_test_deep deep end -deep - l1 = input(1, 0, enable_props) l1.output(1, 0) diff --git a/testdata/drc/drcSimpleTests_153.drc b/testdata/drc/drcSimpleTests_153.drc new file mode 100644 index 000000000..0f144bdaf --- /dev/null +++ b/testdata/drc/drcSimpleTests_153.drc @@ -0,0 +1,16 @@ + +source $drc_test_source +target $drc_test_target + +if $drc_test_deep + deep +end + +l1 = polygons(1, 0) +l2 = polygons(2, 0) + +l1.output(1, 0) +l2.output(2, 0) + +l1.separation(l2, 10.um).output(100, 0) + diff --git a/testdata/drc/drcSimpleTests_153.gds b/testdata/drc/drcSimpleTests_153.gds new file mode 100644 index 000000000..de8c2013c Binary files /dev/null and b/testdata/drc/drcSimpleTests_153.gds differ diff --git a/testdata/drc/drcSimpleTests_au151.gds b/testdata/drc/drcSimpleTests_au151.gds index 75622fd4b..9b4140845 100644 Binary files a/testdata/drc/drcSimpleTests_au151.gds and b/testdata/drc/drcSimpleTests_au151.gds differ diff --git a/testdata/drc/drcSimpleTests_au153.gds b/testdata/drc/drcSimpleTests_au153.gds new file mode 100644 index 000000000..93a755d30 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au153.gds differ diff --git a/testdata/drc/drcSimpleTests_au153d.gds b/testdata/drc/drcSimpleTests_au153d.gds new file mode 100644 index 000000000..4a90a26c1 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au153d.gds differ