heitzmann / gdspy

Python module for creating GDSII stream files, usually CAD layouts.
Boost Software License 1.0
352 stars 128 forks source link

how to calculate area for polygon? #197

Closed hujunchao closed 2 years ago

hujunchao commented 3 years ago

@heitzmann Hi, I meet a question that how to calculate area for polygon when polygon is irregular? Look forward to your reply!

tvt173 commented 3 years ago

@hujunchao if you cast the polygon to a Polygon type, you can simply use the area() method to calculate the area https://gdspy.readthedocs.io/en/stable/reference.html#gdspy.Polygon.area