Table of Contents

Class SimplifyTools

Provides a set of tools to simplify polygons in various ways.

public static class SimplifyTools

Inheritance

Inherited Members

Methods

CollinearSimplify(Vertices, float)

Removes all collinear points on the polygon.

public static Vertices CollinearSimplify(Vertices vertices, float collinearityTolerance = 0)

Parameters

vertices Vertices

The polygon that needs simplification.

collinearityTolerance float

The collinearity tolerance.

Returns

Vertices

A simplified polygon.

DouglasPeuckerSimplify(Vertices, float)

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 Vertices DouglasPeuckerSimplify(Vertices vertices, float distanceTolerance)

Parameters

vertices Vertices
distanceTolerance float

Returns

Vertices

The simplified polygon

MergeIdenticalPoints(Vertices)

Merges the identical points in the polygon.

public static Vertices MergeIdenticalPoints(Vertices vertices)

Parameters

vertices Vertices

The vertices.

Returns

Vertices

MergeParallelEdges(Vertices, float)

Merges all parallel edges in the list of vertices

public static Vertices MergeParallelEdges(Vertices vertices, float tolerance)

Parameters

vertices Vertices

The vertices.

tolerance float

The tolerance.

Returns

Vertices

ReduceByArea(Vertices, float)

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 Vertices ReduceByArea(Vertices vertices, float areaTolerance)

Parameters

vertices Vertices
areaTolerance float

Returns

Vertices

ReduceByDistance(Vertices, float)

Reduces the polygon by distance.

public static Vertices ReduceByDistance(Vertices vertices, float distance)

Parameters

vertices Vertices

The vertices.

distance float

The distance between points. Points closer than this will be removed.

Returns

Vertices

ReduceByNth(Vertices, int)

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

public static Vertices ReduceByNth(Vertices vertices, int nth)

Parameters

vertices Vertices

The vertices.

nth int

The Nth point to remove. Example: 5.

Returns

Vertices

SimplifySection(Vertices, int, int, bool[], float)

Simplifies the section using the specified vertices

private static void SimplifySection(Vertices vertices, int i, int j, bool[] usePoint, float distanceTolerance)

Parameters

vertices Vertices

The vertices

i int

The

j int

The

usePoint bool[]

The use point

distanceTolerance float

The distance tolerance