WIP: exclude area implemented. Needs optimization.

This commit is contained in:
Matthias Koefferlein 2025-09-06 19:15:12 +02:00
parent ff6ab4267b
commit feda8680ca
3 changed files with 12 additions and 14 deletions

View File

@ -319,11 +319,11 @@ fill_polygon_impl (db::Cell *cell, const db::Polygon &fp0, db::cell_index_type f
if (! exclude_area.empty ()) {
auto iter = exclude_area.iter ();
iter.confine_region (fp0.box ());
auto it = exclude_area.begin_iter ();
it.first.confine_region (fp0.box ());
// over- and undersize the polygons to fill gaps that cannot be filled.
db::Region excluded (iter);
db::Region excluded (it.first, it.second);
excluded.size (dx, 0);
excluded.size (-dx, 0);
excluded.size (dy, 0);
@ -332,16 +332,12 @@ fill_polygon_impl (db::Cell *cell, const db::Polygon &fp0, db::cell_index_type f
if (enhanced_fill || remaining_parts != 0) {
tl::warn << "@@@ using booleans for exclude";
// In enhanced fill or if the remaining parts are requested, it is better to implement the
// exclude area by a boolean NOT
fr -= excluded;
} else {
tl::warn << "@@@ using exclude area rasterizer";
// Otherwise use a second rasterizer for the exclude polygons that must have a zero pixel coverage for the
// pixel to be filled.
@ -437,9 +433,7 @@ fill_polygon_impl (db::Cell *cell, const db::Polygon &fp0, db::cell_index_type f
if (remaining_parts) {
db::EdgeProcessor ep;
std::vector <db::Polygon> fp1;
fp1.push_back (fp0);
ep.boolean (fp1, filled_regions, *remaining_parts, db::BooleanOp::ANotB, false /*=don't resolve holes*/);
ep.boolean (filled_poly, filled_regions, *remaining_parts, db::BooleanOp::ANotB, false /*=don't resolve holes*/);
}
return true;

View File

@ -4345,7 +4345,7 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"\n"
"This method is equivalent to \\Cell#fill_region, but is based on Region (with the cell being the first parameter).\n"
"\n"
"This method has been introduced in version 0.27.\n"
"This method has been introduced in version 0.27. The 'exclude_area' argument has been added in version 0.30.4.\n"
) +
gsi::method_ext ("fill", &fill_region_skew, gsi::arg ("in_cell"),
gsi::arg ("fill_cell_index"),
@ -4362,7 +4362,7 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"\n"
"This method is equivalent to \\Cell#fill_region, but is based on Region (with the cell being the first parameter).\n"
"\n"
"This method has been introduced in version 0.27.\n"
"This method has been introduced in version 0.27. The 'exclude_area' argument has been added in version 0.30.4.\n"
) +
gsi::method_ext ("fill_multi", &fill_region_multi, gsi::arg ("in_cell"),
gsi::arg ("fill_cell_index"),
@ -4377,7 +4377,7 @@ Class<db::Region> decl_Region (decl_dbShapeCollection, "db", "Region",
"\n"
"This method is equivalent to \\Cell#fill_region, but is based on Region (with the cell being the first parameter).\n"
"\n"
"This method has been introduced in version 0.27.\n"
"This method has been introduced in version 0.27. The 'exclude_area' argument has been added in version 0.30.4.\n"
) +
gsi::method_ext ("nets", &nets, gsi::arg ("extracted"), gsi::arg ("net_prop_name", tl::Variant (), "nil"), gsi::arg ("net_filter", (const std::vector<const db::Net *> *) (0), "nil"),
"@brief Pulls the net shapes from a LayoutToNetlist database\n"

View File

@ -5897,7 +5897,7 @@ CODE
pattern = nil
origin = RBA::DPoint::new
repeat = false
excl = RBA::Region::new
excl = nil
args.each_with_index do |a,ai|
if a.is_a?(DRCSource)
@ -5946,6 +5946,10 @@ CODE
column_step = RBA::DVector::new(0, pattern.default_ypitch)
end
if !excl
excl = RBA::Region::new
end
dbu_trans = RBA::VCplxTrans::new(1.0 / @engine.dbu)
result = nil