How to resize a layer

I want to receive the coordinates of a shape, perform some calculations, and update the shape's coordinates with the calculated values. When I ask ChatGPT, it suggests deleting and redrawing the shape. Is there a way to simply update the coordinates?

        for each_cell in layout.top_cell().each_inst():
            l_bd_list = each_cell.cell.each_shape(layout.layer(15, 0)
            for each_shape in l_bd_list :
                x1 = each_shape.bbox().p1.x
                y1 = each_shape.bbox().p1.y
                x2 = each_shape.bbox().p2.x
                y2 = each_shape.bbox().p2.y

                                    y1 = y1 + **********
                                    y2 = y2 + **********

I want to update the coordinates with the modified y1 and y2 values.

Comments

  • Your requirement doesn't seem to fall under the special terminology of resizing in photomask manufacturing.
    If you could provide a more detailed explanation, you'd get proper help from the community.
    My questions include: do you only need to compute the bounding box coordinates? What to do in the case of polygons with complex shapes?

    Regarding the resizing, this recent post, https://www.klayout.de/forum/discussion/2528/, where Region::sized() is used, might give a better understanding.

  • @sekigawa
    Thank you for your opinion first. However, the size command is used to enlarge the shape by the same amount in both the horizontal and vertical directions. What I'm curious about is how to enlarge the shape by different amounts in the horizontal and vertical directions.

  • Hi @MooGyuBae,

    I got it.
    There are three variants in Region::sized().
    I used (3) in the above example. I think (1) is for you.

  • Cont.

    I remade the sample for discussion No.2528 for you.

  • Thanks @sekigawa!

    I am happy to see that humans are still so much smarter than ChatGPT :)

    Matthias

Sign In or Register to comment.