It looks like you're new here. If you want to get involved, click one of these buttons!
Hi,
I am trying to access edge points of a path drawn in klayout.
I can only access center points rather than the edge points. Any ideas how to do this?
I thought of achieving this by creating a buffer polygon from a line to generate polygon edge points.
Are there any modules in klayout that allow this? If not, can I access path edge points directly from a cell?
Many Thanks,
Jaspreet
Comments
Hi Jaspreet,
if you need the outline of a path, you can convert it to a polygon using "Path#polygon". From the polygon you will be able to retrieve the outline points. I think this is what you call the "buffer polygon".
Matthias
I tried but it converts the path into a polygon line which does not have any buffer.
I have a DPath object which gets converted into a DPolygon object and I do not see any option to extract buffer or outline points, neither I see the option to create a polygon offset.
If its possible to perform polygon offset, I can create a buffer/outline. How can I implement this in Klayout?
Jaspreet
Hi Jaspreet,
you mean resolving the polygon into points?
The points of the polygon you can get through iterating over the polygon points with
Polygon#each_point_hull
for the hull contour and the same for the holes (a polygon created from a path won't have holes).A polygon can be moved as a whole using
Polygon#move
.You find a lot details here: http://www.klayout.de/doc/programming/geometry_api.html
Matthias