Tagged: viper, free form parametric curves, curve2polyline
- This topic has 1 reply, 2 voices, and was last updated 3 years, 6 months ago by
Ronald.
-
AuthorPosts
-
20 October 2021 at 16:34 #6600
Cecil
MemberHello Nazca team,
I’ve had a few issues working with Tp_viper or curve2polyline (and polyline2polygon) free form parametric curves. Namely there seems to be nm-scale offsets when instancing them on another cell instance’s pin, as shown in the picture.
This happens whether I specify anglei/angleo or not.
Here’s the code:
import nazca as nd from math import tan, radians def polynomial_curve(width, theta_in, x0, some_value1, some_value2, some_value3, N=1000, layer=1): def x(t, x0, **kwargs): return t*x0 def y(t, a, x0, a1, a2, a3, **kwargs): t *= x0 return (a*t - t**3 * a1 - t**4 * a2 - t**5 * a3) def w(t, width1, **kwargs): return width1 params = { 'a': tan(radians(theta_in)), 'x0': x0, 'a1': some_value1, 'a2': some_value2, 'a3': some_value3, } path = nd.Tp_viper(x=x, y=y, w=w, **params, epsilon=1e-9) path_cell = path(width1=width, width2=width, N=N, layer=layer) return path_cell def big_curve(width, theta_in, x0, some_value1, some_value2, some_value3, some_value4, angle=-120, N=1000, layer=1): with nd.Cell(name='Cell', cnt=True) as C: path1 = polynomial_curve( width=width, theta_in=theta_in, x0=x0, some_value1=some_value1, some_value2=some_value2, some_value3=some_value3, N=N, layer=layer, ).put() arc = nd.bend( radius=abs(some_value4), angle=angle/2, width=width, layer=layer, ).put() arc2 = nd.bend( radius=-abs(some_value4), angle=angle/2, width=width, layer=layer ).put() path2 = polynomial_curve( width=width, theta_in=theta_in, x0=x0, some_value1=some_value1, some_value2=some_value2, some_value3=some_value3, N=N, layer=layer, ).put('b0') nd.Pin('b0', show=True).put(path2.pin['a0']) nd.Pin('a0', show=True).put(path1.pin['a0']) nd.put_stub() return C some_value1 = 1.3766941636306883e-07 some_value2 = -4.7556288807929455e-11 some_value3 = 4.388054993928043e-15 some_value4 = -1200 nd.bend(angle=14.559922415647494, width=2, radius=1000).put() big_curve( width=2, theta_in=14.559922415647494, x0=3000, some_value1=some_value1, some_value2=some_value2, some_value3=some_value3, some_value4=some_value4, N=1000, ).put() nd.bend(angle=-90, radius=1200, width=2).put() nd.export_gds(filename='test')
For some reason I didn’t see it happen when instancing the curve by itself at the right angle, and then adding other instances pin to pin. It only happened when used in cells with other elements such as big_curve or cells containing big_curve.
I also used curve2polyline extensively for custom pathing and never had this issue (input angles were always 0, output angle was specified in the xya argument).
Any tips or input?
Thanks,
Cecil
20 October 2021 at 16:43 #6602Ronald
KeymasterDear Cecil,
When using gds hierarchy under (no multiple of 90 degree) angles or in between grid-point translations, the snapping errors (better: delta’s) you see are fundamentally caused by looking at two non-aligned discrete coordinate systems on top of each other.
Interconnects within a single cell are by default not instantiated and snap to the same parent grid. In contrast, the Vipers are now child cells in your example, each in their own grid system. If you flatten topcell “nazca” in your example you will enforce a single parent grid to snap to for all structures in cell “nazca”.
Ronald
-
AuthorPosts
- You must be logged in to reply to this topic.