/** * Removes vertices to filter short edges. Only convex vertices are removed, meaning the polygon area can only decrease when calling this method. * @param concaveAngleLimit threshold to define a concavity. 0 rad being flat, negative convex, positive concave. * @param lengthThreshold any edge shorter than that will be removed, if possible. * @param concaveHullVerticesToFilter the vertices of the concave hull to filter. * @return the number of vertices removed. */ public static int filterOutShortEdges(double lengthThreshold, ConcaveHull concaveHullToFilter) { return filterOutShortEdges(lengthThreshold, concaveHullToFilter.getConcaveHullVertices()); }
/** * Removes vertices to filter short edges. Only convex vertices are removed, meaning the polygon area can only decrease when calling this method. * @param concaveAngleLimit threshold to define a concavity. 0 rad being flat, negative convex, positive concave. * @param lengthThreshold any edge shorter than that will be removed, if possible. * @param concaveHullVerticesToFilter the vertices of the concave hull to filter. * @return the number of vertices removed. */ public static int filterOutShortEdges(double lengthThreshold, ConcaveHullCollection concaveHullCollectionToFilter) { int numberOfRemovedVertices = 0; for (ConcaveHull concaveHullToFilter : concaveHullCollectionToFilter) numberOfRemovedVertices += filterOutShortEdges(lengthThreshold, concaveHullToFilter.getConcaveHullVertices()); return numberOfRemovedVertices; }
ConcaveHullPruningFilteringTools.filterOutShortEdges(lengthThreshold, concaveHullCollection);