C# 클래스 Project290.Physics.Common.PolygonManipulation.SimplifyTools

파일 보기 프로젝트 열기: scastle/Solitude

공개 메소드들

메소드 설명
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.

비공개 메소드들

메소드 설명
DistancePointLine ( Vector2 p, Vector2 A, Vector2 B ) : double
DistancePointPoint ( Vector2 p, Vector2 p2 ) : double
SimplifySection ( Vertices vertices, int i, int j ) : void

메소드 상세

CollinearSimplify() 공개 정적인 메소드

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.
리턴 Vertices

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 ) : void
vertices Vertices The vertices.
tolerance float The tolerance.
리턴 void

ReduceByArea() 공개 정적인 메소드

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