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

Add Helper Functions to Create Areas Based on Shapes #129

Open
Chris3606 opened this issue Jun 17, 2023 · 0 comments
Open

Add Helper Functions to Create Areas Based on Shapes #129

Chris3606 opened this issue Jun 17, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Chris3606
Copy link
Contributor

Currently, a user can create an Area based on a shape by doing new Area(Shapes.GetCircle((1, 2), 3)). While this works, it isn't obvious that users would need to look in the Shapes class to create an area based on that shape, so some forwarding functions might be nice here.

One possible downside, though, is it might promote inefficient code. Consider if a user has a function which takes an IEnumerable<Point>, and does this: MyFunc(Area.FromCircle((1, 2), 3). This negates the benefits of the custom enumerator and lazy evaluation you get with Shapes.GetCircle() and causes quite a large amount of temporary allocation.

@Chris3606 Chris3606 added the enhancement New feature or request label Jun 17, 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

1 participant