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

Different polygon slicing method #14

Open
luucvanderzee opened this issue Jul 16, 2019 · 0 comments
Open

Different polygon slicing method #14

luucvanderzee opened this issue Jul 16, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@luucvanderzee
Copy link
Collaborator

luucvanderzee commented Jul 16, 2019

To slice polygons into N pieces, we are using the same method as transformr and flubber, which is to

  1. triangulate a polygon
  2. take the smallest triangle (or, after some triangles have been merged, polygon)
  3. merge it with the first found neighbor
  4. compute area of the resulting polygon
  5. repeat step 2 - 4 until the number of polygons/triangles is equal to N

This is pretty slow. I wonder if there is a faster way to do this. PolyK seems to be able to slice polygons without triangulation (see this, doesn't support holes tho). If we could figure out a quick way to find a line that approximately cuts a polygon in half, we could just keep cutting the biggest polygon in half until we have the desired number of pieces N. I suspect that to be faster.

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