Forum Replies Created

Viewing 20 posts - 61 through 80 (of 194 total)
  • Author
    Posts
  • in reply to: problems running python files #6205
    Ronald
    Keymaster

    Dear Alex,

    Nazca allows you to be a bit “sloppy” by auto defining a xsection in cases where one would be needed in Interconnects but where none was provided. However, an extra check on connection symmetry was added in 0.5.11 that in your case did not like a missing xsection. This will be adapted so it will not warn/stop on the missing xsection anymore. For now an easy way out is to define the xsection explicitly and also add it to the interconnect initialization, which is best practice anyway:

    siName = 'SiDevLayer'
    siLayer = 1
    # even nicer is to add the xsections explicitly: 
    # nd.add_xsection(name='myXS')
    # nd.add_xsection(name='myXS2')
    nd.add_layer(name=siName, layer=siLayer, accuracy=0.001)
    nd.add_layer(name='Sleeve', layer=2, accuracy=0.001)
    nd.add_layer2xsection(xsection='myXS', layer='SiDevLayer')  # This will define the xsection as well when none exists yet with name 'myXS'.
    nd.add_layer2xsection(xsection='myXS2', layer='Sleeve')  # This will define the xsection as well when none exists yet with name 'myXS2'.
    
    w0 = 1  
    r0 = 120
    ic   = Interconnect(xs='myXS', width=w0, radius=r0)
    ic65 = Interconnect(xs='myXS', width=0.65, radius=r0)
    ic56 = Interconnect(xs='myXS', width=0.56, radius=r0)
    ic50 = Interconnect(xs='myXS', width=0.5, radius=r0)
    ws = 5
    rs = 100
    ics = Interconnect(xs='myXS2', width=ws, radius=rs)

    Ronald

    Ronald
    Keymaster

    Dear Cameron.

    When placing the text, its xpos and ypos are multiplied by i and j again in your script. This gives coordinates that are indeed out of range for gds, hence the error. Below a clean up that also utilizes the font you initialized.

    import nazca as nd
    
    cpitchx = 6000
    cpitchy = 5500
    offsety = 958
    offsetx = 294
    row = 24
    col = 12
    
    font = nd.Font('cousine') # create object to create text in the indicated font.
    with nd.Cell(name='Cell_C') as cellc:
        for i in range(col):
            xpos = cpitchx * i + int(i / 2) * offsetx
            for j in range (row):
                num_r = f"{j}"
                #nd.text(text=num_r, height=100, layer=1, align='cc').put(cpitchx * i, cpitchy * j)
                num_c = f"c{i}r{j}"
                ypos = cpitchy * j + int(j / 2) * offsety
                font.text(text=num_c, height=100, layer=1, align='cc').put(xpos + 750, ypos)
    cellc.put(0, 0, 0)
    print('done')
    nd.export_gds(filename='chip_numbers_space2.gds')

    Ronald

    in reply to: how to do design rule check by nazca #6184
    Ronald
    Keymaster

    Dear Alien007,

    DRC can have many forms. The Nazca DRC is mostly aimed the netlist or logical connection level.
    (For polygon level on the gds, DRC in Klayout can help out in a next step.)

    Below an example of the Nazca DRC that defines xsections, layers, a building block, some interconnects and then connects them having different pin xsections and/or widths. This will trigger a DRC error. This will be displayed to stdout but a logfile can be added, as in this example, to store the DRC error messages.

    import nazca as nd
    nd.logfile(__file__)  # create logfile that will list DRC errors
    nd.pin2pin_drc_on()  # switch on pin2pin connection drc
    
    lay1 = nd.add_layer(name='lay1', layer=1)
    lay2 = nd.add_layer(name='lay2', layer=2)
    
    xs1 = nd.add_xsection(name='xs1')
    nd.add_layer2xsection(xsection='xs1', layer='lay1')
    ic1 = nd.interconnects.Interconnect(xs='xs1')
    
    xs2 = nd.add_xsection(name='xs2')
    nd.add_layer2xsection(xsection='xs2', layer='lay2')
    ic2 = nd.interconnects.Interconnect(xs='xs2')
    
    with nd.Cell(name='myBB') as bb:
        nd.Polygon(points=[[0, -5], [0, 5], [10, 5], [10, -5]], layer='lay1').put(0)
        nd.Pin(name='a0', xs='xs1').put(0, 0, 180)
        nd.Pin(name='b0', xs='xs2').put(10, 0, 0)
        nd.put_stub()
    
    ic2.strt().put(0)
    bb.put()
    ic1.bend().put()
    ic1.strt(width=0.5).put()
    
    nd.export_plt()

    DRC violations are added to the logfile and visualized in the layout. If you want to find out where in your script a DRC error was caused, you can ask Nazca to raise an exception on the specific error number by changing the third line in the above code to nd.pin2pin_drc_on(num=0) (for error DRC-0). Use standard Python traceback to find where in your script the eroor originated.

    Ronald

    in reply to: how to get the matplolib figure? #6162
    Ronald
    Keymaster

    Hi Bastien,

    It seems plotly gets installed via Anaconda as well. Anyway, I already implemented a plotly export class as it was quite easy to do and it allows for some faster panning and zooming than matplotllib, probably. Hence, in Nazca.0.5.12 you can try nd.export_plotly() in a Jupyter Notebook. I implemented the basics for polygons and the color schema.

    Ronald

    in reply to: how to get the matplolib figure? #6159
    Ronald
    Keymaster

    Dear Bastien,

    The cell iterator would indeed be a good way to get access all the layout info.

    I am not familiar with plotly, but I noticed it has to run in a browser to show the plot (JavaScript output) and it needs an offline mode if not run through a plotly account. I adjusted the code a bit to make it run for me in a notebook (see code below).

    More generic in Nazca, the layout to the various formats (gds, svg, png) receives input from the iterator in layout.py. Full Nazca-plotly integration would need a small class with methods for fig open, plot shapes for polygons, polylines and annotations, and a figure close/show, similar to e.g. class ClsMatplotlib.

    import nazca as nd
    from plotly.offline import plot
    import plotly.graph_objects as go
    nd.clear_layout()
    
    a = nd.strt(width=5, layer=1).put()
    b = nd.bend( width=5, layer=1).put()
    
    X, Y, lay = [], [], []
    for NT in nd.cell_iter(nd.cfg.defaultcell, flat=True):
        if NT.cell_start:
            print(f"cell: '{NT.cell.cell_name}'")
            for k, (pgon, points, bbox) in enumerate(NT.iters['polygon']):
                X.append([xy[0] for xy in points])
                Y.append([xy[1] for xy in points])
                lay.append(nd.get_layer_tuple(pgon.layer)[0]) # tuple: (layer, datatype, technology)
      
    fig = go.Figure()
    
    for x, y, l in zip(X, Y, lay):
        fig.add_trace(
            go.Scatter(x=x, y=y, fill="toself", marker=dict(opacity=0), fillcolor='red'),
        )
    
    fig.add_annotation(
        x=5,
        y=2.5,
        text="L",
        ax=0,
        ay=-40
    )
    
    fig.add_annotation(
        x=0,
        y=0,
        text="W",
        ax=-20,
        ay=-40
    )
    
    fig.update_annotations(dict(
        xref="x",
        yref="y",
        showarrow=True,
        arrowhead=7
    ))
    
    fig.update_layout(
        yaxis = dict(
            scaleanchor = "x",
            scaleratio = 1,
        ),
        showlegend = True,
        width=1000, 
        height=1000,
        autosize=False
    )
    
    plot(fig)

    Ronald

    in reply to: how to get the matplolib figure? #6147
    Ronald
    Keymaster

    Dear Bastien,

    For matplotlib export use nd.export_plt() or alias nd.export_png().
    Notice that after export the design will be cleared. So in the next example the second export would be empty:

    nd.export_gds() 
    nd.export_plt()  # will be empty

    To keep the design alive you can use clear=False in the call:

    nd.export_gds(clear=False) 
    nd.export_plt()  # export to png as expected

    This behaviour is specifically introduced for working in Jupyter notebooks. So when you rerun a cell you do not stack design upon design by default, but if you run stuff in a sequence of cells you can set the clear=False.

    Matplotlib is flexible but notoriously on the slow side. If you put a lot of frames in you color definition things will slow down.

    For svg export you need to have svgwrite installed and simply use nd.export_svg(). With svg you can still edit some details for a presentation for example.

    More layout export types can be added relatively easy. Each type resides in separate class that receives the same layout info from the Nazca layout engine, such as polygons, lines and annotations, but exports it to the specific format.

    Ronald

    in reply to: bbox bug #6132
    Ronald
    Keymaster

    another way is:

    import nazca as nd
    from nazca.interconnects import Interconnect as IC
    
    #  Interconnect settings
    XS = 'xs1'
    nd.add_layer2xsection(xsection=XS, layer=1)
    IC_1 = IC(width=1, radius=80, xs=XS)
    
    nd.cfg.use_hull = True  # switch hull calculation on for all cells
    nd.cfg.hull_based_bbox = True  # use the hull for the next level hull/bbox, not the bbox, for all cells.
    
    # main
    with nd.Cell('main', autobbox=False) as main:
        IC_1.bend(angle=45).put(0, 0, 45)
    
    print(main.bbox)
    print(main.hull)

    Ronald

    in reply to: bbox bug #6131
    Ronald
    Keymaster

    Hey Joe,

    There are some pro’s and con’s of a hull vs. bbox. A convex hull is like a rubber band around the shapes. It can not be assigned a top-right etc corner like a rectangular bbox. The bbox is not supposed to be the tightest shape under rotation, it serves another purpose, like placement convenience, vizualization or finding overlaps with other boxes efficiently. Hulls take an order longer to calculate, so default they are off. Note that for your topcell of interest you do want a width and a height, according to a rectangular bbox, if I understand correctly, which depends on the orientation of that topcell.

    A way to get the tight bbox of your top cell is to flatten it and get the bbox for that flattened cell. This can be done with the cell_iter(). I also switched the hull on for the flattened cell. The hull has a lot more points than a bbox in this case, due to the outside of the bend being part of the hull.

    import nazca as nd
    from nazca.interconnects import Interconnect as IC
    
    #  Interconnect settings
    XS = 'xs1'
    nd.add_layer2xsection(xsection=XS, layer=1)
    IC_1 = IC(width=1, radius=80, xs=XS)
    
    # main
    with nd.Cell('main') as main:
        IC_1.bend(angle=45).put(0, 0, 45)
    
    nd.cfg.use_hull = True # switch on hull calculations.
    lyo = nd.layout()
    for P in nd.cell_iter(main, flat=True):
        if P.cell_start:
            if P.level == 0:
                lyo.cell_open(params=P)
            lyo.add_polygons(params=P)
        if P.cell_close and P.level == 0:
            lyo.cell_close(params=P)
    
    print(lyo.CELL.topcell.bbox)
    print(lyo.CELL.topcell.hull)
    # output
    (-0.35355339059327373, -0.3535533905932738, 23.931457505076203, 56.56854249492379)
    [[-3.53553391e-01  3.53553391e-01]
     [ 3.53553391e-01 -3.53553391e-01]
     [ 7.07106781e-01 -3.88578059e-16]
     [ 1.19628836e+00  5.01371256e-01]
     [ 1.75083025e+00  1.07841601e+00]
     [ 2.29960800e+00  1.66094527e+00]
     [ 2.84256736e+00  2.24890147e+00]
     [ 3.37965467e+00  2.84222649e+00]
     [ 3.91081685e+00  3.44086168e+00]
     [ 4.43600139e+00  4.04474789e+00]
     [ 4.95515640e+00  4.65382541e+00]
     [ 5.46823055e+00  5.26803407e+00]
     [ 5.97517314e+00  5.88731314e+00]
     [ 6.47593406e+00  6.51160141e+00]
     [ 6.97046382e+00  7.14083720e+00]
     [ 7.45871354e+00  7.77495830e+00]
     [ 7.94063497e+00  8.41390203e+00]
     [ 8.41618046e+00  9.05760525e+00]
     [ 8.88530302e+00  9.70600434e+00]
     [ 9.34795629e+00  1.03590352e+01]
     [ 9.80409452e+00  1.10166333e+01]
     [ 1.02536727e+01  1.16787337e+01]
     [ 1.06966462e+01  1.23452708e+01]
     [ 1.11329715e+01  1.30161789e+01]
     [ 1.15626053e+01  1.36913915e+01]
     [ 1.19855052e+01  1.43708421e+01]
     [ 1.24016294e+01  1.50544633e+01]
     [ 1.28109367e+01  1.57421877e+01]
     [ 1.32133867e+01  1.64339473e+01]
     [ 1.36089397e+01  1.71296737e+01]
     [ 1.39975565e+01  1.78292981e+01]
     [ 1.43791987e+01  1.85327515e+01]
     [ 1.47538286e+01  1.92399642e+01]
     [ 1.51214092e+01  1.99508663e+01]
     [ 1.54819041e+01  2.06653877e+01]
     [ 1.58352777e+01  2.13834576e+01]
     [ 1.61814951e+01  2.21050052e+01]
     [ 1.65205221e+01  2.28299590e+01]
     [ 1.68523251e+01  2.35582475e+01]
     [ 1.71768714e+01  2.42897986e+01]
     [ 1.74941289e+01  2.50245401e+01]
     [ 1.78040662e+01  2.57623993e+01]
     [ 1.81066526e+01  2.65033033e+01]
     [ 1.84018584e+01  2.72471789e+01]
     [ 1.86896543e+01  2.79939526e+01]
     [ 1.89700119e+01  2.87435505e+01]
     [ 1.92429034e+01  2.94958985e+01]
     [ 1.95083019e+01  3.02509224e+01]
     [ 1.97661811e+01  3.10085474e+01]
     [ 2.00165156e+01  3.17686987e+01]
     [ 2.02592806e+01  3.25313011e+01]
     [ 2.04944522e+01  3.32962794e+01]
     [ 2.07220070e+01  3.40635578e+01]
     [ 2.09419226e+01  3.48330605e+01]
     [ 2.11541773e+01  3.56047115e+01]
     [ 2.13587500e+01  3.63784346e+01]
     [ 2.15556206e+01  3.71541532e+01]
     [ 2.17447696e+01  3.79317906e+01]
     [ 2.19261783e+01  3.87112701e+01]
     [ 2.20998288e+01  3.94925145e+01]
     [ 2.22657039e+01  4.02754467e+01]
     [ 2.24237872e+01  4.10599893e+01]
     [ 2.25740631e+01  4.18460647e+01]
     [ 2.27165167e+01  4.26335952e+01]
     [ 2.28511340e+01  4.34225030e+01]
     [ 2.29779017e+01  4.42127101e+01]
     [ 2.30968072e+01  4.50041385e+01]
     [ 2.32078387e+01  4.57967098e+01]
     [ 2.33109853e+01  4.65903459e+01]
     [ 2.34062369e+01  4.73849681e+01]
     [ 2.34935839e+01  4.81804980e+01]
     [ 2.35730178e+01  4.89768570e+01]
     [ 2.36445307e+01  4.97739663e+01]
     [ 2.37081155e+01  5.05717472e+01]
     [ 2.37637660e+01  5.13701208e+01]
     [ 2.38114766e+01  5.21690081e+01]
     [ 2.38512427e+01  5.29683304e+01]
     [ 2.38830602e+01  5.37680084e+01]
     [ 2.39069262e+01  5.45679633e+01]
     [ 2.39228381e+01  5.53681159e+01]
     [ 2.39314575e+01  5.60685425e+01]
     [ 2.39314575e+01  5.65685425e+01]
     [ 2.29314575e+01  5.65685425e+01]]

    Ronald

    in reply to: bbox bug #6129
    Ronald
    Keymaster

    Dear Joe,

    Thank you for the example. This may look surprising, but it is expected behaviour.

    A bbox of a cell is a rectangular shape in the native orientation of the block. Let’s say you draw a thin diagonal line from (0, 0) to (1, 1), then the bbox is bottom-left (0, 0) to top right (1, 1), but the upper left and bottom right corner of the bbox (square) are empty. If you rotate the bbox by -45 degree, the diagonal is a vertical line and the bbox a diamond shape. If you place this in another cell it will see the diamond left and right tips “pushing” the parent bbox.

    The bend example is similar; Interconnects in Nazca by default (by choice) are not instantiated when exported to gds (they are nazca internally cells, actually a stack of cells, each with a bbox), so you do not see that diamond bbox anymore. But you do see it pushing the bbox of cell main. The bbox is visualized in the example below.

    Nazca does also have a convex hull option as boundary. Such hull will always make the structure “touch” the parent bbox. But also that touching is optional, because you can still ask a parent cell to either use the hull (if present) or the rectangular bbox of the instance to calculate the bounding box. Calculating a hull costs (much) more time, so it is not used in mask elements or interconnects.

    import nazca as nd
    
    from nazca import cp, Cell
    from nazca.interconnects import Interconnect as IC
    
    #  Interconnect settings
    XS = 'xs1'
    nd.add_layer2xsection(xsection=XS, layer=1)
    IC_1 = IC(width=1, radius=80, xs=XS)
    
    with Cell('bend', autobbox=True) as bend:
        IC_1.bend(angle=45).put()
    
    # main
    with Cell('main', autobbox=True) as main:
        bend.put(0, 0, 45)
    
    nd.export_gds(topcells=main, filename='bbox_test.gds')

     

    in reply to: trace for Euler bend #6125
    Ronald
    Keymaster

    Dear jgnedy,

    Thanks, that would be the length_geo indeed and I now added it. It was not so much forgotten as that there is a transition in how to store information in cells, moving from ‘trace’ to ‘pathfinder’ and having lengths defined as relations between pins rather than a cell property like length_geo. The latter works well for mask elements, including the euler bend, which has a closed form length anyway.

    Ronald

    Ronald
    Keymaster

    Dear Cameron,

    That is more or less a complete design file 🙂

    Specific geometries for a project typically need custom math and Python code.

    Good tutorials on the Nazca part on cells/blocks and interconnecting blocks to start are
    https://nazca-design.org/make_a_cell_put_a_cell/
    https://nazca-design.org/interconnects/

    Ronald

    Ronald
    Keymaster

    Dear Cameron,

    Only place the cells that are < radius from a center (x0, y0):

    from math import sqrt
    import nazca as nd
    
    cell = nd.load_gds(filename="my.gds", cellname="my_cell_name")
    
    with nd.Cell('circle') as C:
        N = 50
        M = 50
        dx = 40
        dy = 70
        x0 = 1000
        y0 = 1000
        radius = 1000
        for n in range(N):
            for m in range(M):
                x = dx*n
                y = dy*m
                if (x-x0)**2 + (y-y0)**2 < radius**2:
                    cell.put(x, y, 0)
    
    C.put()
    nd.export_gds()

    Ronald

    Ronald
    Keymaster

    Dear Cameron,

    GDS natively supports arrays on cell instances that span two vectors (dx1, dy1) and (dx2, dy2), not circles. For a circular array you have to place cells simply on a circle.

    from math import sin, cos, pi
    import nazca as nd
    
    cell = nd.load_gds(filename="my.gds", cellname="my_cell_name")
    
    with nd.Cell('circle') as C: 
        N = 20
        radius = 500
        for i in range(N):
            cell.put(radius*cos(i*2*pi/N), radius*sin(i*2*pi/N), 0)
     
    C.put()
    nd.export_gds()

    For a native cell array check out the gds arrays tutorial.

    Ronald

    in reply to: get layers used in a layout #6099
    Ronald
    Keymaster

    Dear Bastien,

    All layers are stored in a Pandas DataFrame in the cfg module. You can access it as
    df = nd.cfg.layer_table

    The method nd.get_layers() simply gets you the same DataFrame with a column filter added, but a column name has been changed into “layer_name”, hence the error. Will fix that and put a test on it.

    Alternatively to print the layers to stdout you can use
    nd.show_layers()

    Ronald

    in reply to: Hashme with multiple cells #6096
    Ronald
    Keymaster

    Dear Joel,

    I checked that indeed **kwargs fed parameters do not pop up in the hashme after introspection (via inspect module). My guess (observation?) is that **kwargs are dealt with in another corner of inspect and are hiding there. Something to investigate…

    Ronald

    in reply to: Clipping check, distance and length for interconnects #6091
    Ronald
    Keymaster

    Dear iv_tern,

    print points rather than pgon.points for the polygon coordinates with respect to the first instantiated parent cell, which maximaly goes up to the cell provided to cell_iter(), the “topcell” in this context.

    To get the polygon with respect to the topcell, regardless of any cell instantiation, flatten the hierarchy with flat=True or hierarchy='flat'.

    In your case you are looking for the position with respect to the “nazca” top cell, which is always created as a blank canvas when importing nazca.

    – nazca
    .. – tp1
    …. – polygon1
    .. – tp2
    …. – polygon2

    That “nazca” topcell can be accessed as nd.cfg.defaultcell and you get:

    for NT in nd.cell_iter(nd.cfg.defaultcell, flat=True):
        if NT.cell_start:
            print(f"\ncell: '{NT.cell.cell_name}'")
            for i, (pgon, points, bbox) in enumerate(NT.iters['polygon']):
                print(f"{i}: points: {points}, layer: '{pgon.layer}'")

    output:

    cell: 'nazca'
    
    cell: 'toy_poly2'
    0: points: [(40.0, 40.0), (25.0, 40.0), (26.0, 50.0), (20.0, 40.0)], layer: '1/0/None'
    
    cell: 'toy_poly1'
    0: points: [(0, 0), (0, 7), (10, 14), (0, 25)], layer: '1/0/None'

    Alternatively put the design in a custom topcell:

    nd.with(name='topcell') as top:
        p1 = tp1.put(0, 0, 0)
        p2 = tp2.put(40, 40, 90)

    and use nd.cell_iter(cell=top, flat=True) to get the coordinates as before and nd.export_gds(top) in case you export cell “top” to gds.

    Ronald

    in reply to: Nazca reset within the same interpreter #6089
    Ronald
    Keymaster

    Dear Dima,

    Will this help, inserted at the top of your file?

    from IPython import get_ipython
    get_ipython().magic('reset -sf')

    Ronald

    in reply to: Clipping check, distance and length for interconnects #6084
    Ronald
    Keymaster

    Dear iv_tern,

    The properties are accessible through the Cell objects, which are themselves in a tree structure.

    If you want to see the polygons (if I interpret your question well) you can iterate over all cells under a specific cell and in each cell iterate over all polygons. The method cell_iter() is available for that as demonstrated in the example below.

    import nazca as nd
    import nazca.demofab as demo
    
    cell_1 = demo.deep.strt(length=10, width=5)
    
    print("points in original polygon:")
    for NT in nd.cell_iter(cell_1):  # NT is a named tuple object
        if NT.cell_start:
            print(f"\ncell: '{NT.cell.cell_name}'")
            for i, (pgon, points, bbox) in enumerate(NT.iters['polygon']):
                print(f"{i}: points: {pgon.points}, layer: '{pgon.layer}'")

    In the line (pgon, points, bbox), the “pgon” refers to the original polygon object, the “points” to the polygon translated w.r.t. the top cell provided to cell_iter, and “bbox” the translated bounding box.

    Ronald

    in reply to: Adding pins to user defined cell #6064
    Ronald
    Keymaster

    Dear dnortheast,

    The layout of the cell is correct, only the provided pin reference is not pointing to an instance object. To help identify this situation quickly I added a warning that will show up in the Nazca logfile, i.e. referencing of the Pin(pin=…) to a pin in a cell outside the cell you are building (available after the 0.5.10 release). It will not complain when referencing to a pin inside the same parent cell or a pin in an instance.

    Ronald

    in reply to: Clipping check, distance and length for interconnects #6063
    Ronald
    Keymaster

    Dear iv_tern,

    When you place elements (cells) Nazca checks on all of the pins of the element if they are closer than a small value epsilon (typically < 1 nm) from an existing pin in the parent cell. In that case Nazca internally creates a connection between all matching pins for a complete circuit netlist. The connections are validated against a number of conditions, like the pin width, xsection and symmetry. Note this is on pins, not an arbitrary feature of the polygons or polylines; It is about circuit connectivity in this context, not geometrical drawings.

    The same feature can be used for snapping (useful in a drag & drop environment) by using a larger epsilon and let the placement follow the existing pin if close enough and if all the other required pin properties (apart from spatial proximity) match according to a customizable set of rules. It needs some small adaptations in the code to be able to switch from proximity based in-place connections to snapping connections depending on the situation (script vs mouse).


    The distance between two pins can be obtained as follows

    x, y, a = nazca.diff(pin1, pin2)

    Some other features in this context may be useful, e.g. getting the position in between two pins:

    x, y, a = nazca.midpoint(pin1, pin2)
    pin = nazca.midpointer(pin1, pin2)


    The geometrical length of interconnects can be obtained by starting a “trace”:

    import nazca as nd
    ic = nd.interconnects.Interconnect(width=1.0, radius=100)
    
    nd.trace.trace_start()
    ic.strt(length=200).put(0)
    ic.sbend(offset=100).put()
    ic.bend(angle=45).put()
    nd.trace.trace_stop()
    length = nd.trace.trace_length()
    print(length)

    The trace does not check if elements are connected.

    Instead of the trace method you can use the pathfinder, which returns all connected paths and their geometrical lengths, starting in the pin provided to the “start” keyword.

    import nazca as nd
    ic = nd.interconnects.Interconnect(width=1.0, radius=100)
    
    e1 = ic.strt(length=200).put(0)
    ic.sbend(offset=100).put()
    ic.bend(angle=45).put()
    nd.pathfinder(start=e1.pin['a0'])

    Note that some parametric interconnect elements may not have a path length yet.

    Ronald

Viewing 20 posts - 61 through 80 (of 194 total)