3D-геометрия Scipy Voronoi возвращает каждую границу - PullRequest
1 голос
/ 02 февраля 2020

Так что алгоритм Scipy Voronoi работает относительно хорошо для моего приложения. В трехмерной ситуации данный многоугольник определяется его гранями. Однако алгоритм Вороного не генерирует данные в иерархическом порядке, переходя от вершин к ребрам, затем к граням, а затем к многоугольнику. Имеются данные только о том, какие гребни содержит многоугольник. Как получить список индексов ребер, из которых состоит грань, и, следовательно, список индексов граней, из которых состоит многоугольник? Подробный вывод из алгоритма Вороного в Python:

points  (ndarray of double, shape (npoints, ndim)) Coordinates of input points.
vertices    (ndarray of double, shape (nvertices, ndim)) Coordinates of the Voronoi vertices.
ridge_points    (ndarray of ints, shape (nridges, 2)) Indices of the points between which each Voronoi ridge lies.
ridge_vertices  (list of list of ints, shape (nridges, *)) Indices of the Voronoi vertices forming each Voronoi ridge.
regions (list of list of ints, shape (nregions, *)) Indices of the Voronoi vertices forming each Voronoi region. -1 indicates vertex outside the Voronoi diagram.
point_region    (list of ints, shape (npoints)) Index of the Voronoi region for each input point. If qhull option “Qc” was not specified, the list will contain -1 for points that are not associated with a Voronoi region.

Cheers.

...