Comments (3)
Edited the title since I need to add back in the Voronoi feature in general. I'm not sure what people do here when working with constrained triangulations, so for now Voronoi tessellations would probably only be created from unconstrained triangulations.
Trimmed tessellations will still be important. It's very complicated to get it correct apparently...
from delaunaytriangulation.jl.
Now that constrained triangulations and mesh refinement are added, Voronoi tessellations are probably the next important thing to add. I probably won't get around to it for a while, but there was some time ago where I did have this feature, I just wasn't so satisfied with the data structure - e.g. in the data structures in the gist below, do I really need to store a mapping that takes circumcenters to their associated triangle, and triangles to their associated circumcenters? - maybe I should just assume that people will carry with them both Triangulation
and Tessellation
). If all you want is the unbounded tessellations, that's quite easy.
For posterity, here is what I did actually have for Voronoi tessellations (this was incomplete, and the package has been rewritten since). Most of the complexity is in trying to find a way to trim unbounded tessellations so that they clip to the boundary (or the convex hull), since I didn't know much at the time about when circumcenters are outside of the domain.
https://gist.github.com/DanielVandH/83b6a0ce4d6b2866d865f173cd686530
from delaunaytriangulation.jl.
Likely what will end up happening is that I define a struct that can be defined entirely separately from Triangulation
. It should be able to support:
- Accessing all sites
- Accessing all Voronoi cells. This must be a vector rather than a
Set
, since it is typical that we want to enumerate the polygons. - Query the cell adjacent to an edge.
- Query the site adjacent to an edge.
- Query all cells adjacent to a site.
- Query all edges adjacent to a vertex.
- Query all obstacles (for the dual graph to a constrained DT, i.e. a constrained Voronoi or visibility-constrained Voronoi diagram)
- Query all boundary cells
This last point allows for unbounded cells to be queried. When the obstacles include the boundary, this becomes less relevant as all cells will be bounded, so boundary cells might be better named unbounded_cells to make this point clear? Or we can use both.. So, perhaps something like
struct VoronoiTessellation # (or just Tessellation? too close to Triangulation maybe)
sites::P # the circumcenters + added points from obstacles
polygons::Vector{VoronoiCell} # the polygons
adjacent_cell::Adjacent{Int64, NTuple{2, Int64}} # map edge to adjacent polygon
adjacent_site::Adjacent{Int64, NTuple{2, Int64}} # map edge to adjacent site
site_to_cells::Adjacent2Vertex{Int64, VoronoiCell, Int64}
site_to_sites::Graph{Int64}
cell_to_cells::Graph{Int64} # maybe?
obstacles::Set{NTuple{2, Int64}}
boundary_cells::Set{Int64}
unbounded_cells::Set{Int64}
end
struct VoronoiCell
nodes::Vector{Int64}
end
These data structures need also support point location and (equivalently, actually) nearest neighbour queries. Not sure if we should just use methods for searching planar subdivisions, or somehow re-use the jump and march code so that the problem becomes taking a triangle to its associated Voronoi cell (derived from its circumcenter). In this latter case, there are two options:
- Store the triangulation in the
VoronoITessellation
. I'm not so sure about this, but we could. - If people want to perform point location, they provide both the
VT
and theDT
I don't intend to add support for point deletion/insertion or obstacle insertion for Voronoi tessellations. Not against it, but I don't have a need for it.
e: Using site pretty loosely here. I probably mean polygon vertex in most cases.
from delaunaytriangulation.jl.
Related Issues (20)
- Error precompiling due to missing method for ExactPredicates v2.2.5, with Julia 1.8.0 and DelaunayTriangulation v0.7.1 HOT 3
- Add better default methods for interface methods
- Goals for 1.0 HOT 1
- A problem when installing DelaunayTriangulation HOT 2
- Move MakieCore code into Makie.jl
- vertex iterators not updated with `delete_boundary_vertices_from_graph!`
- Integer division error with Float32 for clipped Voronoi HOT 7
- All coordinates should be internally converted to Float64
- Use Graphs.jl instead of SimpleGraphs.jl
- Voronoi treemap HOT 2
- UndefVarError: `triplot` not defined HOT 10
- Infinite loop due to zero-area triangle but positive oriented according to ExactPredicates.jl
- delete_point! fails for link with concave triangular-indent
- Document -1 HOT 1
- Delete_point HOT 3
- Added points which are on the boundary are added to the constrained segments HOT 5
- Fix doc image in curve-bounded domains tutorial
- Invalid `convex_hull` when points are repeated HOT 5
- Add an alias `find_triangle` for `jump_and_march`
- Performance audit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delaunaytriangulation.jl.