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

RegularPolygon implementation #82

Open
novialriptide opened this issue Sep 20, 2022 · 2 comments
Open

RegularPolygon implementation #82

novialriptide opened this issue Sep 20, 2022 · 2 comments
Labels
priority:RELEASEBLOCKER submodule:polygon type:cleanup Includes moving code, refactoring or reformat type:enhancement New feature or request type:new_api Adds new functionalities to the project

Comments

@novialriptide
Copy link
Member

@Emc2356 has already done a PR that does exactly this, but not in what I hoped. #73

To recap, the function is supposed to create a polygon with sides of equal length.

I was thinking of either reimplementing his PR's design to look more like this:

def RegularPolygon(pos, radius) -> Polygon

# So we would use it like this
geometry.RegularPolygon(...)

Or we can do something like this

class RegularPolygon(Polygon):
   def __init__(self, pos, radius): ...

If RegularPolygon becomes a child class of Polygon, the user would be able to modify its radius, origin_pos, etc on the go, where as if we implement the function method, the user would need to create a new Polygon when they want to change its radius as well as using a for loop to change every point to the Polygon

@novialriptide novialriptide added type:enhancement New feature or request type:new_api Adds new functionalities to the project submodule:polygon type:cleanup Includes moving code, refactoring or reformat labels Sep 22, 2022
@novialriptide novialriptide pinned this issue Sep 24, 2022
@itzpr3d4t0r
Copy link
Member

As a short term solution we can go for (1), i'm fine with that.

@novialriptide
Copy link
Member Author

I would like this issue to stay open for now. I feel like we can do better than just creating a new function to create a regular polygon.

@novialriptide novialriptide reopened this Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:RELEASEBLOCKER submodule:polygon type:cleanup Includes moving code, refactoring or reformat type:enhancement New feature or request type:new_api Adds new functionalities to the project
Projects
None yet
Development

No branches or pull requests

2 participants