Skip to content

Commit

Permalink
Merge pull request #1379 from KLayout/wip2
Browse files Browse the repository at this point in the history
Wip2
  • Loading branch information
klayoutmatthias authored May 23, 2023
2 parents 03749fe + 53fa78c commit fa9e7e7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
11 changes: 9 additions & 2 deletions src/db/db/dbPolygonTools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2308,9 +2308,11 @@ static void decompose_convex_helper (int depth, PreferredOrientation po, const d

db::Box bbox = sp.box ();
db::coord_traits<db::Coord>::area_type atot = 0;
db::coord_traits<db::Coord>::distance_type min_edge = std::numeric_limits<db::coord_traits<db::Coord>::distance_type>::max ();
for (size_t i = 0; i < n; ++i) {
db::Edge ep (sp.hull ()[(i + n - 1) % n], sp.hull ()[i]);
atot += db::vprod (ep.p2 () - db::Point (), ep.p1 () - db::Point ());
min_edge = std::min (min_edge, ep.length ());
}

std::set<db::Point> skipped;
Expand Down Expand Up @@ -2457,9 +2459,14 @@ static void decompose_convex_helper (int depth, PreferredOrientation po, const d
int cr = 0;
if (x.second == efc.p1 ()) {
if (db::vprod (efc, efp) < 0) {
cr = 2; // cut terminates at another concave corner
cr = 3; // cut terminates at another concave corner
} else {
cr = 1; // cut terminates at a convex corner
cr = 2; // cut terminates at a convex corner
}
} else {
db::coord_traits<db::Coord>::distance_type el = std::min (x.second.distance (efc.p1 ()), x.second.distance (efc.p2 ()));
if (el >= min_edge) {
cr = 1; // does not induce shorter edge than we have so far
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/pya/pya/pya.cc
Original file line number Diff line number Diff line change
Expand Up @@ -888,10 +888,12 @@ gsi::Console *PythonInterpreter::current_console () const

void PythonInterpreter::begin_execution ()
{
m_file_id_map.clear ();
m_block_exceptions = false;
if (m_current_exec_level++ == 0 && mp_current_exec_handler) {
mp_current_exec_handler->start_exec (this);
if (m_current_exec_level++ == 0) {
m_file_id_map.clear ();
if (mp_current_exec_handler) {
mp_current_exec_handler->start_exec (this);
}
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/rba/rba/rba.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2486,9 +2486,11 @@ RubyInterpreter::begin_exec ()
{
d->exit_on_next = false;
d->block_exceptions = false;
d->file_id_map.clear ();
if (d->current_exec_level++ == 0 && d->current_exec_handler) {
d->current_exec_handler->start_exec (this);
if (d->current_exec_level++ == 0) {
d->file_id_map.clear ();
if (d->current_exec_handler) {
d->current_exec_handler->start_exec (this);
}
}
}

Expand Down

0 comments on commit fa9e7e7

Please sign in to comment.