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

Shrink polygon to more closely meet minimum #3

Open
gordonwoodhull opened this issue Jun 5, 2023 · 2 comments
Open

Shrink polygon to more closely meet minimum #3

gordonwoodhull opened this issue Jun 5, 2023 · 2 comments

Comments

@gordonwoodhull
Copy link
Owner

Since the number of tiles more than doubles each iteration, each triangle being split into 2 or 3, the result is often more than twice as large as needed.

@gordonwoodhull
Copy link
Owner Author

This is a significant problem for use in hexapipes, because it means a huge variation in difficulty for a specific grid size.

Generating tiles just to throw them away is sad, but I think the right solution is to shrink the polygon after generation to get closer to the target.

@gordonwoodhull gordonwoodhull changed the title Too many tiles Shrink polygon to more closely meet minimum Sep 30, 2023
@gordonwoodhull
Copy link
Owner Author

The fill algorithm could be more efficient / elegant if it has "leftover" rhombs to work with, instead of having to run additional passes of generateTriangles().

That elegance would be offset by the bookkeeping for keeping track of a graph of neighboring rhombs where some are included and others are leftovers, but it's worth doing somewhat right. (No need to get into metagraphs here. 😉)

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

No branches or pull requests

1 participant