【发布时间】:2019-08-22 21:58:06
【问题描述】:
我正在寻找 Python 中 3D 中点到 ConvexHull 对象的距离。
我找到了解决 2D 问题的问题: Distance to convexHull 和 Computing the distance to a convex hull
但那些不包含 3D 的解决方案。
import numpy as np
from scipy.spatial import ConvexHull
mat = np.random.rand(100,3)
hull = ConvexHull(mat)
points = np.random.rand(10,3)
有功能就好了
dist(hull,points)
返回从点到凸包的距离列表,对于凸包内部和外部的点具有不同的符号。
【问题讨论】:
-
@meowgoesthedog 我引用了另一个问题并澄清:我需要一个 3d 解决方案,而那个解决方案只提供 2d。
标签: python 3d distance convex-hull