Create a polygon buffer from a line polygon

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

  • edited November -1

    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

  • edited April 2016
    Hi 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
  • edited April 2016

    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

Sign In or Register to comment.