JuliaGeometry / VoronoiDelaunay.jl

Fast and robust Voronoi & Delaunay tessellation creation with Julia
Other
124 stars 26 forks source link

Retrieve list of connectivities #21

Closed juliohm closed 8 years ago

juliohm commented 8 years ago

Can we retrieve the list of connectivities with this package? The main purpose of creating a triangulation is to be able to get the triangles back, right?

skariel commented 8 years ago

yes, of course. There's a sample in the README. You iterate over the edges like this:

for edge in delaunayedges(tess)

each edge has a function geta() and getb() to get the original nodes.

you can also walk the tessellation. First locate a triangle:

t = locate(tess, Point(1.2, 1.3))

then walk:

t = movea(tess, t)  # move to the direction infront of generator a
t = moveb(tess, t)  # move to the direction infront of generator b
t = movec(tess, t)  # move to the direction infront of generator c

you can also just iterate over triangles. The api is very general. If there is something you want to do but are unable, just file a feature request, or a bug

EDIT: here's how to iterate over triangles, its explained in the readme:

for delaunaytriangle in tess
juliohm commented 8 years ago

Ok, I didn't see the iteration over triangles in the README. Closing the issue.