【发布时间】:2014-09-04 04:07:31
【问题描述】:
我正在尝试使用SciPy wrapper for QHull 获取一组点的凸包体积。
根据documentation of QHull,我应该通过"FA" 选项来获得总表面积和体积。
这就是我得到的......我做错了什么?
> pts
[(494.0, 95.0, 0.0), (494.0, 95.0, 1.0) ... (494.0, 100.0, 4.0), (494.0, 100.0, 5.0)]
> hull = spatial.ConvexHull(pts, qhull_options="FA")
> dir(hull)
['__class__', '__del__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_qhull', '_update', 'add_points', 'close', 'coplanar', 'equations', 'max_bound', 'min_bound', 'ndim', 'neighbors', 'npoints', 'nsimplex', 'points', 'simplices']
> dir(hull._qhull)
['__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
【问题讨论】:
-
尝试用一个真实的问题来更新你的问题(不是“这就是我得到的”)。我花了一段时间才弄清楚总面积和体积在哪里都找不到,尽管事实上您提供了正确的选项。
-
我的猜测是 SciPy 没有包装那个特定的选项标志。
-
完成
pts会有所帮助。这样我们就可以自己尝试了。 -
它没有在 Scipy Qhull 包装器中实现。如果需要,可以轻松添加。
标签: python scipy convex-hull qhull