gpt4 book ai didi

python - Qhull 凸包要求我输入至少 3 个点

转载 作者:行者123 更新时间:2023-12-01 09:28:18 25 4
gpt4 key购买 nike

Update: I've decided to try to use a linear programming package in order to determine if the vertices of the two polytopes are linearly separable. (The vertices are really my data, not the polytopes.) I think this will work better, so I no longer need an answer to this question.

我正在编写一些代码,涉及检查某些多胞体是否不相交。这些多面体由其顶点的凸包定义,我使用 Qhull 创建凸包。特别是,我正在使用以下方法:

from scipy.spatial import ConvexHull

这工作得很好,只是有时我的集合中只有 2 或 1 个点。 Qhull 不喜欢这样,它会抛出这个错误:

QhullError: QH6214 qhull input error: not enough points(1) to construct initial simplex (need 3)

While executing: | qhull i Qt Options selected for Qhull 2015.2.r 2016/01/18: run-id 109084531 incidence Qtriangulate _pre-merge _zero-centrum

虽然我可以通过编写一些子例程来捕获少于 3 个点的情况来处理这个问题,但令人沮丧的是 Qhull 不处理这种情况。所以我正在寻找:

1) 让 Qhull 正确处理这个问题的简单方法

2) 使用替代包

谢谢!

最佳答案

QHull 实际上不必处理一个或两个顶点(或 d 维中的 d-1 个顶点)的多面体,因为它们必然有自己的凸包(并且它们是单纯形)。

检查数字是否较低并将输入传输到输出。

关于python - Qhull 凸包要求我输入至少 3 个点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50185446/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com