I have had a big problem using scipy.spatial.Delaunay function.
I initialize a variable named tri as it follows:
tri = Delaunay(ApsArray, incremental=True)
This code works perfectly, but since I have to use this triangulation in a for loop, I want to copy tri in another variable named triTemp (as a temporal variable).
I searched in python documentation and I found in the copy module, deepcopy, which permits me to copy tri in another site in memory pointed by triTemp:
triTemp = deepcopy(tri)
It works!, but when I try to add a new point to triTemp, this error appears:
Traceback (most recent call last):
File "C:\Users\user\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2883, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-77-2f5ca634bc26>", line 1, in <module>
tri.add_points([[0.2,0.3]])
File "qhull.pyx", line 1544, in scipy.spatial.qhull._QhullUser.add_points (scipy\spatial\qhull.c:13938)
File "qhull.pyx", line 446, in scipy.spatial.qhull._Qhull.add_points (scipy\spatial\qhull.c:4954)
TypeError: 'NoneType' object is not subscriptable
I have thought that the problem is with the parameter incremental because triTemp, is simply a copy in memory of tri, but my problem is that I don't know how to change this parameter without initializing triTemp again.
I want to use a copy, and not to calculate the triangulation again, because I think that it is more efficient, so if someone knows a method to reach this objective, please tell me.
Thanks to all, and sorry for the bad English!