It looks like you're new here. If you want to get involved, click one of these buttons!
I need to do some processing according to the corner length. Is there any way to get the corresponding edgepairs of corners?
I wrote a python function to do this, but I still want to see the edgepairs output in the original function, because a lot of the handling of the corners requires information about their two edges.thank you
def corner_edge_pairs(region, angle_min, angle_max):
:parma region: input db.Region
:parma angle_min: min angle used in Region.corners.dots()
:parma angle_max: max angle used in Region.corners_dots()
:return edge_pairs: edge pairs of the corners of Region.corners_dots()
polygon_edges = region.edges()
corners_dots = region.corners_dots(angle_min, angle_max)
corres_edges = polygon_edges.interacting(corners_dots)
edge_pairs = db.EdgePairs()
for dot in corners_dots:
edges = corres_edges.interacting(dot)
if len(edges) == 2:
# print("We find a corner edgepair:", edges)
print("We find a corner, but dont find corresponding edgepair:", edges)
there is no such function yet, but it should be easy to add. Thanks for this suggestion. I have created a ticket for this: https://github.com/KLayout/klayout/issues/808
Thank you very much! @Matthias
@garry I have release 0.27.1 with this feature:
Python / Ruby:
edge_pairs = region.corners_edge_pairs()
edge_pairs = layer.corners(as_edge_pairs)
Thanks! @Matthias Klayout is a really wonderful layout editor tool.
@garry You're welcome! And thanks for this feedback!