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

Some way to have circular bounds? #7

Open
entropylost opened this issue May 27, 2021 · 4 comments
Open

Some way to have circular bounds? #7

entropylost opened this issue May 27, 2021 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@entropylost
Copy link

entropylost commented May 27, 2021

I would like to have a circular boundary for my voronoi diagram, or at least a close approximation using polygons. This could be done by replacing the bounding-box with a Polygon type.

@andreesteve
Copy link
Owner

This sounds very interesting! In principle, as you pointed out, the bounding box would have to be replaced with a more generic construct. The code does have some assumptions right now that the constraint is a rectangle so the clipping logic would have to be changed as well. I wonder if all assumptions currently made for clipping on a box would apply to a generic convex polygon.

@andreesteve andreesteve added enhancement New feature or request help wanted Extra attention is needed labels May 27, 2021
@entropylost
Copy link
Author

Perhaps just assume that the points are generated within the polygon or bounding box but clip all the lines to it?

@SPuntte
Copy link

SPuntte commented Jul 30, 2022

I realize this issue is over a year old, but what I've been doing in my fork recently seems closely related. I can't honestly claim to understand all the details of the diagram generation logic in this library yet but so far it certainly seems to generalize pretty straightforwardly to arbitrary convex polygons.

@andreesteve, maybe a separate issue would be appropriate if you're interested in collaborating on this?

@andreesteve
Copy link
Owner

Hi @SPuntte - thanks for looking into this ! I believe indeed generalizing the bounding box into a convex polygon and the clipping algorithm into Sutherland–Hodgman is a good way to go, and would be a great addition to the library.

I think such a change would be welcomed to the library. Especially if we can bring the generalization with similar benchmark results when the polygon is a bounding box.

We can use this issue or file a new one. No preference from my side. If we file a new one, I'd duplicate this issue against that. Let me know your thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants