Skip to content

Add Helper Functions to Create Areas Based on Shapes #129

@Chris3606

Description

@Chris3606

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions