-
Notifications
You must be signed in to change notification settings - Fork 6
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
Spherical triangulations, tessellation #187
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #187 +/- ##
==========================================
- Coverage 94.82% 93.07% -1.76%
==========================================
Files 103 111 +8
Lines 10364 10805 +441
==========================================
+ Hits 9828 10057 +229
- Misses 536 748 +212 ☔ View full report in Codecov by Sentry. |
@asinghvi17 This is a working implementation of spherical delaunay + voronoi. It also supports mesh refinement (the points inserted are the centroids [the ones that split the spherical triangles into equal-area regions, not the median] instead of circumcircles, seems to be more visually appealing). I think with this implementation the Screen.Recording.2024-09-22.132518.mp4Maybe you would like to try this branch out at some point to see what you think? The code is in the |
Some thoughts (for this PR and also for what needs to be done in NaturalNeighbours)
For NaturalNeighbours:
|
That sounds good. I got triangulation and Voronoi tessellation running for my test cases, but have not yet tried NaturalNeighbours. Will hopefully get to that today. Out of curiosity, have you considered implementing the GeoInterface for Voronoi tessellations (maybe as a feature collection)? It was a bit hard for me to parse how to get a list of points per polygon out, and having them be GeoInterface polygons would allow things like Makie plotting, writing to shapefile, etc. to "just work". |
Great!
I've never used any of the GeoInterface stuff, so I've not ever looked into it. Is it something that can exist as a package extension? I don't really want to enforce any sort of interface that requires a dependency by default. Also regarding getting the coordinates: There are a few different ways. What did you end up using? Maybe I need to improve the documentation here. |
I think GeoInterface could probably be implemented in a package extension, but there is an argument to be made that you can use it as a fallback for methods like
vpolys = [
[get_polygon_point(vorn, i) for i in DelTri.get_polygon(vorn, j)]
for j in Iterators.filter(!in(DelaunayTriangulation.get_unbounded_polygons(vorn)), DelTri.each_polygon_index(vorn))
] (seems pretty involved but I couldn't see a better way to do it) |
I get that it can be useful for something like that, but another main concern for me is that, if I make it the default fallback, it's a bit of extra maintenance on my part since I don't really ever use any of that stuff myself, if that makes sense? I'd be happy to maintain it as an extra extension but maybe not as a fallback. -- For the coordinates.. I guess that is probably not a bad way.
is the same as Maybe a method |
I'm still yet to come back to this but just curious if you got around to trying it with NaturalNeighbours @asinghvi17? No problem if not but if you have feel free to let comment any other issues I need to fix. |
peek
so that NaturalNeighbours might just work directly (?)This PR introduces spherical triangulations and tessellations. Ghost vertices are interpreted as the north pole. Pretty experimental for now.