Home › Forums › Nazca › Clipping check, distance and length for interconnects › Reply To: Clipping check, distance and length for interconnects
13 April 2020 at 17:23
#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