Implements min_number for segmentation#406
Open
runarberg wants to merge 1 commit into
Open
Conversation
This is implemented with a simple algorithm:
- Compute all distances between subsequent vertices (segments) in the
geometry.
- While the number of vertices is less then the desired number:
- Find the longest (max₁) and the second longest (max₂) segments.
- Find lowest number (n > 1) such that max₁ can be split into
evenly into n segments which are shorter then max₂.
- Split max₁ into n equal segments.
- Add the new vertices to the geometry.
- Update the distance array with the new distances.
resolves JuliaGeo#405
Author
|
I change the algorithm a little from what I originally proposed in #405. The benefits of this one is it is a little more optimized (will require fewer iterations) and it will add vertices in very similar places as I also tried to make sure to retain the inner structure of the geometry (e.g. if using Float32). Other methods don’t do that, but I felt it was worth it to try it. I am using Float32 in my model but |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 implemented with a simple algorithm:
resolves #405