Home › Forums › Nazca › Clipping check, distance and length for interconnects › Reply To: Clipping check, distance and length for interconnects
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