![](/img/trans.png)
[英]How can I use the Delaunay triangulation to output a matrix with all the connections in the triangulation and their distances?
[英]How can I copy a Delaunay triangulation to new points?
我目前正在scipy.spatial.Delaunay中使用Delaunay函數,如下所示(簡化):
import numpy as np
from scipy.spatial import Delaunay
points1 = np.random.rand(10,2)
points2 = np.random.rand(10,2)
tri = Delaunay(points1)
# tri2 = tri(points2)? - need help here
我想對point2應用相同的三角剖分-如果我再次運行Delaunay,則可能會得到不同的三角剖分。
是否可以“復制”一個三角剖分並將其應用於相同大小的不同點集?
為了完整起見,基於戴維斯·赫林(Davis Herring)在評論中的回應,
tri.simplices
包含輸入的索引之間的關系,並且不依賴於實際值。
例如,如果我在points[0]
, points[3]
和points[4]
之間得到一個三角形,則tri.simplices
將包含[0,3,4]
。
因此,要使用不同的“點”訪問相同的三角剖分,我可以像這樣訪問它們:
points2[tri.simplices]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.