You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Scipy 3D Delaunay点集平移后结果不一致问题咨询

3D Delaunay网格平移后结果不一致的原因

我原本认为给定一组点的3D Delaunay网格是唯一的,但平移所有点(不改变相对距离)后得到了不同的结果。

测试代码如下:

import numpy as np
from scipy.spatial import Delaunay

points = np.array([ [-0.6, -0.1, -1.5], [0, 0, 0], [-1,-1,-1],[1, 0, 1], [1, 1, 2], [0, 1.1, -1]])
points = points+[0,5,0] # 平移操作

tri = Delaunay(points)

对比两种情况的结果,发现连接矩阵存在差异:

情况0:未平移 连接矩阵:

array([[0., 1., 1., 1., 0., 0.],
       [1., 0., 1., 1., 1., 1.],
       [1., 1., 0., 1., 0., 1.],
       [1., 1., 1., 0., 1., 1.],
       [0., 1., 0., 1., 0., 1.],
       [0., 1., 1., 1., 1., 0.]])

情况1:沿y轴平移5个单位 连接矩阵:

array([[0., 1., 0., 1., 0., 1.],
       [1., 0., 1., 1., 1., 0.],
       [0., 1., 0., 1., 0., 1.],
       [1., 1., 1., 0., 1., 1.],
       [0., 1., 0., 1., 0., 1.],
       [1., 0., 1., 1., 1., 0.]])

连接矩阵的计算方式:

matrix = np.zeros((len(points),len(points)))

for triangle in tri.simplices:
    for i in range(4): 
        point_initial = triangle[i] 
        point_final = triangle[(i+1)%4] 

        if matrix[point_initial,point_final] == 1:
            continue
        
        matrix[point_initial,point_final] = 1
        matrix[point_final,point_initial] = 1

同时两种情况下的tri.simplices也存在差异:
未平移时:

array([[1, 4, 3, 2],
       [1, 4, 5, 2],
       [1, 4, 5, 3],
       [1, 0, 3, 2],
       [1, 0, 5, 2],
       [1, 0, 5, 3]], dtype=int32)

平移后:

array([[1, 4, 3, 2],
       [1, 4, 5, 2],
       [1, 4, 5, 3],
       [0, 1, 3, 2],
       [0, 1, 5, 2],
       [0, 1, 5, 3]], dtype=int32)

请问这是什么原因导致的?


内容的提问来源于stack exchange,提问作者geofisue

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.03 14:20:40