Home Forums Nazca Interconnect: pcurve_p2p

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #5464
    Chenhui
    Member

    Hello Nazca team,

    Is there a function for the interconnection, like pcurve_p2p, connecting two points, and the width of the two ends can be changed respectively?

    BR,

    Chenhui

    #5526
    Ronald
    Keymaster

    Dear Chenhui,

    Your post got stuck in a dark moderation corner it seems, but here it is…

    The pcurve_p2p() calculates a particular spine, zero-width curve in (x, y), and adds a width to it via polyline2polygon() method in util.py. It is a parametric curve with position (x, y) as function of t and it needs to be defined how the width changes along the curve as w(t). The width could for example change with respect of t or with the geometrical distance along the spine, depending on your use case.

    The pcurve has no width added to its call at the moment, and therefor you probably will find the viper() method in util.py useful. See this viper example. It allows full freedom in x, y and w as function of t. In a similar way a w(t) may be added to the pcurve.

    Ronald

    #5527
    Xaveer
    Moderator

    Dear Chenhui,

    There is a low-level function that will do it, but it is not yet available for the interconnections.

    An example is given here:

    import math
    import nazca as nd
    
    def testcurve(t):
        x = (2 + 15 * t) * math.exp(t)
        y = (2 + 20 * t) * math.cos(t * 5)
        return (x, y)
    
    xy = [testcurve(t / 200) for t in range(201)]
    
    # The width will increase linearly in the given range, proportional to the
    # length of the curve.
    XY = nd.util.polyline2polygon(xy, width=0.5, width2=5)
    nd.Polygon(XY, layer=1).put()
    
    nd.export_gds()

    Best regards,
    Xaveer

    #5621
    Xaveer
    Moderator

    Dear Chenhui,

    In Nazca 0.5.2 there is now an interconnect cobra_p2p() which has this functionality (and more).

    Xaveer

    #5998
    Chenhui
    Member

    Hi Xaveer,

    Thanks for your updated answers.

    I see cobra_p2p() has many possibilities. I will use this function to replace the pcurve_p2p.

    BTW, the pcurve_p2p() doesn’t work well now, and it changes the width from the “set width” to “default width”. That means it is not possible to set a constant width unless we use the default one.

    Regards,

    Chenhui

    #6014
    Xaveer
    Moderator

    Dear Chenhiu,

    BTW, the pcurve_p2p() doesn’t work well now, and it changes the width from the “set width” to “default width”. That means it is not possible to set a constant width unless we use the default one.

    Thanks for pointing this out. It has been fixed and will be available in a new version. However, pcurve_p2p() should not be used anymore anyway: cobra_p2p() is  to be used instead.

    Xaveer

    #6020
    iv_tern
    Member

    Was just about to make a new topic for this, but it seemed very closely related.

    For the cobra_p2p() method, is the taper always linear? I am looking to do some polynomial tapers, but I haven’t managed to figure out a way to do it via viper.

    Apologies, if this has been covered somewhere, my search didn’t reveal anything.

    #6021
    Xaveer
    Moderator

    Dear iv_tern,

    If you specify width1 and width2 and they are different, then a parabolic taper will be generated (with the large angle closest to the smallest width). If you want a different function, you have to specify the shape yourself. Then the width1 argument should be a parametric function w(t), where the width starts at w(0) and ends at w(1). An example is show below.

    import nazca as nd
    import nazca.demofab as demo
    from math import sin
    
    # Connect two waveguides and adapt the width at the same time
    s1 = demo.deep.strt(200, width=2).put(0, -200, 0)
    s2 = demo.deep.strt(200, width=5).put(1000, -250, 170)
    demo.deep.cobra_p2p(pin2=s1.pin['b0'], width1=5).put()
    
    def wsin(t):
        """Useless fast width variation for demonstration."""
        w = 2 + 5 * t + 5 * t * sin(t * 200)
        return w
    
    # Connect two waveguides and vary the width in some useless way.
    c1 = demo.deep.bend(radius=70, angle=50, width=wsin(0)).put(0, -400, 0)
    c2 = demo.deep.bend(radius=100, angle=-50, width=wsin(1)).put(1000, -400, 0)
    demo.deep.cobra_p2p(c1.pin['b0'], c2.pin['a0'], width1=wsin, radius1=70,
            radius2=-100).put()
    
    nd.export_gds()
    

    Please note that Nazca cannot do a lot of sanity-checking on such connections, so it should be used with care.

    Xaveer

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