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

[Feature request] More Box/Rectangle operations? #30

Open
alexanderkjeldaas opened this issue Oct 7, 2019 · 2 comments
Open

[Feature request] More Box/Rectangle operations? #30

alexanderkjeldaas opened this issue Oct 7, 2019 · 2 comments

Comments

@alexanderkjeldaas
Copy link

For working with Boxes / Rectangles, it might make sense to have concepts splitting a rectangle into 2, 4, or 9 subrectangles, and having concepts such as West/East, North/South, NorthWest, NorthEast, SouthWest, SouthEast, Center.

@alexanderkjeldaas
Copy link
Author

How about relations between bounding boxes?

data DisjointDirection = West | East | ...
data Intersection = Contained | Contains
data Direction = DisjointDirection DisjointDirection
                         | Intersection Intersection
rectangleRelation :: Rectangle -> Rectangle -> Direction

@noinia
Copy link
Owner

noinia commented Oct 17, 2019

I'm all for adding more functions for working with boxes and rectangles. For splitting a rectangle I guess we could implement something with type : Rectangle p r -> Matrix n m (Rectangle (Maybe p) r) or so. For boxes ideally you would have an higher dimensional equivalant of that.

By West/East/North/South etc you mean regions the regions in the plane that you get by considering the supporting lines of the edges I guess? That seems reasonable.

I'm not sure what rectangleRelation from your second post is supposed to model exactly? I.e. what should the rectangle relation between a unit square from (0,0) to (1,1) and a rectangle (2,-10),(3,10) be? what if the upper coordinate is (3,100000000) ?

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

No branches or pull requests

3 participants