Home Forums Nazca Questions and Answers Using “xsections” with a custom building block

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #6604

    Hello, I am interested in how to use “xsections” with a custom building block.

    I am using your custom building block from the example on the page: Creating a building block using polygons. You created the building block “bb” in the example using the Polygon class.

    How can I add “xsection” to the building block “bb”?


    Dear sinobadm,

    Xsections are global objects. As such you do not have to add them to cells as a xsection before you can use them. You can just use them when they are defined, see xsections and layers.

    Note that Polygon objects, as used in the example you refer to, do not work with xsections. They work with layers.

    Conceptually a xsection is mostly applied to represent a waveguide or metal guide, consisting of one or more layers, captured in a xsection. Polygons are more free form geometries for drawing, like when used in a BB as in the example.



    Dear Ronald,

    In my design, I use together Nazca-design built-in cells (strt, bend, taper) and custom building blocks.

    Regarding “xsections” I use them to define the distance (guide) around my device where the foundry will not add filling patterns. The foundry adds filling patterns to achieve the desired density of the deposited material, and I don’t want to have filling patterns too close to my waveguides.

    An example of a custom building block is an apodized waveguide grating (AWG) with a complicated free-form shape. The simple device consists of a straight section “strt” and the AWG building block. Here, I want to have these “xsections” around both straight section “strt” and the AWG building block.

    This can be done manually by working with polygons and layers. However, when working with many built-in cells and custom building blocks to build the cell this would be very impractical.

    Is there any way to define “xsections” for the instance of the custom building blocks? Or, is there a way I can make a cell instead of the custom building block that would act in the same way as Nazca-design built-in cells?



    Dear Milan,

    A “NoFill” layer to protect from tiling is a specific layer. You can add that to your xsection definition and use interconnects. Whenever you use that interconnect your get the NoFill layer.

    In another case, when working directly with Polygon objects, you can grow the Polygon (with pyclipper installed) and redirect the result to the NoFill layer.

    The above solutions look like this when applied to the MMI polygon tutorial:

    import nazca as nd
    grow = 5.0  # NoFill clearance
    # create a layers and xsections:
    nd.add_layer(name='layer1', layer=1, accuracy=0.001)
    nd.add_layer(name='NoFill', layer=2, accuracy=0.1)  # NoFill can be course, here 0.1 um resolution
    nd.add_layer2xsection(xsection='myXS', layer='layer1')
    nd.add_layer2xsection(xsection='myXS', layer='NoFill', growx=grow)  # add a NoFill layer
    ic = nd.interconnects.Interconnect(xs="myXS", width=2.0, radius=10.0)  # create interconnect
    # create a building block (cell) from Polygon points and add the NoFill layer
    with nd.Cell('building_block') as bb:
        bb_body = [
            (5.0, -5.0), (5.0, -1.0), (0.0, -1.0), (0.0, 1.0),
            (5.0, 1.0), (5.0, 5.0), (35.0, 5.0), (35.0, 3.5),
            (40.0, 3.5), (40.0, 1.5), (35.0, 1.5), (35.0, -1.5),
            (40.0, -1.5), (40.0, -3.5), (35.0, -3.5), (35.0, -5.0)
        poly = nd.Polygon(points=bb_body, layer='layer1')
        poly.grow(layer='NoFill', grow=grow).put(0)  # add NoFill layer based on original Polygon.
        nd.Pin('a0').put(0, 0, 180)
        nd.Pin('b0').put(40, 2.5, 0)
        nd.Pin('b1').put(40, -2.5, 0)
    #  draw MMIs and interconnects and automatically get NoFill layers:
    mmi = bb.put('b1')

    A less surgical alternative is to use the cell’s bounding box and fill it with the NoFill layer (not shown in the example above).



    Thank you, Ronald. This solution works for me.

    I have one more question.

    Can I get information about the “xs layers” and their corresponding “grow” values from nd once I add those layers to xsection?

    In case I have multiple layers added to xsection with different grow values I want to apply those to my building block created using polygons.

    In your example, you passed the layer name (layer=’NoFill’) and grow value (grow=grow) manually, but it would be good to pass only xs name (xs=”myXS”) and then apply grow to each layer. This would be a loop over layers getting layer names and grow values and applying them using grow function.



    Dear Milan,

    You can try print(nd.get_xsection('myXS').mask_layers) to see layer info for ‘myXS’.
    It returns a Pandas DataFrame like this:

               xsection  layer  datatype  tech  ...  growy1  growy2  accuracy  polyline
    layer_name                                  ...                                    
    layer1         myXS      1         0  None  ...     0.0     0.0     0.001       0.0
    NoFill         myXS      2         0  None  ...     0.0     0.0     0.100       0.0



    Hello Ronald. This works for me. Best, Milan

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