C# Class FarseerPhysics.Common.PolygonManipulation.SimplifyTools

Provides a set of tools to simplify polygons in various ways.
Afficher le fichier Open project: prime31/Nez Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
simplifySection ( Vertices vertices, int i, int j, bool usePoint, float distanceTolerance ) : void

Method Details

collinearSimplify() public static méthode

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.
Résultat Vertices

douglasPeuckerSimplify() public static méthode

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
Résultat Vertices

mergeIdenticalPoints() public static méthode

Merges the identical points in the polygon.
public static mergeIdenticalPoints ( Vertices vertices ) : Vertices
vertices Vertices The vertices.
Résultat Vertices

mergeParallelEdges() public static méthode

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.
Résultat Vertices

reduceByArea() public static méthode

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
Résultat Vertices

reduceByDistance() public static méthode

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.
Résultat Vertices

reduceByNth() public static méthode

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.
Résultat Vertices