C# Class Project290.Physics.Common.PolygonManipulation.SimplifyTools

Afficher le fichier Open project: scastle/Solitude

Méthodes publiques

Méthode Description
CollinearSimplify ( Vertices vertices ) : Vertices

Removes all collinear points on the polygon. Has a default bias of 0

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 ) : void

Merges all parallel edges in the list of vertices

ReduceByArea ( Vertices vertices, float areaTolerance ) : Vertices
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
DistancePointLine ( Vector2 p, Vector2 A, Vector2 B ) : double
DistancePointPoint ( Vector2 p, Vector2 p2 ) : double
SimplifySection ( Vertices vertices, int i, int j ) : void

Method Details

CollinearSimplify() public static méthode

Removes all collinear points on the polygon. Has a default bias of 0
public static CollinearSimplify ( Vertices vertices ) : Vertices
vertices Vertices The polygon that needs simplification.
Résultat Vertices

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 ) : void
vertices Vertices The vertices.
tolerance float The tolerance.
Résultat void

ReduceByArea() public static méthode

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 'joined'.
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