First of all, great work! Saw your talk at PW2020.
After importing a few layouts and seeing strange results, I became curious about the way the averaging is done when trying to get an average epsilon value. I think I understand the function correctly, but I also don't think it's doing what it's meant to be doing.
First of all, cell.get_area_ratio() will always either return 1, or 0, because it's defined from a rectangular grid.
if(cell.get_area_ratio() == 0) { break; } shouldn't be in the loop, but really should be a condition to go in the loop. It's not going to change between primitives. Of course that's very minor.
doesn't work if it's from a subsequent layer. Say you define a structure on top of a cladding. The first structure will give an overlap of say < 1 and correctly increments val and keeps on lopping, but on the second pass it will be overwritten by that return from the cladding. In the end, all the polygons must be kept so that a difference can be computed between them.
if(cell.get_area_ratio() > 0) { val += cell.get_area_ratio()*1.0; } will always increment val by 1 if gets through the condition. But is it really what it should do? It should really be the overlap that is "left" that contributes to val.
My final thought is that there should be a more efficient way for get_values than going grid point by grid point if you already have all the polygons in hand.
First of all, great work! Saw your talk at PW2020.
After importing a few layouts and seeing strange results, I became curious about the way the averaging is done when trying to get an average epsilon value. I think I understand the function correctly, but I also don't think it's doing what it's meant to be doing.
First of all, cell.get_area_ratio() will always either return 1, or 0, because it's defined from a rectangular grid.
if(cell.get_area_ratio() == 0) { break; }
shouldn't be in the loop, but really should be a condition to go in the loop. It's not going to change between primitives. Of course that's very minor.doesn't work if it's from a subsequent layer. Say you define a structure on top of a cladding. The first structure will give an overlap of say < 1 and correctly increments val and keeps on lopping, but on the second pass it will be overwritten by that return from the cladding. In the end, all the polygons must be kept so that a difference can be computed between them.
if(cell.get_area_ratio() > 0) { val += cell.get_area_ratio()*1.0; }
will always increment val by 1 if gets through the condition. But is it really what it should do? It should really be the overlap that is "left" that contributes to val.My final thought is that there should be a more efficient way for get_values than going grid point by grid point if you already have all the polygons in hand.