Find nearest edge in graph

前端 未结 5 1109
慢半拍i
慢半拍i 2021-02-04 02:43

I want to find the nearest edge in a graph. Consider the following example: \"yellow:

5条回答
  •  梦谈多话
    2021-02-04 03:38

    Without proof:
    You start with a constrained Delaunay Triangulation, that is a triangulation that takes the existing edges into account. E.g. CGAL or Triangle can do this. For each query point you determine which triangle it belongs to. Then you you only have to check the edges touching a corner of that triangle.
    I think this should work in most cases, but there are certainly corner cases where it fails, e.g. when there are many vertices without any edge at all, so at least you have to remove those empty vertices.

提交回复
热议问题