Class SimplifyTools
- Assembly
- Alis.dll
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
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
MergeParallelEdges(Vertices, float)
Merges all parallel edges in the list of vertices
public static Vertices MergeParallelEdges(Vertices vertices, float tolerance)
Parameters
Returns
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
Returns
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
ReduceByNth(Vertices, int)
Reduces the polygon by removing the Nth vertex in the vertices list.
public static Vertices ReduceByNth(Vertices vertices, int nth)
Parameters
Returns
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)