Add support for generating 2D discrete fields #22
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.
The 2D generation works almost exactly like the 3D one. The signatures were matched as closely as possible and programs are included similar to the 3D solution (GenerateSDF2D, DiscreteFieldToBitmap2D).
Note that for the examples Clipper2 library is used to convert a triangle mesh to a polygon before discretization. However, this dependency is optional and the solution (without the two programs) works without it as well, if the user defines their own polygon structure consistent of vertices and edges to discretize.
If anything in my code is not to up to the standards of the maintainers of Discregrid, please tell me how I can fix things so this pull request can be merged.