/** * Find the closest edge to a vertex that is visible from the inside of the polygon. In other * words, the line that goes from the given vertex to the computed closestPoint is entirely * inside the polygon. * * @param vertexIndex the close edge to this vertex. * @param deadIndexRegion the search algorithm starts at * {@code vertexIndex + deadIndexRegion + 1} and ends at * {@code vertexIndex - deadIndexRegion - 1} * @param concaveHullVertices the vertices of the concave hull on which the search is to be * performed. * @param closestPointToPack coordinates of the closest point found. * @return the index of the closest edge first vertex. */ public static int findInnerClosestEdgeToVertex(int vertexIndex, int deadIndexRegion, List<? extends Point2DReadOnly> concaveHullVertices, Point2DBasics closestPointToPack) { int startSearchIndex = next(vertexIndex, concaveHullVertices); int endSearchIndex = previous(vertexIndex, concaveHullVertices); return findInnerClosestEdgeToVertex(vertexIndex, startSearchIndex, endSearchIndex, concaveHullVertices, closestPointToPack); }
int closestEdgeFirstVertexIndex = findInnerClosestEdgeToVertex(currentIndex, deadIndexRegion, concaveHullVerticesToFilter, closestPoint);