Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is still a work in progress⚠️
This is a large amount of changes that was hinted at in #13. I probably put in more then I wanted to in this PR, but I like the way the library is laid out more personally. There is not a large wrapping class here but a series of small structures that all operate inside a single method. The return from this method is just the halfedges and triangles indexes.
What you input as coords is now changed too, it is a templated point type that you can assign a custom getter and setter. This means that any custom point types now work. Example below:
Internally there are lots of other changes, the hash is now its own struct and the finding items in the cache is pulled out of the main loop into a method. The hull is also pulled out into its own structure as well.
The current performance bottleneck is in the
legalize()
method. I have commented the biggest culprit of that is caused by a cache miss. This isn't any different in the previous implementation which has a big cache miss here as well when it travels to thecoords
in that previous version to get the x,y values for thein_circle()
function.We might be able to optimize this away further if we wanted to store the x,y values in the triangle index structure, but this would likely be a potentially massive allocation as the number of triangles is rather large.