Hi,
I am trying to use the ShapeProcessor to perform Boolean operations, in particular:
boolean_to_polygon(Shape[] in_a, Shape[] in_b, int mode, bool resolve_holes, bool min_coherence)
I seem to missing something easy. I have an array of boxes that I want to "in_a" and a single box I want to use for "in_b". I don't know how convert a box to a Shape to construct the Shape[].
Comments
Hi,
"Shape" is a geometrical shape taken from the layout database. In order to work with the ShapeProcessor, you'll need a layout database (RBA::Layout).
Since you have basic objects already (RBA::Box, RBA::Polygon etc.), the tool you look for is the EdgeProcessor.
You can also employ the Region class to do operations between collections of polygons. This is probably the most convenient solution.
Matthias
Hi Matthias,
I am writing a script to do some sizing and boolean operations on shapes. It works, but the performance is such that I won't be able to use it on anything more than a test structure. Yet when I access the menu Edit | Selection | Size Shapes, the performance is much faster. I am wondering what the difference between the script and menu is. Perhaps I am not using the correct parameters (or even the correct function!). Examples of my operations:
Is there a way to call the Size function that is in the menu via Python script?
thank you
Lukas
Hi Lukas,
are you using selection just on a part of the layout? The ShapeProcessor will run on the full layer always. Are you planning to implement sizing on the selected shapes only?
ShapeProcessor and EdgeProcessor are somewhat outdated.
Region
is the more convenient way to run boolean operations and sizing.To just capture the selected shapes and compute a sized version into a Region object use code like this:
Best regards,
Matthias
Thank you. I am indeed trying to size the entire layout (but selection is a good starting point).
Is Region what the menu item is using, i.e., will the performance be the same?
thanks
Hi Lukas,
basically the performance of the different approaches should be more or less the same. Region is basically just a convenience wrapper around
EdgeProcessor
.ShapeProcessor
is the same. TheThe performance is roughly
O(E*log(E))
where E is the number of edges in the input (flat - i.e. after propagating them to the current cell if they are in a child cell). So I was wondering whether the selection may be much than the total number of shapes of the layer. That could explain the performance difference.A simple test is a DRC script:
will size the layer 1/0 by 1 µm and output the results to layer 2/0. The DRC feature is based on
Region
and it's performance is equivalent to that ofRegion
.If memory is an issue, the DRC feature can make use of a tiling scheme where the layout is cut into rectangular tiles and each tile is computed separately. Technically this is based on the
TilingProcessor
class. Using tiling allows utilization of multiple cores and reduces memory requirements.Best regards,
Matthias