i construct two Delaunay triangulations from two different numpy arrays of vertices.
They have two identical triangles, which i want to delete from one of the triangulation list.
If somebody can help me out here i would really appreciate it. Thanks in advance.
cloud1 = numpy.array([[4.2, 4.5], [4.4, 5.3], [6.2, 5.6], [4.75, 5], [5.2, 4.8]])
cloud2 = numpy.array([[4.2, 4.5], [4.4, 5.3], [6.2, 5.6], [4.75, 5]])
tri1 = scipy.spatial.Delaunay(cloud1)
tri2 = scipy.spatial.Delaunay(cloud2)
print(tri1.simplices)
print("*************")
print(tri2.simplices)
It gives that
[[1 3 2]
[3 4 2]
[3 1 0]
[4 3 0]]
*************
[[2 3 0]
[3 1 0]
[1 3 2]]
I wrote this but it doesn't work.
for i in range(0,len(tri1.simplices)):
if (tri1.simplices[i] in tri2.simplices):
numpy.delete(tri1.simplices, tri1.simplices[i])
else:
continue