Home Forums Nazca Pins not rotating with cell

Tagged: ,

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7251
    tommaso.pento
    Participant

    I am new to Nazca, and I am experimenting with some designs.

    In particular, I have a cell that I create including pins using the command nd.Pin . Afterwards, I rotate said cell, which I can then display on KLayout with the pins in the correct position. The code I use is similar to the following

    with nd.Cell as cellA:
    pin1 = nd.Pin().put(x1, y1)
    cellA.put(x2,y2,rotation)

    However, if I go and extract the actual pin data from the cell after rotation, it will be the same as before rotation (so x1 and y1 in this case).

    Is there any way of “forcing” the pins to take the information given by the rotation?

    Thank you in advance,
    Tommaso

    #7298
    Katarzyna
    Keymaster

    The Nazca Cell would typically have predefined Pins and their exact (x,y,a) coordinates.
    This tutorial may help: nazca-design.org/make_a_cell_put_a_cell/
    For example:

    import nazca as nd
    import nazca.demofab as demo

    with nd.Cell(name=’cellA’) as cellA:
    demo.shallow.strt(10).put(0)
    nd.Pin(name=’a1′).put(0, 0, 0)

    cellA.put(‘a1’)

    nd.export_gds()

    If you wish to rotate the cell, you would simply put it at the angle; the pin coordinates inside the Cell remain:

    cellA.put(‘a1′, 0, 0, 30)

    You can rotate the pin inside the cell:

    with nd.Cell(name=’cellA’) as cellA:
    demo.shallow.strt(10).put(0)
    nd.Pin(name=’a1′).put(0, 0, -30)

    cellA.put(‘a1’)

    To ‘force’ pin rotation as a parameter, you may use a function, example:

    def cellA_func(cell_rotation=-30):
    with nd.Cell(name=’cellA’) as cellA:
    demo.shallow.strt(10).put(0)
    pin1 = nd.Pin(name=’a1′).put(0, 0, cell_rotation)
    return cellA

    cellA_func(cell_rotation=-30).put(‘a1’)

    #7306
    tommaso.pento
    Participant

    Thank you for your help, I used the first ways you mentioned (cellA.put(x,y,rot)) and it worked very well

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.