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

Provide polygon-to-circle utilities in python #156

Open
95-martin-orion opened this issue Mar 24, 2023 · 0 comments
Open

Provide polygon-to-circle utilities in python #156

95-martin-orion opened this issue Mar 24, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@95-martin-orion
Copy link

In Polygon::to_oas, there is a section for converting "circular" polygons to their idealized (center, radius) representation. This behavior can be useful outside of OASIS conversion - for example, when working with imported GDS designs, or for exporting to other file formats (notably Gerber, which prompted this request: gdsfactory/gdsfactory#1466).

The request is to add the following methods to the Python API:

# In gdstk.Polygon
def as_circle(self, tolerance: float) -> tuple[tuple[float, float], float]:
    """If this polygon is a circle within `tolerance`, returns its (center, radius) representation."""
@heitzmann heitzmann added the enhancement New feature or request label Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants