Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the size of Polygon with points? #226

Open
EnesBae opened this issue Dec 22, 2023 · 1 comment
Open

How to change the size of Polygon with points? #226

EnesBae opened this issue Dec 22, 2023 · 1 comment

Comments

@EnesBae
Copy link

EnesBae commented Dec 22, 2023

Is there any way to adjust the size of Polygon with points?

For example, +1 (up) -1 (down) in the y direction
[[1,1], [2,1], [2,3], [1,3]] → [[1,0], [2,0], [2,4], [1,4]]

It is complicated to apply it to various cases as a "scale" method,
so I want to change it using numbers, but it is impossible to change it because the points attribute is read-only.

Thank you for your help.

@heitzmann
Copy link
Owner

There are several transformation methods you can use to change the polygon coordinates: scale, rotate, mirror, transform, translate - https://heitzmann.github.io/gdstk/geometry/gdstk.Polygon.html

If you need something even more general that those transforms, you'll have to create a new polygon and replace the old one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants