Merge pull request #1379 from KLayout/wip2

Wip2
This commit is contained in:
Matthias Köfferlein 2023-05-23 19:44:49 +02:00 committed by GitHub
commit fa9e7e7c12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 8 deletions

View File

@ -2308,9 +2308,11 @@ static void decompose_convex_helper (int depth, PreferredOrientation po, const d
db::Box bbox = sp.box (); db::Box bbox = sp.box ();
db::coord_traits<db::Coord>::area_type atot = 0; 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) { for (size_t i = 0; i < n; ++i) {
db::Edge ep (sp.hull ()[(i + n - 1) % n], sp.hull ()[i]); db::Edge ep (sp.hull ()[(i + n - 1) % n], sp.hull ()[i]);
atot += db::vprod (ep.p2 () - db::Point (), ep.p1 () - db::Point ()); atot += db::vprod (ep.p2 () - db::Point (), ep.p1 () - db::Point ());
min_edge = std::min (min_edge, ep.length ());
} }
std::set<db::Point> skipped; std::set<db::Point> skipped;
@ -2457,9 +2459,14 @@ static void decompose_convex_helper (int depth, PreferredOrientation po, const d
int cr = 0; int cr = 0;
if (x.second == efc.p1 ()) { if (x.second == efc.p1 ()) {
if (db::vprod (efc, efp) < 0) { if (db::vprod (efc, efp) < 0) {
cr = 2; // cut terminates at another concave corner cr = 3; // cut terminates at another concave corner
} else { } 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
} }
} }

View File

@ -888,10 +888,12 @@ gsi::Console *PythonInterpreter::current_console () const
void PythonInterpreter::begin_execution () void PythonInterpreter::begin_execution ()
{ {
m_file_id_map.clear ();
m_block_exceptions = false; m_block_exceptions = false;
if (m_current_exec_level++ == 0 && mp_current_exec_handler) { if (m_current_exec_level++ == 0) {
mp_current_exec_handler->start_exec (this); m_file_id_map.clear ();
if (mp_current_exec_handler) {
mp_current_exec_handler->start_exec (this);
}
} }
} }

View File

@ -2486,9 +2486,11 @@ RubyInterpreter::begin_exec ()
{ {
d->exit_on_next = false; d->exit_on_next = false;
d->block_exceptions = false; d->block_exceptions = false;
d->file_id_map.clear (); if (d->current_exec_level++ == 0) {
if (d->current_exec_level++ == 0 && d->current_exec_handler) { d->file_id_map.clear ();
d->current_exec_handler->start_exec (this); if (d->current_exec_handler) {
d->current_exec_handler->start_exec (this);
}
} }
} }