You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using this package on Julia 0.5.2 and I sometimes get that the union of the triangles in the triangulation does not equal the convex hull of the points, which is a property of Delaunay triangulation. I include an easy example to show this:
using Plots, VoronoiDelaunay
min_coord=VoronoiDelaunay.min_coord
max_coord=VoronoiDelaunay.max_coord
function pointsRescaledCoords(x,y) #To be used for tessellation
Point2D[Point((max_coord-min_coord)/(maximum(x)-minimum(x))*(x[i]-maximum(x))+max_coord,
(max_coord-min_coord)/(maximum(y)-minimum(y))*(y[i]-maximum(y))+max_coord) for i in 1:length(x)]
end
#First shape
X = [0.0; 0.0; 1.0; 0.6; 1.0]
Y = [0.0; 1.0; 1.0; 0.8; 0.0]
display(plot(Shape(X,Y), opacity=.5,xlims = (-0.05,1.05),ylims=(-0.05,1.05)))
tess = DelaunayTessellation()
push!(tess,pointsRescaledCoords(X,Y))
#Display delaunayedges
x, y = getplotxy(delaunayedges(tess))
display(plot(x-min_coord,y-min_coord,xlims = (-0.05,1.05),ylims=(-0.05,1.05)))
#Second shape
X = [0.0; 0.0; 1.0; 0.6; 1.0]
Y = [0.0; 1.0; 1.0; 0.79; 0.0] #Fourth element changed from 0.8 to 0.79
display(plot(Shape(X,Y), opacity=.5,xlims = (-0.05,1.05),ylims=(-0.05,1.05)))
tess = DelaunayTessellation()
push!(tess,pointsRescaledCoords(X,Y))
x, y = getplotxy(delaunayedges(tess))
plot(x-min_coord,y-min_coord,xlims = (-0.05,1.05),ylims=(-0.05,1.05))
When using the first shape the union of the triangles in the triangulation does not equal the convex hull of the points but when using the second shape they do. The only difference between the shapes is that I have changed the fourth element in Y from 0.8 to 0.79 in the second shape.
Am I doing something wrong? It seems to me that somethings strange is happening when I do the triangulation on the first shape and I don't understand why.
The text was updated successfully, but these errors were encountered:
nako95
changed the title
Union of triangels is not always equal to the convex hull?
Union of triangels is not always equal to the convex hull when using VoronoiDelaunay?
Aug 10, 2017
nako95
changed the title
Union of triangels is not always equal to the convex hull when using VoronoiDelaunay?
Union of triangles is not always equal to the convex hull when using VoronoiDelaunay?
Aug 10, 2017
…on and handling points outside [1,2]x[1,2]
Non-convexity of the tessellation means we are missing triangles.
A non-convex tessellation is obtained, if at least one of the corner points of the initial square lies inside the circumcircle of a missing triangle.
This problem is solved by scaling and shifting the points such that the union of the circumcircles of the triangles along the boundary of the tessellation lies inside (1,2)x(1,2).
With this modification it is now possible to start off with a point set outside [1,2]x[1,2].
Apply the function scaleShiftPoints to the point set before the tessellation and the function expand to the edge vertices after the tessellation.
I'm using this package on Julia 0.5.2 and I sometimes get that the union of the triangles in the triangulation does not equal the convex hull of the points, which is a property of Delaunay triangulation. I include an easy example to show this:
When using the first shape the union of the triangles in the triangulation does not equal the convex hull of the points but when using the second shape they do. The only difference between the shapes is that I have changed the fourth element in Y from 0.8 to 0.79 in the second shape.
Am I doing something wrong? It seems to me that somethings strange is happening when I do the triangulation on the first shape and I don't understand why.
The text was updated successfully, but these errors were encountered: