SiEPIC / SiEPIC_EBeam_PDK

SiEPIC EBeam PDK & Library, for SiEPIC-Tools and KLayout
http://www.siepic.ubc.ca
Other
205 stars 145 forks source link

How to size a polygon (make by points in array) by a fixed size? #238

Closed Zwlzzm closed 3 years ago

Zwlzzm commented 3 years ago

Hi,

I am trying to size a polygon, like what in "Edit->Selection->Size Shapes" for a polygon in Pcell? I have no idea about this.

The scalling function seems no function for this polygon,as it seems only work function for instantiate. https://klayout.de/doc/about/transformations.html

image

The shape which need to size 0.1um is scripted by :

  for i in range(len(x)):
    pts.append(Point.from_dpoint(DPoint(x[i], y[i])))

  # t = Trans(Trans.R0, x, 0)
  # polygon = Polygon(pts,t)
  polygon = Polygon(pts)
  shapes(LayerSi901).insert(polygon)

Could anyone who knows teell me?

Thank you in advance!