I have a set of points, from which I calculate a Delaunay triangulation using the scipy.spatial.Delaunay function. Something along the following for example:
import numpy as np
from scipy.spatial import Delaunay
tri = Delaunay(np.random.rand(10,2))
What I want to do after this is calculated is remove a simplex. Is there an easy way to do this? I notice the Delaunay object has a method for add_point
but nothing for remove_point
or remove_simplex
.
The way I see it, I have two options. I know the list of points myself so I simply remove the necessary points and re-calculate the Delaunay triangulation. I hope to avoid this as it can become inefficient if I have to re-calculate a lot for a lot of points. The other option I can see is to directly edit the object parameters myself, but this seems like a potentially dangerous method. Does anyone have any suggestions of a better method?
The Delaunay result is a numpy object.You can choose the simplex you need.