How to create a building block from GDS

Making a building block from GDS

How to make a building from GDS file

import nazca as nd

with nd.Cell(name='mmi_bb') as mmi_bb:
    # load GDS BB
    mmi = nd.load_gds(
        filename='mmi_bb.gds',
        cellname='mmi'
        )
    mmi.put()

    # Add Pins
    nd.Pin('a0', width=2).put(0, 0, 180)
    nd.Pin('b0', width=2).put(40, 2.5, 0)
    nd.Pin('b1', width=2).put(40, -2.5, 0)

bb = mmi_bb.put(0)
# connect to mmi Pin 'b0' and 'b1'
nd.bend(angle=90, width=2, layer=1).put(bb.pin['b0'])
nd.bend(angle=-90, width=2, layer=1).put(bb.pin['b1'])

nd.export_gds()

In this example we show how to load a MMI GDS building block and add Pins ‘a0’, ‘b0’ and ‘b1’ to the block. Having the Pins set at the input and output ports of the MMI, it is easy to connect to this building block and draw the layout.

We can also add stubs and the boundary around the MMI to better visualize the component.

import nazca as nd

with nd.Cell(name='mmi_bb') as mmi_bb:
    # load GDS BB
    mmi = nd.load_gds(
        filename='mmi_bb.gds',
        cellname='mmi'
        )
    mmi.put()

    # Add Pins
    nd.Pin('a0', width=2).put(0, 0, 180)
    nd.Pin('b0', width=2).put(40, 2.5, 0)
    nd.Pin('b1', width=2).put(40, -2.5, 0)

    # Put stubs
    nd.put_stub()

    # Put boundary around the mmi bb
    nd.put_boundingbox('org', length=40, width=10)

bb = mmi_bb.put(0)
# connect to mmi Pin 'b0' and 'b1'
nd.bend(angle=90, width=2, layer=1).put(bb.pin['b0'])
nd.bend(angle=-90, width=2, layer=1).put(bb.pin['b1'])

nd.export_gds()

Related Tutorials

Nazca LayoutNazca Foundry
16 November 2018

Add text to your layout

In this example we show how to add text to your layout.
Nazca LayoutNazca FoundryPhotonic BBs
19 January 2018

Create a building block using Polygons

In this example we show how to create a building block from Polygons.
Nazca LayoutNazca FoundryPhotonic BBs
19 January 2018

Create a photonic crystal using a GDS array

In this example we show how to create a photonic crystal using GDS array.