Finding near neighbors

前端 未结 3 541
梦如初夏
梦如初夏 2021-02-07 07:12

I need to find \"near\" neighbors among a set of points.

\"pointSet\"

There are 10 points in the above imag

3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-07 07:41

    I would agree that shared cell edges is a good neighbor criterion (based on this example). If you were using a mesh-oriented data structure (like something from Gts), then identifying shared edges would be trivial.

    Matlab, on the other hand, makes this more "interesting". Assuming the voronoi cells are stored as patches, you might try obtaining the 'Faces' patch property (see this reference). That should return something like an adjacency matrix that identifies connected vertices. From that (and a little magic), you should be able to determine shared vertices, and then infer shared edges. In my experience, this sort of "search" problem is not well suited to Matlab - if possible, I recommend moving to a system more suited to queries of mesh connectivity.

提交回复
热议问题