C# Класс FarseerPhysics.Common.PolygonManipulation.SimplifyTools

Provides a set of tools to simplify polygons in various ways.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
collinearSimplify ( Vertices vertices, float collinearityTolerance ) : Vertices

Removes all collinear points on the polygon.

douglasPeuckerSimplify ( Vertices vertices, float distanceTolerance ) : Vertices

Ramer-Douglas-Peucker polygon simplification algorithm. This is the general recursive version that does not use the speed-up technique by using the Melkman convex hull. If you pass in 0, it will remove all collinear points.

mergeIdenticalPoints ( Vertices vertices ) : Vertices

Merges the identical points in the polygon.

mergeParallelEdges ( Vertices vertices, float tolerance ) : Vertices

Merges all parallel edges in the list of vertices

reduceByArea ( Vertices vertices, float areaTolerance ) : Vertices

Simplify the polygon by removing all points that in pairs of 3 have an area less than the tolerance. Pass in 0 as tolerance, and it will only remove collinear points.

reduceByDistance ( Vertices vertices, float distance ) : Vertices

Reduces the polygon by distance.

reduceByNth ( Vertices vertices, int nth ) : Vertices

Reduces the polygon by removing the Nth vertex in the vertices list.

Приватные методы

Метод Описание
simplifySection ( Vertices vertices, int i, int j, bool usePoint, float distanceTolerance ) : void

Описание методов

collinearSimplify() публичный статический Метод

Removes all collinear points on the polygon.
public static collinearSimplify ( Vertices vertices, float collinearityTolerance ) : Vertices
vertices Vertices The polygon that needs simplification.
collinearityTolerance float The collinearity tolerance.
Результат Vertices

douglasPeuckerSimplify() публичный статический Метод

Ramer-Douglas-Peucker polygon simplification algorithm. This is the general recursive version that does not use the speed-up technique by using the Melkman convex hull. If you pass in 0, it will remove all collinear points.
public static douglasPeuckerSimplify ( Vertices vertices, float distanceTolerance ) : Vertices
vertices Vertices
distanceTolerance float
Результат Vertices

mergeIdenticalPoints() публичный статический Метод

Merges the identical points in the polygon.
public static mergeIdenticalPoints ( Vertices vertices ) : Vertices
vertices Vertices The vertices.
Результат Vertices

mergeParallelEdges() публичный статический Метод

Merges all parallel edges in the list of vertices
public static mergeParallelEdges ( Vertices vertices, float tolerance ) : Vertices
vertices Vertices The vertices.
tolerance float The tolerance.
Результат Vertices

reduceByArea() публичный статический Метод

Simplify the polygon by removing all points that in pairs of 3 have an area less than the tolerance. Pass in 0 as tolerance, and it will only remove collinear points.
public static reduceByArea ( Vertices vertices, float areaTolerance ) : Vertices
vertices Vertices
areaTolerance float
Результат Vertices

reduceByDistance() публичный статический Метод

Reduces the polygon by distance.
public static reduceByDistance ( Vertices vertices, float distance ) : Vertices
vertices Vertices The vertices.
distance float The distance between points. Points closer than this will be removed.
Результат Vertices

reduceByNth() публичный статический Метод

Reduces the polygon by removing the Nth vertex in the vertices list.
public static reduceByNth ( Vertices vertices, int nth ) : Vertices
vertices Vertices The vertices.
nth int The Nth point to remove. Example: 5.
Результат Vertices