DRC - How to obtain the length of one Box from multiple Boxes

Hi
In layer1/0, I have many shapes, namely polygons and boxes. All the boxes are of the same size and they are all squares. How can I obtain the side length of a box, such as the side length of the box in the red frame?

Comments

  • edited July 30

    You cannot directly. DRC is for checking thresholds, not for measuring.

    You can iterate the objects in a layer:

    layer = ... # a polygon layer
    layer.each do |poly|
      .. do something with poly ..
    end
    

    "poly" will be a DPolygon object (https://www.klayout.de/doc-qt5/code/class_DPolygon.html).

    The reverse of "each" is "insert":

    # creates a new, empty polygon layer
    layer = polygons
    
    # adds a polygon to that layer
    poly = ... # a DPolygon object
    layer.insert(poly)
    

    This basically allows you to create custom DRC functions. But those will not be very efficient as they are executed inside the script engine.

    Matthias

Sign In or Register to comment.