Home Forums Nazca Interconnect: pcurve_p2p

This topic contains 5 replies, has 3 voices, and was last updated by  Xaveer 1 day, 23 hours ago.

Viewing 6 posts - 1 through 6 (of 6 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

    • This reply was modified 9 months ago by  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

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.