JuliaGeometry / VoronoiDelaunay.jl

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

Restrict Voronoi edges to [1,2]^2 #17

Open robertdj opened 8 years ago

robertdj commented 8 years ago

The Voronoi edges near the edges of the square [1,2]^2 often have an endpoint way outside of the square. Is it possible -- in the voronoiedges function -- to restrict the line segments such that both endpoints are always inside or on the border of the square?

skariel commented 8 years ago

the current behaviour is correct, the only thing restricted inside the allowed region is the generator points, so yes, the Voroni cells can go outside, I don't see a problem here

Edit: typo

robertdj commented 8 years ago

It's definitely correct if you want the unrestricted Voronoi tesselation. But sometimes I want the intersection of the tessellation with allowed region. It's of course possible to compute intersections between the line segments and the square, but it would be nice to avoid it.

skariel commented 8 years ago

you have a point, I'm tagging this as "enhancement"

valiaaeft commented 1 year ago

@robertdj Can you provide a concrete example on what you want ? I may be interested to implement it